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

resholve: fix mangled pname/meta integrations #191003

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

abathur
Copy link
Member

@abathur abathur commented Sep 13, 2022

Two items in resholve's mkDerivation are causing trouble for some ecosystem tools:

  1. I didn't pass through the original package's meta, which breaks the ability of at least nixos package search and r-ryantm to find the right source file (in the latter case breaking auto updates).

  2. I was prepending "resholved-" to the pname, which at least nixos package search picks up as the package's name. Repology also tries to do this, but their current nix updater will prefer to get this data from the name. For now, this means changing to name will not stop repology from picking up the resholved-<package> names.

    Repology's code makes it clear that they want to use the pname/version, so I was inclined to settle with what I've got for now, but thiagokokada clarified that we aren't just waiting for nixpkgs fixes, but because Nix itself isn't exporting the pname/version in its JSON. See also:

    For now, at least, I'll switch to appending "-unresholved" to the inner derivation's pname.

Description of changes
  • Feed the meta attrset through.
  • Prepend "resholved-" to name instead of pname.
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Result of nixpkgs-review run on x86_64-darwin 1

12 packages built:
  • bash-preexec
  • bashup-events32
  • bashup-events44
  • bats
  • git-ftp
  • ix
  • mons
  • msmtp
  • packcc
  • pdf2odt
  • shunit2
  • yadm

Copy link
Contributor

@thiagokokada thiagokokada left a comment

Choose a reason for hiding this comment

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

Two items in resholve's mkDerivation are causing trouble for
some ecosystem tools:

1. I didn't pass through the original package's meta, which breaks the
   ability of at least nixos package search and r-ryantm to find the
   right source file (in the latter case breaking auto updates).

2. I was prepending "resholved-" to the pname, which at least nixos
   package search picks up as the package's name. Repology also tries
   to do this, but their current nix updater will prefer to get this
   data from the name. For now, this means changing to name will not
   stop repology from picking up the `resholved-<package>` names.

   Repology's code makes it clear that they *want* to use the pname/
   version, so I was inclined to settle with what I've got for now,
   but thiagokokada clarified that we aren't just waiting for nixpkgs
   fixes, but because Nix itself isn't exporting the pname/version in
   its JSON. See also:

   - repology/repology-updater#854
   - repology/repology-updater@9313110121df5

   For now, at least, I'll switch to appending "-unresholved" to the
   inner derivation's pname.
@thiagokokada
Copy link
Contributor

@ofborg build bats sx shunit2 mons

@ofborg ofborg bot requested a review from thiagokokada September 13, 2022 14:34
@thiagokokada thiagokokada merged commit dd61cab into NixOS:master Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants