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

Create test for selecting derivation outputs in "installables" with . #7236

Closed
Ericson2314 opened this issue Oct 29, 2022 · 1 comment · Fixed by #10316
Closed

Create test for selecting derivation outputs in "installables" with . #7236

Ericson2314 opened this issue Oct 29, 2022 · 1 comment · Fixed by #10316
Labels
good first issue Quick win for first-time contributors with-tests Issues related to testing. PRs with tests have some priority

Comments

@Ericson2314
Copy link
Member

Ericson2314 commented Oct 29, 2022

Accessing an output in an installable with . (foobarbaz.<output>) now has the original behavior again:

However I don't think anything tests that behavior yet: see how #6589 didn't change any tests or add any new ones. We should add a new one.

@Ericson2314
Copy link
Member Author

Ericson2314 commented Oct 29, 2022

Perhaps this would be a good task to onboard new people?

I suspect #6589 might currently just being leveraging a Nixpkgs convention, but if so this is easy to fix in the derivation primop wrapper. I could easily be wrong though, this is just from a quick skim, but I wanted to flag this so that anyone taking this up didn't get stuck.

In particular:

 $ git grep outputSpecified
src/libexpr/eval.cc:    , sOutputSpecified(symbols.create("outputSpecified"))

The literal name of the attribute only occurs in the symbol.

 $ git grep sOutputSpecified
src/libcmd/installables.cc:    if (auto aOutputSpecified = attr->maybeGetAttr(state->sOutputSpecified)) {
src/libexpr/eval.cc:    , sOutputSpecified(symbols.create("outputSpecified"))
src/libexpr/eval.hh:        sOutputSpecified;
src/libexpr/get-drvs.cc:    if (attrs && (i = attrs->find(state->sOutputSpecified)) != attrs->end() && state->forceBool(*i->value, i->pos)) {

sOutputSpecified seems to be read but never set.

 $ git -C path/to/nixpkgs grep 'outputSpecified ='
lib/customisation.nix:            outputSpecified = true
...

however it is set in Nixpkgs.

@fricklerhandwerk fricklerhandwerk added with-tests Issues related to testing. PRs with tests have some priority and removed bug labels Nov 4, 2022
@fricklerhandwerk fricklerhandwerk changed the title Create test for #6589 Create test for nix build flake#package.output Nov 4, 2022
@fricklerhandwerk fricklerhandwerk changed the title Create test for nix build flake#package.output Create test for nix build repo#flake.output Nov 4, 2022
@fricklerhandwerk fricklerhandwerk changed the title Create test for nix build repo#flake.output Create test for selecting derivation outputs Nov 4, 2022
@Ericson2314 Ericson2314 changed the title Create test for selecting derivation outputs Create test for selecting derivation outputs with . Nov 4, 2022
@Ericson2314 Ericson2314 changed the title Create test for selecting derivation outputs with . Create test for selecting derivation outputs in "installables" with . Nov 4, 2022
@thufschmitt thufschmitt added the good first issue Quick win for first-time contributors label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Quick win for first-time contributors with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants