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

disallow url literals by default #293

Merged
merged 2 commits into from
Dec 25, 2022
Merged

disallow url literals by default #293

merged 2 commits into from
Dec 25, 2022

Conversation

figsoda
Copy link
Collaborator

@figsoda figsoda commented Dec 24, 2022

this is the default behavior for ofborg and hydra: NixOS/ofborg#628

also adds --allow-url-literals

@SuperSandro2000
Copy link
Collaborator

What speaks against settings this globally in nix.conf?

@figsoda
Copy link
Collaborator Author

figsoda commented Dec 24, 2022

That would require the user to do it, and users don't have to follow nixpkgs conventions for all of their nix projects

@SuperSandro2000
Copy link
Collaborator

true but ofborg is also checking it now. Not sure if we really need it but it is a nice addition.

@figsoda
Copy link
Collaborator Author

figsoda commented Dec 24, 2022

url literals are probably just supported for the sake of backward compatibility, I'm not sure if there is anything else nixpkgs-review can do to change that

@@ -164,6 +164,11 @@ def common_flags() -> List[CommonFlag]:
action="store_true",
help="Allow import-from-derivation",
),
CommonFlag(
"--allow-url-literals",
Copy link
Owner

Choose a reason for hiding this comment

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

I think I see a pattern here. I don't want to so many --allow-$X flags here. Instead a I would prefer a --allow=ifd,aliases,url-literals flag.

Copy link
Owner

Choose a reason for hiding this comment

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

Since this is mostly interactive usage I think we can safely drop existing flags without causing too much damage.

Copy link
Owner

Choose a reason for hiding this comment

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

If we have than some datastructure that can store all those flags than we don't need to pass down as many parameters to other functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds like a good idea, should I keep the --allow-aliases flag to show a deprecation message?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instead of comma separated, I opted for it beeing passed multiple times: --allow ifd --allow aliases since it is easier to implement with choices

Copy link
Owner

Choose a reason for hiding this comment

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

I think we can just drop the flag.

@Mic92
Copy link
Owner

Mic92 commented Dec 25, 2022

bors merge

@bors
Copy link
Contributor

bors bot commented Dec 25, 2022

Build succeeded:

@bors bors bot merged commit a409f06 into Mic92:master Dec 25, 2022
@figsoda figsoda deleted the url-literals branch December 25, 2022 14:40
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.

3 participants