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

Support the MacOS sandbox for larger projects #489

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Dec 29, 2023

  1. Support the MacOS sandbox for larger projects

    Fixes ipetkov#482.
    
    MacOS has trouble with derivations which (directly or transitively)
    have many buildInputs.
    
    Crane at present creates a build structure in which a given cargo
    command will transitively depend on numCrates nix store paths. This
    means that Crane fails to build projects with over about 600 crate
    dependencies on MacOS if the sandbox is enabled.
    
    This MR utilises a tiering approach to improve this.
    
    Each registry is assigned to a shard based on the hash of the crate
    name. If there are <32 crates in a registry there is one shard, if
    <2048 there are 16 shards, otherwise 256. Crates are directly extracted
    into these shard derivations rather than symlinking.
    
    What this means is:
    
    1. Crane will not create a vendoring derivation with many inputs
       unless a project has a truly crazy number of dependencies.
    1. No downstream cargo derivation will have many inputs either.
    j-baker committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    c09d077 View commit details
    Browse the repository at this point in the history
  2. fmt

    j-baker committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    db196fb View commit details
    Browse the repository at this point in the history
  3. changelog

    j-baker committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    efddb2d View commit details
    Browse the repository at this point in the history