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

poetry2nix: cross fixes #104707

Closed
wants to merge 3 commits into from
Closed

poetry2nix: cross fixes #104707

wants to merge 3 commits into from

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented Nov 23, 2020

Motivation for this change

Make poetry2nix builds work when cross compiling.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS (x86_64 -> armv7)
    • 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.

When cross compiling setuptools isn't available in the build environment
but needed for eg. python setup.py egg_info.
While building PYTHONPATH includes pythonForBuild which can only be used
during the build.  Just tracking propagated inputs here should be enough.
@LnL7 LnL7 changed the title poetry2nix: cross fixe poetry2nix: cross fixes Nov 23, 2020
@adisbladis
Copy link
Member

This should go to the poetry2nix upstream at https://github.com/nix-community/poetry2nix as explained in https://github.com/NixOS/nixpkgs/blob/2240f37a107fbb9e24c8508d604010027dc5d21d/pkgs/development/tools/poetry2nix/poetry2nix/README.md.

If you make a PR against the proper upstream I'll make sure to get it merged and into nixpkgs quickly.

@@ -120,6 +120,8 @@ self: super:

cryptography = super.cryptography.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or []
++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) self.python.pythonForBuild.pkgs.cffi;
Copy link
Member

@FRidh FRidh Nov 24, 2020

Choose a reason for hiding this comment

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

this is fixed on staging-next, the whole nativeBuildInputs override can be removed
Wait, I need to check...

Copy link
Member Author

Choose a reason for hiding this comment

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

I based this on staging since this depends on the recent fixes merged there, but these overrides are poetry specific the standard cryptography worked IIRC.

@LnL7
Copy link
Member Author

LnL7 commented Nov 24, 2020

@adisbladis Oh I see, I'll relocate the pr.

nix-community/poetry2nix#213

ps. Might be a good idea to add a header to these files, a bit more discoverable than a burried readme.

@LnL7 LnL7 closed this Nov 24, 2020
@LnL7 LnL7 deleted the poetry2nix-cross branch November 26, 2020 17:35
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.

None yet

3 participants