Skip to content
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

Example nix-based CI workflow #1195

Merged
merged 10 commits into from
Feb 9, 2024
Merged

Example nix-based CI workflow #1195

merged 10 commits into from
Feb 9, 2024

Conversation

jakzale
Copy link
Contributor

@jakzale jakzale commented Feb 5, 2024

Use nix to install toolchain dependencies.

We add flake.nix with a devShell that specifies all dependencies needed to build the repository. Rust toolchain version is pulled from rust-toolchain.toml, so people can still use their rustup-based usual workflow.

The only friction point is that we need to instrument Rust linker where to find dynamic libraries, because proc macros seem to be compiled with libstd dynamically linked.

Finally, there are some general improvements to our CI

  • run-examples have been refactored to a separate job, and
  • cargo-nextest uses archive to separate compilation and testing more cleanly.

@jakzale jakzale requested a review from spiral-ladder February 6, 2024 07:40
@jakzale jakzale marked this pull request as draft February 6, 2024 07:40
@jakzale jakzale self-assigned this Feb 6, 2024
@jakzale jakzale force-pushed the jakub/nix branch 2 times, most recently from 7d6d520 to d3108a7 Compare February 6, 2024 12:57
@jakzale jakzale marked this pull request as ready for review February 7, 2024 10:03
@jakzale jakzale requested a review from vivekvpandya February 7, 2024 10:06
Copy link
Contributor

@spiral-ladder spiral-ladder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakzale ran me through the code in a pair programming session. LGTM

@jakzale
Copy link
Contributor Author

jakzale commented Feb 9, 2024

@Daniel-Aaron-Bloom, do you think we need to cache ~/.cargo/ at all?

@jakzale jakzale enabled auto-merge (squash) February 9, 2024 12:40
@jakzale jakzale merged commit 7676cbf into main Feb 9, 2024
8 checks passed
@jakzale jakzale deleted the jakub/nix branch February 9, 2024 12:45
@Daniel-Aaron-Bloom
Copy link
Contributor

@Daniel-Aaron-Bloom, do you think we need to cache ~/.cargo/ at all?

The point of the cache is to reduce CI times. Downloading and installing the toolchain takes quite a bit of time. I am a nix idiot so I probably need to sync with you to answer this question properly.

matthiasgoergens added a commit that referenced this pull request Feb 19, 2024
matthiasgoergens added a commit that referenced this pull request Feb 19, 2024
matthiasgoergens added a commit that referenced this pull request Feb 19, 2024
This reverts commit 7676cbf.

Similar to #1250 but just
mechanically reverting the commit in question.
jakzale pushed a commit that referenced this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants