Skip to content

Commit a12aed9

Browse files
Merge pull request dotnet#4504 from krytarowski/netbsd-support-72
Add initial NetBSD documentation
2 parents 7730864 + 229be29 commit a12aed9

File tree

3 files changed

+132
-5
lines changed

3 files changed

+132
-5
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
Build CoreCLR on NetBSD
2+
=======================
3+
4+
This guide will walk you through building CoreCLR on NetBSD. We'll start by showing how to set up your environment from scratch.
5+
6+
Environment
7+
===========
8+
9+
These instructions are written on NetBSD 7.x on the amd64 platform, since that's the release the team uses.
10+
11+
Older releases aren't supported because building CoreCLR requires the modern LLVM stack (Clang, libunwind, and LLDB) that is developed against the NetBSD-7.x branch.
12+
13+
Pull Requests are welcome to address other ports (like i386 or evbarm) as long as they don't break the ability to use NetBSD/amd64.
14+
15+
Minimum RAM required to build is 1GB.
16+
17+
The pkgsrc framework is required to build .NET projects on NetBSD. Minimal pkgsrc version required is 2016Q1.
18+
19+
pkgsrc setup
20+
------------
21+
22+
Fetch pkgsrc and install to the system. By default it's done in the /usr directory as root:
23+
24+
```
25+
ftp -o- ftp://ftp.netbsd.org/pub/pkgsrc/stable/pkgsrc.tar.gz | tar -zxpf- -C /usr
26+
```
27+
28+
The .NET projects are tracked in pkgsrc-wip.
29+
30+
In order to use pkgsrc-wip, git must be installed:
31+
32+
33+
```
34+
cd /usr/pkgsrc/devel/git-base && make install
35+
```
36+
37+
To access resources over SSL link, mozilla-rootcerts must be installed:
38+
39+
```
40+
cd /usr/pkgsrc/security/mozilla-rootcerts && make install
41+
```
42+
43+
And follow the MESSAGE commands to finish the installation.
44+
45+
46+
Installing pkgsrc-wip
47+
---------------------
48+
49+
Type the following command to fetch the pkgsrc-wip sources:
50+
51+
52+
```
53+
cd /usr/pkgsrc
54+
git clone --depth 1 git://wip.pkgsrc.org/pkgsrc-wip.git wip
55+
```
56+
57+
Then install the CoreCLR package you need:
58+
59+
```
60+
cd /usr/pkgsrc/wip/coreclr-git
61+
make install
62+
```
63+
64+
CoreCLR is installed in `/usr/pkg/CoreCLR` subdirectory by default.
65+
66+
67+
PAL tests
68+
=========
69+
70+
To run PAL tests on NetBSD, use the `make test` in the coreclr-git package from pkgsrc-wip:
71+
72+
```
73+
cd /usr/pkgsrc/wip/coreclr-git
74+
make test
75+
```
76+
77+
Build CoreFX
78+
============
79+
80+
The CoreFX package is located in pkgsrc-wip as corefx-git. In order to build it you need to perform the following command:
81+
82+
```
83+
cd /usr/pkgsrc/wip/coreclr-git
84+
make
85+
```
86+
87+
At the moment there is no install or test target in the pkgsrc framework.
88+
89+
CoreFX tests
90+
============
91+
92+
The steps to run CoreFX managed code tests:
93+
94+
Build CoreCLR (with pkgsrc-wip/coreclr-git) on NetBSD x64, Debug and install the Product dir to /usr/pkg/CoreCLR:
95+
96+
```
97+
cd /usr/pkgsrc/wip/coreclr-git && make install
98+
```
99+
100+
Build CoreFX native x64 Debug and the work (build) dir is in /usr/pkgsrc/wip/corefx-git/work/corefx:
101+
102+
```
103+
cd /usr/pkgsrc/wip/corefx-git && make
104+
```
105+
106+
Build CoreCLR Debug x64 on Linux and copy mscorlib.dll from ./bin/Product/Linux.x64.Debug/mscorlib.dll to NetBSD machine under /usr/pkg/CoreCLR:
107+
108+
```
109+
./build.sh mscorlib Debug
110+
```
111+
112+
Build CoreFX Debug x64 on Linux and copy bin/ to NetBSD machine under /public/bin:
113+
114+
```
115+
./build.sh /p:OSGroup=NetBSD /p:SkipTests=true
116+
```
117+
118+
Run ./run-test.sh:
119+
120+
```
121+
$ pwd
122+
/usr/pkgsrc/wip/corefx-git/work/corefx
123+
$ ./run-test.sh \
124+
--coreclr-bins /usr/pkg/CoreCLR/ \
125+
--mscorlib-bins /usr/pkg/CoreCLR/ \
126+
--corefx-tests /public/bin/tests/NetBSD.AnyCPU.Debug/ \
127+
--corefx-native-bins ./bin/NetBSD.x64.Debug/Native/
128+
```

Documentation/building/testing-with-corefx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ As part of building tests, CoreFX restores a copy of the runtime from myget, in
99

1010
To run tests, follow the procedure for [running tests in CoreFX](https://github.com/dotnet/corefx/blob/master/Documentation/building/windows-instructions.md). You can pass `/p:BUILDTOOLS_OVERRIDE_RUNTIME=<path-to-coreclr>\bin\Product\Windows_NT.x64.Release` to build.cmd to set this property.
1111

12-
**Linux, OS X, FreeBSD**
12+
**FreeBSD, Linux, NetBSD, OS X**
1313

1414
Refer to the procedure for [running tests in CoreFX](https://github.com/dotnet/corefx/blob/master/Documentation/building/cross-platform-testing.md)
1515
- Note the --coreclr-bins and --mscorlib-bins arguments to [run-test.sh](https://github.com/dotnet/corefx/blob/master/run-test.sh)

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Build Status
2323
Building the Repo
2424
-------------
2525

26-
|Linux |Windows |Mac OS X |FreeBSD |
27-
|--------|--------|---------|---------|
28-
| [Instructions](Documentation/building/linux-instructions.md) | [Instructions](Documentation/building/windows-instructions.md) | [Instructions](Documentation/building/osx-instructions.md) | [Instructions](Documentation/building/freebsd-instructions.md) |
26+
|Linux |Windows |Mac OS X |FreeBSD | NetBSD |
27+
|--------|--------|---------|---------|--------|
28+
| [Instructions](Documentation/building/linux-instructions.md) | [Instructions](Documentation/building/windows-instructions.md) | [Instructions](Documentation/building/osx-instructions.md) | [Instructions](Documentation/building/freebsd-instructions.md) | [Instructions](Documentation/building/netbsd-instructions.md) |
2929

3030
Get .NET Core
3131
----------------------
@@ -91,4 +91,3 @@ There are many .NET projects on GitHub.
9191
[coreclr blog post]: http://blogs.msdn.com/b/dotnet/archive/2015/02/03/coreclr-is-now-open-source.aspx
9292
[corefx]: http://github.com/dotnet/corefx
9393
[coreclr]: http://github.com/dotnet/coreclr
94-

0 commit comments

Comments
 (0)