You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+29-8Lines changed: 29 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,13 @@ If you are submitting a recipe for a new package, follow the suggestions in the
18
18
If you want to build a new version of an existing package, you can open a pull request which updates the sources and the version number of the package as appropriate.
19
19
In most cases it is sufficient to change only these two properties of the recipe, but sometimes more work will be required if there are any changes in the build system (e.g. changed dependencies, or options for the build system) or bugs in the source code to deal with.
20
20
21
+
### Compatibility tips
22
+
23
+
When building binary packages we have to deal with [several incompatibilities](https://docs.binarybuilder.org/stable/tricksy_gotchas/).
24
+
As a general remark, when using GCC as compiler (which is default when targeting Linux and Windows platforms) try to use the ***oldest*** versions that is able to compile your code, which can be selected with the `preferred_gcc_version` keyword argument to the [`build_tarballs`](https://docs.binarybuilder.org/stable/reference/#BinaryBuilder.build_tarballs) function, especially for [C++ code](https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html), this is the only way to get maximum compatibility.
25
+
In any case, avoid using GCC 11+ when building C++, as that would be incompatible with Julia v1.6, the current Long Term Support version.
26
+
There are currently no such problems with LLVM (the default compiler framework used when targeting macOS and FreeBSD), so that you can generally use the latest version of LLVM available, which is already the default.
27
+
21
28
### Recommendations and tips about commit messages
22
29
23
30
Yggdrasil is a collection of recipes for hundreds of different packages.
@@ -43,26 +50,40 @@ are not descriptive (virtually all pull requests update a file called `build_tar
43
50
44
51
#### Special keywords in commit messages
45
52
46
-
There are some special tags that can be used anywhere in a commit message to do something special.
47
-
Yggdrasil currently uses Azure Pipelines for CI, this allows using some [special keywords](https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#skipping-ci-for-individual-pushes) to allow skipping CI on commits, like `[skip ci]` or `[skip azp]`.
48
-
However these have effect only if the keywords appear in the commit message of the tip of branch which triggered the workflow: in pull requests the tip of the branch is always the merge commit automatically generated by GitHub, so that `[skip ci]` in your commit will be ignored when running CI for a pull request.
49
-
Instead, this does have effect if the keyword is included in the commit which triggers CI on the default branch, for example if the pull request has been squash-merged by a maintainer.
50
-
51
-
Another special keyword which is `[skip build]`. This is a two-fold effect:
53
+
Anywhere in a commit message you can use the special keyword `[skip build]`, which has a two-fold effect:
52
54
53
55
* in pull requests, a build of the touched packages will not be performed
54
56
* for commits pushed to the default branch, a new build of the touched packages will not be performed but a new version of the correspoding JLL packages will be published, using as artifacts those from the latest registered versions of the packages (the build number will be increased by one).
55
57
58
+
### Understanding build cache on Yggdrasil
59
+
60
+
On Yggdrasil we run hundreds of builds every day.
61
+
To minimise build times, we have a complex building infrastructure to cache as many build artifacts as possible:
62
+
63
+
* BinaryBuilder uses by default [`ccache`](https://ccache.dev/) to cache compilers artifacts where possible;
64
+
* on Yggdrasil we cache all successful builds, to avoid rebuilding packages unneedlessly.
65
+
This cache in indexed by:
66
+
67
+
* the git tree hash of the directory where the `build_tarballs.jl` file is
68
+
* the hash of the [`.ci/Manifest.toml`](.ci/Manifest.toml) file.
69
+
70
+
This means that if you trigger a build which changes neither of them after a successful run, then a build will not actually happen.
71
+
For this reason, please ***refrain from running builds which only rebase/merge your branch on the default branch*** after a fully successful build: there will be no build log, and reviewers will have a much harder time than necessary to find the audit logs.
72
+
These rebuilds are also completely useless, as the build artifacts will in most cases be [bit-by-bit identical](https://docs.binarybuilder.org/stable/#Reproducibility) to the previous ones, only causing waste of time, resources, and energy.
73
+
56
74
## Information for maintainers
57
75
58
76
Here are some recommendations for Yggdrasil maintainers:
59
77
60
78
* before merging a pull request, make sure the log of the build does not contain important warnings or error messages such as
61
79
* missing license file. This is reported as an error in CI log during audit but it is not as a fatal error which would prevent successful build
62
80
* "Linked library `<LIBRARY NAME>` could not be resolved and could not be auto-mapped"
63
-
* make sure a pull request is not changing julia compat bounds without changing the version number of the package.
81
+
* make sure a pull request is not changing julia compat bounds without changing the version number of the package
64
82
This is particularly important when building an existing package for the first time for [aarch64-darwin or armv6l-linux](https://github.com/JuliaPackaging/Yggdrasil/issues/2763)
65
83
* make sure dependencies of [packages with known incompatibilities](https://github.com/JuliaPackaging/Yggdrasil/issues/3024) are pinned correctly
66
84
* always [squash and merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits) pull requests, to keep history short and linear.
67
85
There is little need to preserve full history of individual pull requests.
68
-
This also makes sure special keywords in commit messages are part of the commit which triggers the CI workflow and so they can have effect.
86
+
This also makes sure special keywords in commit messages are part of the commit which triggers the CI workflow and so they can have effect
87
+
* use special commit message keywords as appropriate:
88
+
*`[skip ci]` to not run CI at all when merging a pull request
89
+
*`[skip build]` to only update the JLL wrapper of a package without rebuilding the package once again
@@ -15,7 +15,7 @@ To contribute a new recipe, you can either
15
15
16
16
Yggdrasil builds the tarballs using `master` version of BinaryBuilder.jl, which requires Julia 1.3.0 or later versions. Note that this BinaryBuilder.jl version has some differences compared to v0.1.4 and the builders generated are slightly different. You are welcome to contribute builders written for BinaryBuilder.jl v0.1.4, but they will likely need minor adjustements.
17
17
18
-
[Azure pipelines](https://dev.azure.com/JuliaPackaging/Yggdrasil/_build?view=runs) are used to test that the builders can successfully produce the tarballs.
18
+
[Buildkite CI](https://buildkite.com/julialang/yggdrasil) is used to test that the builders can successfully produce the tarballs.
19
19
20
20
If you prefer to test your manual buildscript before opening the pull request, we suggest installing `BinaryBuilder.jl` on Julia 1.3 or any following release and running `julia --color=yes build_tarballs.jl --verbose --debug` locally. On MacOS, you will need to have `docker` installed for this to work.
0 commit comments