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

chore(flake): Add setuptools in order to build on a minimal Nix system #741

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

acovaci
Copy link
Contributor

@acovaci acovaci commented Jan 8, 2025

Please tick as appropriate:

  • I have tested this code on a steam deck or on a PC
  • My changes generate no new errors/warnings
  • This is a bugfix/hotfix
  • This is a new feature

Description

This is a very basic change to the flake.nix file, fixing a failure to activate the Nix shell due to missing setuptools on my system. A completely fresh Nix environment would not have any python packages installed, so I added it, in order to build propcache.

error: builder for '/nix/store/3kvfya2v3vnvbiglh2a5qyh2rai39w3f-python3.11-propcache-0.2.0.drv' failed with exit code 2;
       last 25 log lines:
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/hj15fswklkqnsdyqhgap248j7c88kxx9-python3.11-pip-24.0/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 186, in prepare_metadata_for_build_wheel
       >     return self._call_hook('prepare_metadata_for_build_wheel', {
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/hj15fswklkqnsdyqhgap248j7c88kxx9-python3.11-pip-24.0/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
       >     raise BackendUnavailable(data.get('traceback', ''))
       > pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
       >   File "/nix/store/hj15fswklkqnsdyqhgap248j7c88kxx9-python3.11-pip-24.0/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
       >     obj = import_module(mod_path)
       >           ^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/6b1fqdwb3g56j5pazv8zkx9qd0mv3wiz-python3-3.11.9/lib/python3.11/importlib/__init__.py", line 126, in import_module
       >     return _bootstrap._gcd_import(name[level:], package, level)
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
       >   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
       >   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
       >   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
       >   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
       >   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
       >   File "/build/propcache-0.2.0/packaging/pep517_backend/hooks.py", line 5, in <module>
       >     from setuptools.build_meta import *  # Re-exporting PEP 517 hooks  # pylint: disable=unused-wildcard-import,wildcard-import  # noqa: E501, F401, F403
       >     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       > ModuleNotFoundError: No module named 'setuptools'
       > 
       > 
       For full logs, run 'nix log /nix/store/3kvfya2v3vnvbiglh2a5qyh2rai39w3f-python3.11-propcache-0.2.0.drv'.
error: 1 dependencies of derivation '/nix/store/szamcj6rz3fb1y7xrhdlzg02z3h1hk91-python3-3.11.9-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/z40aw3p5aa88fgq26cfbyl6h2d90jxnm-interactive-python3-3.11.9-environment-env.drv' failed to build

It's added as a nativeBuildInputs, as it's only used for building the environment.

P.S. I also ran (by mistake) nixfmt on the file. But if you want to stick with the old formatting, I'm happy to recommit keeping it as it was.

@PartyWumpus
Copy link
Member

PartyWumpus commented Jan 8, 2025

setuptools should be included by p2n as it's in the poetry lockfile iirc. I'm pretty sure it builds on my nixos system without anything python already installed.

@acovaci
Copy link
Contributor Author

acovaci commented Jan 8, 2025

Hmm, yeah, you are right, that's weird... I wonder if it's because of the pyinstaller override, since that's the only dependency that requires it. Anyhow, I'll dig a bit more and see why it didn't pick it up on my end.

@PartyWumpus
Copy link
Member

PartyWumpus commented Jan 8, 2025

You're right, I'm getting this error on my system too, something probably broke at some point, I've not tried using the flake from scratch for a while. It works fine with my direnv cached copy, which is bizzare.

@acovaci
Copy link
Contributor Author

acovaci commented Jan 8, 2025

Though, looks like poetry2nix isn't installing anything on my end. Can you check which commit SHA was working on your end?

Copy link
Member

@PartyWumpus PartyWumpus left a comment

Choose a reason for hiding this comment

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

Sorry, I meant to approve this earlier. I think the reason it worked for me is because I had python installed, direnv set everything up fine, and then it continued to work afterwards.

@Star-veil
Copy link

Just tested this on a fresh machine, it works :)

@PartyWumpus PartyWumpus merged commit 0c727d6 into SteamDeckHomebrew:main Jan 17, 2025
4 checks passed
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