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

Add a fake devshell for impure packages #281

Closed
wants to merge 5 commits into from

Conversation

bezmuth
Copy link
Contributor

@bezmuth bezmuth commented Aug 31, 2022

This should make issues like #272 less common

@bezmuth
Copy link
Contributor Author

bezmuth commented Aug 31, 2022

A default should probably also be added so when users attempt to run nix build . the warning also displays

@bezmuth
Copy link
Contributor Author

bezmuth commented Aug 31, 2022

Adding a default package allows the user to run both nix build . and nix develop and receive a warning.

src/default.nix Outdated Show resolved Hide resolved
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
@DavHau
Copy link
Member

DavHau commented Sep 16, 2022

The case where impureFakeDerivations is empty still needs to be handled.

@bezmuth
Copy link
Contributor Author

bezmuth commented Sep 18, 2022

This commit also modifies how the testing of the examples works, only running a check if impurities have been resolved, without this the default check would be run which errors as designed with the new behavior.
Good chance this is the wrong way to do this, might have been no need to modify these tests.

@@ -46,7 +46,9 @@
&& [ "$(nix flake show --json | jq 'select(.packages."x86_64-linux".default.name)')" != "" ]; then
nix eval --read-only --no-allow-import-from-derivation .#default.name
fi
nix flake check "$@"
if [ "$(nix flake show --json | jq 'select(.packages."x86_64-linux".resolveImpure)')" == "" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolveImpure will not vanish, even if impurities have been resolved. We want to give the user the possibility to re-resolve, as this can be used to update the dependencies.

I think this change should not be necessary. If the tests were failing, then there is probably a problem caused by src/default.nix which should be fixed

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.

None yet

2 participants