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

Build MELPA package sets without null packages #83378

Merged

Conversation

afrepues
Copy link
Contributor

@afrepues afrepues commented Mar 25, 2020

Motivation for this change

The current algorithm creates attributes with null values for packages
with no source in a variant of MELPA. Though will satify dependencies
they produce no files, and though a build that transitively depends on
one them will be successful, Emacs won't find them and any code
depending on them won't work.

The solution with minimal code change would have been filtering the
list of results from melpaDerivation by comparing the value against
null, but that leads to an infinite recursion.

This commit also moves legacy renames from the shared to the unstable
set, as the corresponding null value elements won't exist in the
stable set anymore.

The test used for the problem was:

$ nix-build --show-trace ./default.nix -A emacs26Packages.melpaStablePackages.findr
error: expression does not evaluate to a derivation (or a set or list of those)

The expected output, obtained with this commit is:

$ nix-build --show-trace ./default.nix -A emacs26Packages.melpaStablePackages.findr
error: attribute 'findr' in selection path 'emacs26Packages.melpaStablePackages.findr' not found

Merging into other branches

This can be cleanly merged into release-20.03, merging into an older branch will need to be done by cherry picking.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The current algorithm creates attributes with null values for packages
with no source in a variant of MELPA. Though will satify dependencies
they produce no files, and though a build that transitively depends on
one them will be successful, Emacs won't find them and any code
depending on them won't work.

The solution with minimal code change would have been filtering the
list of results from melpaDerivation by comparing the value against
null, but that leads to an infinite recursion.

This commit also moves legacy renames from the shared to the unstable
set, as the corresponding null value elements won't exist in the
stable set anymore.

The test used for the problem was:

  $ nix-build --show-trace ./default.nix -A emacs26Packages.melpaStablePackages.findr
  error: expression does not evaluate to a derivation (or a set or list of those)

The expected output, obtained with this commit is:

  $ nix-build --show-trace ./default.nix -A emacs26Packages.melpaStablePackages.findr
  error: attribute 'findr' in selection path 'emacs26Packages.melpaStablePackages.findr' not found
@afrepues afrepues force-pushed the build-melpa-stable-with-no-null-pkgs branch from a2f112e to b2c8626 Compare March 26, 2020 20:42
@afrepues afrepues changed the title Build MELPA package lists without null packages Build MELPA package sets without null packages Mar 26, 2020
@afrepues afrepues marked this pull request as ready for review March 26, 2020 21:29
@afrepues
Copy link
Contributor Author

afrepues commented Mar 26, 2020

@GrahamcOfBorg build emacs26Packages.melpaStablePackages.findr
@GrahamcOfBorg build emacs26Packages.melpaPackages.findr

@afrepues
Copy link
Contributor Author

@adisbladis do you have time to review this?

@adisbladis adisbladis merged commit 14927d8 into NixOS:master Apr 28, 2020
@afrepues
Copy link
Contributor Author

@adisbladis this affects 20.03 as well, and this branch can be cleanly merged into release-20.03. Is it possible to do this directly or is a separate MR necessary?

@adisbladis adisbladis added the 9.needs: port to stable A PR needs a backport to the stable release. label Apr 28, 2020
@adisbladis
Copy link
Member

@afrepues Could you cherry-pick this on top of 20.03 and send a separate PR? (Use git cherr-pick -x).

@afrepues
Copy link
Contributor Author

@adisbladis backport to 20.03 in !86213

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.

None yet

2 participants