Skip to content

Commit 37e2b1c

Browse files
committed
[docs] Update for OpenBSD 7.1.
Make the following documentation changes: * update last tested version number and emphasize that the process may work for later platform versions, * update required packages to emphasize py3 instead of py2.7, * python3 link is not strictly required to need root. * update the suggested checkout config file to the stable branch used in the "upstream" checkout config file, and * mention some extra flags are now required to properly switch off Dispatch (since without pr swiftlang/swift-corelibs-libdispatch#559 Dispatch won't compile). * reinforce building release by default, since the flags likely needed for debug builds aren't provided in the command snippet.
1 parent 495b020 commit 37e2b1c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

docs/OpenBSD.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Getting started with Swift on OpenBSD
22

3-
Swift builds and runs on OpenBSD (tested on 6.8), with some special considerations.
3+
Swift builds and runs on OpenBSD, with some special considerations. This document was last tested on OpenBSD 7.1, but may also work on later versions.
44

55
## Preparing
66

77
The following packages are required to build Swift. You can install these via `pkg_add`:
88

99
```shell
10-
$ doas pkg_add bash cmake e2fsprogs git icu4c ninja py-six python3
10+
$ doas pkg_add bash cmake e2fsprogs git icu4c ninja py3-six python3
1111
```
1212

1313
Because LLVM is built as part of building Swift and does not include some of the patches to handle the OpenBSD library naming convention, you will need to create some symlinks:
@@ -23,10 +23,10 @@ $ doas ln -s /usr/lib/libpthread.so.26.1 /usr/lib/libpthread.so
2323

2424
*Note: you may need to update the version numbers if necessary.*
2525

26-
Also link `~/bin/python` to the `python2.7` binary:
26+
Also link `~/bin/python` to the `python3` binary:
2727

2828
```shell
29-
$ doas ln -s /usr/local/bin/python2.7 ~/bin/python
29+
$ ln -s /usr/local/bin/python3 ~/bin/python
3030
```
3131

3232
Since the build requires significant amounts of memory at certain points, you may need to ensure that the user you are using to build Swift has the appropriate limits set. Using the `staff` group in `login.conf` and ensuring the shell limits are raised is recommended.
@@ -50,14 +50,16 @@ Download the sources with the [Getting Started](/docs/HowToGuides/GettingStarted
5050
"aliases": [ "main", "swift/main" ],
5151
"repos": {
5252
"cmark": "main",
53-
"llvm-project": "swift/main",
53+
"llvm-project": "stable/20211026",
5454
"swift": "main"
5555
}
5656
}
5757
}
5858
}
5959
```
6060

61+
*Note: you may need to check `utils/update_checkout/update-checkout-config.json` for the correct LLVM stable branch to build against.*
62+
6163
## Building
6264

6365
Once the sources have completed downloading, you can use the standard `build-script` mechanism to start building Swift. However, some options are required to be set to successfully build Swift.
@@ -66,23 +68,26 @@ These options are:
6668
* `--skip-build-clang-tools-extra` and `--skip-build-compiler-rt`: to ensure LLVM builds cleanly,
6769
* `--extra-cmake-options=`
6870
* `-DCMAKE_DISABLE_FIND_PACKAGE_Backtrace=TRUE,-DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=TRUE,-DLLVM_VERSION_SUFFIX=''`: to ensure LLVM builds cleanly,
69-
* `-DSWIFT_BUILD_SOURCEKIT=OFF,-DSWIFT_BUILD_SYNTAXPARSERLIB=OFF,-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=OFF`: to ensure Swift does not attempt to build libdispatch, which is not yet supported on OpenBSD,
71+
* `-DSWIFT_ENABLE_DISPATCH=FALSE,-DSWIFT_BUILD_SOURCEKIT=OFF,-DSWIFT_BUILD_SYNTAXPARSERLIB=OFF,-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=OFF,-DSWIFT_IMPLICIT_CONCURRENCY_IMPORT=OFF,-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=OFF`: to ensure Swift does not attempt to build libdispatch, which is not yet supported on OpenBSD,
7072
* `-DSWIFT_USE_LINKER=lld`: to specify that `lld` should be used over `gold`,
7173
* `-DCMAKE_INSTALL_DIR=/usr/local"`: to set the correct platform install directory.
7274

7375
In full, the minimal set of flags to supply to `build-script` looks like:
7476
```shell
7577
$ ./utils/build-script \
78+
--release \
7679
--skip-build-clang-tools-extra \
7780
--skip-build-compiler-rt \
7881
--extra-cmake-options="\
7982
-DCMAKE_DISABLE_FIND_PACKAGE_Backtrace=TRUE,\
8083
-DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=TRUE,\
8184
-DLLVM_VERSION_SUFFIX='',\
85+
-DSWIFT_ENABLE_DISPATCH=OFF,\
8286
-DSWIFT_BUILD_SOURCEKIT=OFF,\
8387
-DSWIFT_BUILD_SYNTAXPARSERLIB=OFF,\
8488
-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=OFF,\
8589
-DSWIFT_IMPLICIT_CONCURRENCY_IMPORT=OFF,\
90+
-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=OFF,\
8691
-DSWIFT_USE_LINKER=lld,\
8792
-DCMAKE_INSTALL_DIR=/usr/local"
8893
```

0 commit comments

Comments
 (0)