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

Change default cargo artifact installation to use symlinks where possible #150

Merged
merged 2 commits into from
Oct 29, 2022

Conversation

ipetkov
Copy link
Owner

@ipetkov ipetkov commented Oct 29, 2022

Motivation

  • Define a new installation mode which symlinks identical artifacts
    against a directory of previously generated ones
  • This allows for linear space usage in the Nix store across many
    chained derivations (as opposed to using a zstd compressed tarball
    which uses quadratic space across many chained derivations)
  • This new installation mode is the new default for all cargo based
    builds. The previous behavior is still available by setting
    installCargoArtifactsMode = "use-zstd"; on a derivation
  • buildPackage will continue to use zstd compressed tarballs while
    building dependencies (unless either of cargoArtifacts or
    installCargoArtifactsMode is defined, in which case they will be
    honored)

Fixes #76

Checklist

  • added tests to verify new behavior
  • added an example template or updated an existing one
  • updated docs/API.md with changes
  • updated CHANGELOG.md

* Define a new installation mode which symlinks identical artifacts
  against a directory of previously generated ones
* This allows for linear space usage in the Nix store across many
  chained derivations (as opposed to using a zstd compressed tarball
  which uses quadratic space across many chained derivations)
* This new installation mode is the new default for all cargo based
  builds. The previous behavior is still available by setting
  `installCargoArtifactsMode = "use-zstd";` on a derivation
* `buildPackage` will continue to use zstd compressed tarballs while
  building dependencies (unless either of `cargoArtifacts` or
  `installCargoArtifactsMode` is defined, in which case they will be
  honored)
@ipetkov ipetkov enabled auto-merge (squash) October 29, 2022 18:23
@ipetkov ipetkov merged commit 975bda7 into master Oct 29, 2022
@ipetkov ipetkov deleted the artifact-symlink branch October 29, 2022 18:48
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.

A way to output just a diff of ./target
1 participant