Skip to content

Commit 0ec9747

Browse files
wfurtTomas Weinfurt
andauthored
add requirement doc for FreeBSD (#35704)
* add freebsd requirements * corrections * format * feedback from review * more cleanup Co-authored-by: Tomas Weinfurt <[email protected]>
1 parent 3058899 commit 0ec9747

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

docs/workflow/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The repo can be built for the following platforms, using the provided setup and
1010
| x86 | &#x2714; | | | |
1111
| ARM | &#x2714; | &#x2714; | | |
1212
| ARM64 | &#x2714; | &#x2714; | | |
13-
| | [Requirements](requirements/windows-requirements.md) | [Requirements](requirements/linux-requirements.md) | [Requirements](requirements/macos-requirements.md) |
13+
| | [Requirements](requirements/windows-requirements.md) | [Requirements](requirements/linux-requirements.md) | [Requirements](requirements/macos-requirements.md) | [Requirements](requirements/freebsd-requirements.md)
1414

1515
Before proceeding further, please click on the link above that matches your machine and ensure you have installed all the prerequisites for the build to work.
1616

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Requirements to build dotnet/runtime on FreeBSD
2+
=====================
3+
4+
This guide will walk you through the requirements needed to build dotnet/runtime on FreeBSD. We'll start by showing how to set up your environment from scratch.
5+
Since there is no official build and FreeBSD package, native build on FreeBSD is not trivial. There are generally three options, sorted by ease of use:
6+
- cross-compile on Linux using Docker
7+
- cross-compile on Linux using Toolchain
8+
- build on FreeBSD
9+
10+
11+
Environment
12+
===========
13+
14+
These instructions were validated for and on FreeBSD 11.3 and 12.1.
15+
16+
Build using Docker on Linux
17+
---------------------------
18+
19+
This is similar to [Linux](linux-requirements.md) instructions. https://github.com/dotnet/dotnet-buildtools-prereqs-docker repro provides images
20+
with all needed prerequisites to build. As the example bellow may become stale, https://github.com/dotnet/versions/blob/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-master.json offers list of latest Docker tags.
21+
22+
```sh
23+
TAG=mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-11-20200430154008-a84b0d2
24+
docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --env ROOTFS_DIR=/crossrootfs/x64 -ti $TAG ./build.sh -cross -FreeBSD
25+
```
26+
27+
Build using Toolchain Setup
28+
---------------------------
29+
To build FreeBSD images, prerequisites described in [Linux](linux-requirements.md) are needed. Additionally, crossrootfs for FreeBSD needs to be constructed.
30+
In order to successfully build FreeBSD crossrootfs, few more packages needs to be installed. Following example is for Ubuntu 18:
31+
```sh
32+
apt-get install -y libbz2-dev libz-dev liblzma-dev libarchive-dev libbsd-dev
33+
```
34+
With prerequisites for crossrootfs one can run:
35+
```sh
36+
./eng/common/cross/build-rootfs.sh freebsd11 $(pwd)/rootfs/freebsd
37+
```
38+
After that, FreeBSD build can be started by running
39+
```
40+
ROOTFS_DIR=$(pwd)/rootfs/freebsd ./build.sh -cross -os FreeBSD
41+
```
42+
43+
44+
Building on FreeBSD
45+
-------------------
46+
47+
Building dotnet/runtime depends on several tools to be installed.
48+
49+
Install the following packages:
50+
51+
- cmake
52+
- autoconf
53+
- automake
54+
- libtool
55+
- icu
56+
- libunwind
57+
- lttng-ust
58+
- krb5
59+
- openssl (optional)
60+
61+
The lines to install all the packages above using package manager.
62+
63+
```sh
64+
sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake autoconf automake openssl
65+
```
66+
67+
Additionally, working dotnet cli with SDK is needed. On other platforms this would be downloaded automatically during build but it is not currently available for FreeBSD.
68+
It needs to be built once on supported platform or obtained via community resources.
69+

0 commit comments

Comments
 (0)