Skip to content

Add support for building namespace.* without eval'ing nixpkgs#459

Merged
GaetanLepage merged 1 commit intoMic92:masterfrom
PerchunPak:build-namespace
Feb 2, 2025
Merged

Add support for building namespace.* without eval'ing nixpkgs#459
GaetanLepage merged 1 commit intoMic92:masterfrom
PerchunPak:build-namespace

Conversation

@PerchunPak
Copy link
Contributor

@PerchunPak PerchunPak commented Jan 31, 2025

E.g. nixpkgs-revew pr/rev --package vimPlugins will build all packages that are in vimPlugins namespace`

Fixes #430

CC @GaetanLepage

Comment on lines +227 to +231
changed_attrs = {}
for system in self.systems:
changed_attrs[system] = set()
for package in self.only_packages:
changed_attrs[system].add(package)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was unsure how to name a function that does this so I duplicated code instead

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's fine.

Copy link
Collaborator

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

Looking good !

]
else if !lib.isDerivation pkg then
if builtins.typeOf pkg != "set" then
# if it is not a package, ignore it (it is probably something line overrideAttrs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# if it is not a package, ignore it (it is probably something line overrideAttrs)
# if it is not a package, ignore it (it is probably something like overrideAttrs)

?

Comment on lines +227 to +231
changed_attrs = {}
for system in self.systems:
changed_attrs[system] = set()
for package in self.only_packages:
changed_attrs[system].add(package)
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's fine.

"--nix-path",
nix_path,
"--json",
"--show-trace",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you forgot to remove this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, it does help a lot

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not so sure about this... Anyway, let's not have it in this PR. Let's stick to the mentioned feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, reverted it

@GaetanLepage
Copy link
Collaborator

It would be great to add a test.
Not sure how easy this would be.

E.g. `nixpkgs-revew pr/rev --package vimPlugins` will build all packages
that are in `vimPlugins` namespace`
@PerchunPak
Copy link
Contributor Author

@GaetanLepage added tests, I hope correctly

Copy link
Collaborator

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @PerchunPak !
Have you been testing it on your side ?

@PerchunPak
Copy link
Contributor Author

Yes

@GaetanLepage
Copy link
Collaborator

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Feb 2, 2025

queue

🛑 The pull request has been merged manually

Details

The pull request has been merged manually at e0c47a9

@GaetanLepage GaetanLepage merged commit e0c47a9 into Mic92:master Feb 2, 2025
3 checks passed
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.

Don't evaluate nixpkgs if --package was passed

2 participants