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

build: move needsHashRewrite initialization to startBuilder #2802

Merged
merged 3 commits into from May 13, 2019

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented May 12, 2019

The value of useChroot is not set yet in the constructor, resulting in
hash rewriting being enabled in certain cases where it should not be.

Fixes #2801

/cc @grahamc

The value of useChroot is not set yet in the constructor, resulting in
hash rewriting being enabled in certain cases where it should not be.

Fixes NixOS#2801
@LnL7 LnL7 changed the title [WIP] build: move needsHashRewrite initialization to startBuilder build: move needsHashRewrite initialization to startBuilder May 12, 2019
@grahamc
Copy link
Member

grahamc commented May 12, 2019

I applied the second commit (d75bdb5) with the newly added test to master and confirmed it fails. I then applied the second commit, and indeed the test fails. Nice work! Nice to see the test, too!

Also, rebasing my diff-hook patches on top allowed them to work, too. Nice. Thank you!

@edolstra
Copy link
Member

Maybe it's better to turn this into a method, so we don't have to worry about the initialization order? I.e.

bool needsHashRewrite() {
  #if __linux__
    return !useChroot;
  #else
    return true;
  #endif
}

@edolstra edolstra merged commit 5f6840f into NixOS:master May 13, 2019
@grahamc
Copy link
Member

grahamc commented May 13, 2019

Yay! Thank you both!

@LnL7 LnL7 deleted the fix-needs-hashrewrite branch May 15, 2019 06:18
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.

--check is broken on Linux with Sandboxing enabled after #2775
3 participants