Skip to content

Support nix {shell,run} --assume-built to skip locking and keep the store unchanged #8618

Open
@ShamrockLee

Description

Is your feature request related to a problem? Please describe.

On HPCs with a shared network-based file system, multiple machines run to run the same executable in parallel, while file system locking/synchronization is unreliable. Some jobs would fail just because they try to acquire the lock.

Describe the solution you'd like

We could provide a flag similar to '--assume-built`.

When specified, the user guarentees that the same command has been run without that flag, all the files and directories are readily available inside the store, and there won't be any garbage collection or store optimisation during the execution.

Nix should then proceed to the execution directly without locking or building anything, and just fail if anything is missing.

Describe alternatives you've considered

So far, HPC users could bundle the executable first or copy the Nix store to job-local position. However, lots-of-small-file operations (extraction, copy and deletion) tend to be terribly slow on network-based file systems, and Nixpkgs itself is a huge collections of small files. It saves time to be able to run from the store directly.

Additional context
Add any other context or screenshots about the feature request here.

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalnew-cliRelating to the "nix" commandsettingsSettings, global flags, nix.conf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions