SimpleX-Chat/docs/CONTRIBUTING.md

115 lines
4 KiB
Markdown
Raw Normal View History

website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
---
title: Contributing guide
revision: 31.01.2023
---
| Updated 31.01.2023 | Languages: EN, [FR](/docs/lang/fr/CONTRIBUTING.md), [CZ](/docs/lang/cs/CONTRIBUTING.md), [PL](/docs/lang/pl/CONTRIBUTING.md) |
# 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:
```
cp scripts/cabal.project.local.mac cabal.project.local
# or
# cp scripts/cabal.project.local.linux cabal.project.local
```
## OpenSSL on MacOS
MacOS comes with LibreSSL as default, OpenSSL must be installed to compile SimpleX from source.
OpenSSL can be installed with `brew install openssl@1.1`
You will have to add `/opt/homebrew/opt/openssl@1.1/bin` to your PATH in order to have things working properly
## Project branches
**In simplex-chat repo**
2024-04-14 22:42:04 +07:00
- `stable` - stable release of the apps, can be used for updates to the previous stable release (GHC 9.6.4).
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-11-08 12:50:56 +00:00
- `stable-ios` - used to build stable iOS core library with Nix (GHC 8.10.7) this branch should be the same as `stable-android` except Nix configuration files. Deprecated.
2024-04-14 22:42:04 +07:00
- `master` - branch for beta version releases (GHC 9.6.4).
2023-11-08 12:50:56 +00:00
- `master-ghc8107` - branch for beta version releases (GHC 8.10.7). Deprecated.
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-11-08 12:50:56 +00:00
- `master-ios` - used to build beta iOS core library with Nix (GHC 8.10.7). Deprecated.
2023-09-27 22:19:20 +01:00
2023-11-08 12:50:56 +00:00
- `windows-ghc8107` - branch for windows core library build (GHC 8.10.7). Deprecated?
2023-09-27 22:19:20 +01:00
`master-ios` and `windows-ghc8107` branches should be the same as `master-ghc8107` except Nix configuration files.
**In simplexmq repo**
2024-04-14 22:42:04 +07:00
- `master` - uses GHC 9.6.4 its commit should be used in `master` branch of simplex-chat repo.
2023-11-08 12:50:56 +00:00
- `master-ghc8107` - its commit should be used in `master-android` (and `master-ios`) branch of simplex-chat repo. Deprecated.
## Development & release process
1. Make PRs to `master` branch _only_ for both simplex-chat and simplexmq repos.
2. If simplexmq repo was changed, to build mobile core libraries you need to merge its `master` branch into `master-ghc8107` branch.
2023-09-27 22:19:20 +01:00
3. To build core libraries for Android, iOS and windows:
2023-11-08 12:50:56 +00:00
- merge `master` branch to `master-android` branch.
- update code to be compatible with GHC 8.10.7 (see below).
- push to GitHub.
2023-11-08 12:50:56 +00:00
4. All libraries should be built from `master` branch, Android armv7a - from `master-android` branch.
2023-09-27 22:19:20 +01:00
2023-11-08 12:50:56 +00:00
5. 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
2023-11-08 12:50:56 +00:00
6. After the public release to App Store and Play Store, merge:
- `master` to `stable`
2023-11-08 12:50:56 +00:00
- `master` to `master-android` (and compile/update code)
- `master-android` to `stable-android`
2023-11-08 12:50:56 +00:00
7. Independently, `master` branch of simplexmq repo should be merged to `stable` branch on stable releases.
2024-04-14 22:42:04 +07:00
## Differences between GHC 8.10.7 and GHC 9.6.4
1. The main difference is related to `DuplicateRecordFields` extension.
2024-04-14 22:42:04 +07:00
It is no longer possible in GHC 9.6.4 to specify type when using selectors, instead OverloadedRecordDot extension and syntax are used that need to be removed in GHC 8.10.7:
```haskell
{-# LANGUAGE DuplicateRecordFields #-}
2024-04-14 22:42:04 +07:00
-- use this in GHC 9.6.4 when needed
{-# LANGUAGE OverloadedRecordDot #-}
2024-04-14 22:42:04 +07:00
-- GHC 9.6.4 syntax
let x = record.field
2024-04-14 22:42:04 +07:00
-- GHC 8.10.7 syntax absent in GHC 9.6.4
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-14 22:42:04 +07:00
-- use this in GHC 9.6.4 when needed
{-# 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-14 22:42:04 +07:00
-- use this in GHC 9.6.4 when needed
import Control.Monad
```
[This PR](https://github.com/simplex-chat/simplex-chat/pull/2975/files) has all the differences.