Skip to content

Using rust-cache together with Nix #289

@marc0246

Description

@marc0246

Our CI is managed by Nix, which allows us to have completely reproducible jobs (an amazing property for CI). In order for this to work, all commands such as cargo and rustc must be run from within a Nix shell that has the wanted packages. For example:

nix develop .#CI -c cargo test

Which begs the question of how to best implement this in rust-cache. I was thinking of a new config key such as this:

bikeshed-cmd-replace-pattern: nix develop .#CI -c {0}

The {0} would be in line with Actions' defaults.run.shell config. The issue I see is that someone might expect it to behave the same, which would mean that e.g., x "y {0}" should be interpreted as having a single argument. At which point it would be easier to shell out to a shell (heh).

Alternatively, we could also have something that only works for Nix. This would make it incompatible with other package managers, such as Lix. Or you could be of the opinion that we should maintain our own fork.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions