Skip to content

Commit da5e1bd

Browse files
[Docs] Add installation tips about Rust and Go (#1123)
* [Docs] Add installation tips about Rust and Go [skip azp] * Update docs/src/build_tips.md Co-authored-by: Fredrik Ekre <[email protected]> Co-authored-by: Fredrik Ekre <[email protected]>
1 parent 89d8d24 commit da5e1bd

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/src/build_tips.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,40 @@ Examples of builds performed with Meson include:
8383
this script modifies `c_args` in the Meson cross file in order to add an include directory;
8484
* [xkbcommon](https://github.com/JuliaPackaging/Yggdrasil/blob/2f3638292c99fa6032634517f8a1aa8360d6fe8d/X/xkbcommon/build_tarballs.jl#L26-L30).
8585

86+
## Go builds
87+
88+
The Go toolchain provided by BinaryBuilder can be requested by adding `:go` to the `compilers` keyword argument to [`build_tarballs`](@ref): `compilers=[:c, :go]`. Go-based packages can usually be built and installed with `go`:
89+
90+
```sh
91+
go build -o ${bindir}
92+
```
93+
94+
The Go toolchain provided by BinaryBuilder automatically selects the appropriate target.
95+
96+
Example of packages using Go:
97+
98+
* [pprof](https://github.com/JuliaPackaging/Yggdrasil/blob/ea43d07d264046e8c94a460907bba209a015c10f/P/pprof/build_tarballs.jl#L21-L22): it uses `go build` to compile the program and manually moves the executable to `${bindir}`.
99+
100+
## Rust builds
101+
102+
The Rust toolchain provided by BinaryBuilder can be requested by adding `:rust` to the `compilers` keyword argument to [`build_tarballs`](@ref): `compilers=[:c, :rust]`. Rust-based packages can usually be built with `cargo`:
103+
104+
```sh
105+
cargo build --release
106+
```
107+
108+
The Rust toolchain provided by BinaryBuilder automatically selects the appropriate target and number of parallel jobs to be used. Note, however, that you may have to manually install the product in the `${prefix}`. Read the installation instructions of the package in case they recommend a different build procedure.
109+
110+
Example of packages using Rust:
111+
112+
* [Tokei](https://github.com/JuliaPackaging/Yggdrasil/blob/ea43d07d264046e8c94a460907bba209a015c10f/T/Tokei/build_tarballs.jl#L14-L15): it uses `cargo build` to compile the program and manually moves the executable to `${bindir}`;
113+
* [Librsvg](https://github.com/JuliaPackaging/Yggdrasil/blob/ea43d07d264046e8c94a460907bba209a015c10f/L/Librsvg/build_tarballs.jl#L35-L45): it uses a build system based on Autoconf which would internally call `cargo build`, but the user has to follow the `./configure` + `make` + `make install` sequence.
114+
115+
116+
!!! warn
117+
118+
The Rust toolchain currently used does not work with the `i686-w64-mingw32` (32-bit Windows) platform.
119+
86120
## Editing files in the wizard
87121

88122
In the wizard, the `vim` editor is available for editing files. But, it doesn't leave any record in the build script. One generally needs to provide patch files or use something like `sed`. If a file needs patching, we suggest using `git` to add the entire worktree to a new repo, make the changes you need, then use `git diff -p` to output a patch that can be included alongside your build recipe.

0 commit comments

Comments
 (0)