2023-05-01 02:31:23 +05:00
---
title: Contributing guide
revision: 31.01.2023
---
2024-04-13 13:12:21 +02:00
| Updated 31.01.2023 | Languages: EN, [FR ](/docs/lang/fr/CONTRIBUTING.md ), [CZ ](/docs/lang/cs/CONTRIBUTING.md ), [PL ](/docs/lang/pl/CONTRIBUTING.md ) |
2023-02-08 14:03:52 +00:00
2022-08-30 12:49:07 +01:00
# Contributing guide
## Compiling with SQLCipher encryption enabled
Add `cabal.project.local` to project root with the location of OpenSSL headers and libraries and flag setting encryption mode:
```
2022-11-18 17:54:57 +00:00
cp scripts/cabal.project.local.mac cabal.project.local
# or
# cp scripts/cabal.project.local.linux cabal.project.local
2022-08-30 12:49:07 +01:00
```
2022-11-18 22:29:02 +03:00
## OpenSSL on MacOS
MacOS comes with LibreSSL as default, OpenSSL must be installed to compile SimpleX from source.
2024-11-22 18:38:49 +00:00
OpenSSL can be installed with `brew install openssl@3.0`
2022-11-18 22:29:02 +03:00
2024-11-22 18:38:49 +00:00
You will have to add `/opt/homebrew/opt/openssl@3.0/bin` to your PATH in order to have things working properly
2023-09-18 21:29:56 +01:00
## Project branches
**In simplex-chat repo**
2024-04-19 21:17:22 +01:00
- `stable` - stable release of the apps, can be used for updates to the previous stable release (GHC 9.6.3).
2023-09-18 21:29:56 +01:00
2023-11-08 12:50:56 +00:00
- `stable-android` - used to build stable Android core library with Nix (GHC 8.10.7) - only for Android armv7a.
2023-09-18 21:29:56 +01:00
2024-07-03 22:51:21 +01:00
- `master` - branch for beta version releases (compatible with both GHC 9.6.3 and 8.10.7).
2023-09-18 21:29:56 +01:00
2023-11-08 12:50:56 +00:00
- `master-android` - used to build beta Android core library with Nix (GHC 8.10.7) - only for Android armv7a.
2023-09-27 22:19:20 +01:00
2023-09-18 21:29:56 +01:00
**In simplexmq repo**
2024-07-03 22:51:21 +01:00
- `master` - compatible with both GHC 9.6.3 and 8.10.7.
2023-09-18 21:29:56 +01:00
## Development & release process
1. Make PRs to `master` branch _only_ for both simplex-chat and simplexmq repos.
2024-07-03 22:51:21 +01:00
2. To build core libraries for Android, iOS and windows:
2023-11-08 12:50:56 +00:00
- merge `master` branch to `master-android` branch.
2023-09-18 21:29:56 +01:00
- push to GitHub.
2024-07-03 22:51:21 +01:00
3. All libraries should be built from `master` branch, Android armv7a - from `master-android` branch.
2023-09-27 22:19:20 +01:00
2024-07-03 22:51:21 +01:00
4. To build Desktop and CLI apps, make tag in `master` branch, APK files should be attached to the release.
2023-09-27 22:19:20 +01:00
2024-07-03 22:51:21 +01:00
5. After the public release to App Store and Play Store, merge:
2023-09-18 21:29:56 +01:00
- `master` to `stable`
2023-11-08 12:50:56 +00:00
- `master` to `master-android` (and compile/update code)
2023-09-18 21:29:56 +01:00
- `master-android` to `stable-android`
2024-07-03 22:51:21 +01:00
6. Independently, `master` branch of simplexmq repo should be merged to `stable` branch on stable releases.
## Branches and PRs
Use change scope (or comma separated scopes) as the first word in the PR names, followed by the colon. Commit name itself should be lowercase, in present tense.
The PR names in simplex-chat repo are used in release notes, they should describe the solved problem and not the change. Possible PR scopes:
- ios
- android
- desktop
- core
- docs
- website
- ci
We squash PRs, do not rewrite branch history after the review.
2023-09-18 21:29:56 +01:00
2024-07-03 22:51:21 +01:00
For some complex features we create feature branches that will be merged once ready - do not make commits directly to them, make PRs to feature branches.
2023-09-18 21:29:56 +01:00
2024-04-19 21:17:22 +01:00
## Differences between GHC 8.10.7 and GHC 9.6.3
2023-09-18 21:29:56 +01:00
1. The main difference is related to `DuplicateRecordFields` extension.
2024-04-19 21:17:22 +01:00
It is no longer possible in GHC 9.6.3 to specify type when using selectors, instead OverloadedRecordDot extension and syntax are used that need to be removed in GHC 8.10.7:
2023-09-18 21:29:56 +01:00
```haskell
{-# LANGUAGE DuplicateRecordFields #-}
2024-04-19 21:17:22 +01:00
-- use this in GHC 9.6.3 when needed
2023-09-18 21:29:56 +01:00
{-# LANGUAGE OverloadedRecordDot #-}
2024-04-19 21:17:22 +01:00
-- GHC 9.6.3 syntax
2023-09-18 21:29:56 +01:00
let x = record.field
2024-04-19 21:17:22 +01:00
-- GHC 8.10.7 syntax removed in GHC 9.6.3
2023-09-18 21:29:56 +01:00
let x = field (record :: Record)
```
It is still possible to specify type when using record update syntax, use this pragma to suppress compiler warning:
```haskell
2024-04-19 21:17:22 +01:00
-- use this in GHC 9.6.3 when needed
2023-09-18 21:29:56 +01:00
{-# OPTIONS_GHC -fno-warn-ambiguous-fields #-}
let r' = (record :: Record) {field = value}
```
2. Most monad functions now have to be imported from `Control.Monad` , and not from specific monad modules (e.g. `Control.Monad.Except` ).
```haskell
2024-04-19 21:17:22 +01:00
-- use this in GHC 9.6.3 when needed
2023-09-18 21:29:56 +01:00
import Control.Monad
```
[This PR ](https://github.com/simplex-chat/simplex-chat/pull/2975/files ) has all the differences.