draft: package c2rust as a "nix flake" #440
Open
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.
Nix flakes are an emerging technology for composing software which solves a related but complementary problem to the one addressed today via
c2rust
'sshell.nix
/nix-shell
support.This PR provides a rough-draft-quality flake for c2rust. Notable future work includes:
aarch64-darwin
, where it works as expected so far, and is able to transpile and run the demo for my current subject of interest, osqp.x86_64-linux
at least due to support offline build #356.The benefit is that flakes enable easy building, development, and usage of c2rust with pinned, shareable, but still easily editable LLVM, clang, and rust toolchain versions via convenient commands like
nix build
nix shell
or with URI-like "flake-refs" (which also support naming specific branches/commits/...) like:
nix build github:mstone/c2rust
,nix shell github:mstone/c2rust
,nix run github:mstone/c2rust
, ornix profile install github:mstone/c2rust
or their upstream equivalents, if merged.