-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More CI speed #1626
Merged
More CI speed #1626
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,7 +268,28 @@ | |
# Build *just* the cargo dependencies, so we can reuse all of that work (e.g. via cachix) when running in CI | ||
cargoArtifacts = craneLib.buildDepsOnly { | ||
inherit pname src; | ||
cargoExtraArgs = "${cargoBuildExtraArgs} --workspace --all-features"; | ||
cargoExtraArgs = "${cargoBuildExtraArgs} --all-features"; | ||
# If we build all the packages at once, feature unification takes | ||
# over and we get libraries with different sets of features than | ||
# we would get building them separately. Meaning that when we | ||
# later build them separately, it won't hit the cache. So instead, | ||
# we need to build each package separately when we are collecting | ||
# dependencies. | ||
cargoBuildCommand = "cargoWorkspace build"; | ||
cargoTestCommand = "cargoWorkspace test"; | ||
cargoCheckCommand = "cargoWorkspace check"; | ||
preBuild = '' | ||
cargoWorkspace() { | ||
command=$(shift) | ||
for packageDir in $(${pkgs.yq}/bin/tomlq -r '.workspace.members[]' Cargo.toml); do | ||
( | ||
cd $packageDir | ||
pwd | ||
cargoWithProfile $command "$@" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. somewhere in |
||
) | ||
done | ||
} | ||
''; | ||
# pyo3 needs a Python interpreter in the build environment | ||
# https://pyo3.rs/v0.17.3/building_and_distribution#configuring-the-python-version | ||
buildInputs = [ pkgs.python3 ]; | ||
|
@@ -618,9 +639,11 @@ | |
nickel-lang-cli | ||
nickel-lang-core | ||
rustfmt; | ||
# An optimizing release build is long: eschew optimizations in checks by | ||
# building a dev profile | ||
nickelWasm = buildNickelWasm { profile = "dev"; }; | ||
# There's a tradeoff here: "release" build is in theory longer than | ||
# "dev", but it hits the cache on dependencies so in practice it is | ||
# shorter. Another option would be to compile a dev dependencies version | ||
# of cargoArtifacts. But that almost doubles the cache space. | ||
nickelWasm = buildNickelWasm { profile = "release"; }; | ||
inherit vscodeExtension; | ||
pre-commit = pre-commit-builder { }; | ||
}; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep all features here? Or keep it but make sure that the subsequent
buildPackage
also have all-features? From our last discussion I had the impression that what we want is that the features set used to build the packages should be - as much as possible - the same feature set as the one used incargoArtifacts
. In fact I think on the CI we should probably always enable all features by default (the best would be to test different feature sets, but if we have to chose one feature set, all-features is probably the one with the maximal covering)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only an issue if we have upstream dependencies whose feature sets depends on the set of features enabled on our crates. At the moment, we don't have any such situations, but in theory it could come up in the future. My impulse is to deal with it if/when it comes up, but the downside of that is that nobody will notice anything is wrong, CI will just silently start taking a little longer.