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

improve keepSource cleanup #1080

Merged
merged 1 commit into from
Mar 25, 2021
Merged

improve keepSource cleanup #1080

merged 1 commit into from
Mar 25, 2021

Conversation

purefn
Copy link
Contributor

@purefn purefn commented Mar 23, 2021

Combines how configureAllComponents and keepSource are handled in postInstall. This has the benefit that generated sources are kept when using keepSource and that references to the $out nix store path are removed, eliminating circular references when something in $out references a path in $source.

Discussed with @hamishmack in this issue #1077 (comment)

@purefn
Copy link
Contributor Author

purefn commented Mar 23, 2021

I spoke too soon!

mto-testlib-lib-mto-testlib> checking for references to /tmp/nix-build-mto-testlib-lib-mto-testlib-1.34.0.drv-1/ in /nix/store/0zyd0sifq353amkk7q67kchx68bnnvi2-mto-testlib-lib-mto-testlib-1.34.0-source...
cycle detected in the references of '/nix/store/0zyd0sifq353amkk7q67kchx68bnnvi2-mto-testlib-lib-mto-testlib-1.34.0-source' from '/nix/store/b81vb8ry9spdjjmfmqras2dx0885q8r8-mto-testlib-lib-mto-testlib-1.34.0'
note: keeping build directory '/tmp/nix-build-mto-testlib-lib-mto-testlib-1.34.0.drv-1'
$ rg /nix/store/b81vb8ry9spdjjmfmqras2dx0885q8r8-mto-testlib-lib-mto-testlib-1.34.0 /nix/store/0zyd0sifq353amkk7q67kchx68bnnvi2-mto-testlib-lib-mto-testlib-1.34.0-source
mto/testlib/mto-testlib-1.34.0.conf
17:    /nix/store/b81vb8ry9spdjjmfmqras2dx0885q8r8-mto-testlib-lib-mto-testlib-1.34.0/lib/x86_64-linux-ghc-8.8.4/mto-testlib-1.34.0-23vWKu0GLNC6WlraL5oLm8
20:    /nix/store/b81vb8ry9spdjjmfmqras2dx0885q8r8-mto-testlib-lib-mto-testlib-1.34.0/lib/x86_64-linux-ghc-8.8.4/mto-testlib-1.34.0-23vWKu0GLNC6WlraL5oLm8
23:    /nix/store/b81vb8ry9spdjjmfmqras2dx0885q8r8-mto-testlib-lib-mto-testlib-1.34.0/lib/x86_64-linux-ghc-8.8.4

@purefn
Copy link
Contributor Author

purefn commented Mar 23, 2021

Oh, we're only removing references to $out from the files in autogen. We still need to remove them from ${name}.conf too.

@purefn
Copy link
Contributor Author

purefn commented Mar 23, 2021

Oh, we're only removing references to $out from the files in autogen. We still need to remove them from ${name}.conf too.

I've fixed this by adding remove-references-to $out ${name}.conf if keepSource is true and the component being built is a library. I completed all the tests on our code base and everything looks good. Let me know if there is anything you'd changed.

@hamishmack
Copy link
Collaborator

bors try

iohk-bors bot added a commit that referenced this pull request Mar 24, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Mar 24, 2021

try

Timed out.

@hamishmack hamishmack merged commit 93ab431 into input-output-hk:master Mar 25, 2021
booniepepper pushed a commit to booniepepper/haskell.nix that referenced this pull request Feb 4, 2022
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.

2 participants