Skip to content

getNameFromURL(): Support uppercase characters in attribute names#9657

Merged
edolstra merged 1 commit intoNixOS:masterfrom
edolstra:fix-getNameFromURL
Jan 2, 2024
Merged

getNameFromURL(): Support uppercase characters in attribute names#9657
edolstra merged 1 commit intoNixOS:masterfrom
edolstra:fix-getNameFromURL

Conversation

@edolstra
Copy link
Member

Motivation

In particular, this makes it handle legacyPackages correctly.

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

In particular, this makes it handle 'legacyPackages' correctly.
/* ----------- tests for url-name.hh --------------------------------------------------*/

TEST(getNameFromURL, getsNameFromURL) {
TEST(getNameFromURL, getNameFromURL) {
Copy link
Member

Choose a reason for hiding this comment

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

The getNameFromURL function is only used in nix profile and its complexity seems like a potential liability for reproducibility.

  • Does this change break existing profile manifests?
  • Could you move it into profile.cc?

Copy link
Member

Choose a reason for hiding this comment

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

Moving it there could be a logic next step of getting it out of libutil as I proposed, but then we will have a hard time unit testing it if we still want to?

Copy link
Member

Choose a reason for hiding this comment

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

I would, however, not mind a libprofile with all things profile related!

Copy link
Member

Choose a reason for hiding this comment

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

Short of having a library for each group of commands, we could compile the CLI as a static library, so that we can at least unit test anything.
While there's something to be said for exposing all logic to potential library users, I also think that decisions about public interfaces shouldn't block testing, which is more of a basic necessity.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe getNameFromURL should be moved, but that's orthogonal to this PR since this function already existed.

@edolstra edolstra merged commit 3f834f5 into NixOS:master Jan 2, 2024
@edolstra edolstra deleted the fix-getNameFromURL branch January 2, 2024 11:48
lf- pushed a commit to lix-project/lix that referenced this pull request May 2, 2024
In particular, this makes it handle 'legacyPackages' correctly.

(cherry picked from commit 936a364)

Upstream-PR: NixOS/nix#9657
Change-Id: Icc4efe02f7f8e90a2970589f72fd3d3cd4418d95
lf- pushed a commit to lix-project/lix that referenced this pull request May 4, 2024
In particular, this makes it handle 'legacyPackages' correctly.

(cherry picked from commit 936a364)

Upstream-PR: NixOS/nix#9657
Change-Id: Icc4efe02f7f8e90a2970589f72fd3d3cd4418d95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants