Skip to content

Commit 1b3cf75

Browse files
KebooCopilot
andauthored
Fix outdated build instructions in compiling docs (#58)
- Remove confusing 'copy {path_to_osx_update}' command from Release/Build section - Add clear per-platform build instructions for Windows, OSX, and Linux - Separate local dev builds from cross-platform production builds - Add links to Avalonia sample dev-scripts and CI workflows - Update prerequisites to .NET 8 SDK (removed .NET 6) - Fix incorrect 'src/Rust' reference to 'src/bins' in Linux section - Add OSX/Linux commands to Debug/Test section - Update Linux dotnet-install to only install .NET 8 Fixes #35 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 146f767 commit 1b3cf75

1 file changed

Lines changed: 39 additions & 9 deletions

File tree

docs/contributing/compiling.mdx

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ It is made up of:
1010
In order to test the project, you need to build the Rust binaries before compiling dotnet.
1111

1212
### Prerequisites
13-
- [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0)
1413
- [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)
1514
- [Rust / Cargo](https://www.rust-lang.org/tools/install)
1615
- `dotnet tool install -g dotnet-coverage`
1716
- `dotnet tool install -g nbgv`
1817

1918
### Debug / Test
20-
On windows, you need to build the Rust binaries using the `windows` feature before running tests. On OSX, you should run `cargo build` instead.
19+
On Windows, you need to build the Rust binaries using the `windows` feature before running tests. On OSX or Linux, you should run `cargo build` without the feature flag instead.
2120

21+
On Windows:
2222
```shell
2323
git clone https://github.com/velopack/velopack.git
2424
cd velopack/src/bins
@@ -28,25 +28,56 @@ dotnet build
2828
dotnet test --no-build
2929
```
3030

31+
On OSX / Linux:
32+
```shell
33+
git clone https://github.com/velopack/velopack.git
34+
cd velopack/src/bins
35+
cargo build
36+
cd ../../
37+
dotnet build
38+
dotnet test --no-build
39+
```
40+
3141
### Release / Build
32-
This is slightly complicated, because you will need to compile Rust on x64 OSX and x64 Windows before creating the final packages.
42+
Creating a full production release is complex because Velopack must include native binaries for Windows, Linux, and macOS. You need to build the Rust binaries separately on each platform, then combine them on the final build machine using `/p:PackRustAssets=true`.
43+
44+
For **local development**, you typically only need binaries for your current OS. The simplest approach is:
45+
46+
On Windows:
47+
```shell
48+
git clone https://github.com/velopack/velopack.git
49+
cd velopack/src/bins
50+
cargo build --release --features windows
51+
cd ../../
52+
dotnet build -c Release
53+
```
3354

3455
On OSX:
3556
```shell
3657
git clone https://github.com/velopack/velopack.git
3758
cd velopack/src/bins
3859
cargo build --release
60+
cd ../../
61+
dotnet build -c Release
3962
```
4063

41-
On Windows:
64+
On Linux:
4265
```shell
4366
git clone https://github.com/velopack/velopack.git
4467
cd velopack/src/bins
45-
cargo build --release --features windows
46-
copy {path_to_osx_update} target/release/updatemac
47-
dotnet build -c Release /p:PackRustAssets=true
68+
cargo build --release
69+
cd ../../
70+
dotnet build -c Release
4871
```
4972

73+
:::tip
74+
For a complete working example of building a release using local Velopack code, see the [dev-scripts in the Avalonia sample](https://github.com/velopack/velopack/tree/master/samples/CSharpAvalonia/dev-scripts).
75+
:::
76+
77+
:::note
78+
A full **cross-platform production build** (combining binaries from all operating systems into one package) requires building Rust on each platform first, then running `dotnet build -c Release /p:PackRustAssets=true` with all platform binaries present. This workflow is handled by CI and is not practical to replicate locally. See the [CI workflows](https://github.com/velopack/velopack/tree/master/.github/workflows) for details.
79+
:::
80+
5081
### Preparing Linux
5182
If you are on Linux (tested on Ubuntu), there are additional package pre-requisites:
5283
```shell
@@ -56,7 +87,6 @@ sudo apt install libssl-dev pkg-config build-essential
5687
Installing dotnet and setting up the paths are a pain, I recommend using the [dotnet-install.sh](https://learn.microsoft.com/dotnet/core/tools/dotnet-install-script) script.
5788

5889
```shell
59-
./dotnet-install.sh -c 6.0
6090
./dotnet-install.sh -c 8.0
6191
```
6292

@@ -82,7 +112,7 @@ dotnet could be at a different location (eg. `/usr/share/dotnet`) and the paths
82112

83113
Once dotnet is configured, you can Install Rust, typically done with the [rustup script available here](https://www.rust-lang.org/tools/install)
84114

85-
To verify that Rust is installed and working correctly, you should compile the Rust binaries in `src/Rust`:
115+
To verify that Rust is installed and working correctly, you should compile the Rust binaries in `src/bins`:
86116

87117
```shell
88118
cargo build --target x86_64-unknown-linux-gnu --release

0 commit comments

Comments
 (0)