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

module build error when build directory path contains a ":" #1083

Open
theamericanaccount opened this issue Nov 3, 2024 · 9 comments
Open

Comments

@theamericanaccount
Copy link

theamericanaccount commented Nov 3, 2024

I'm not sure if I have already opened this issue yesterday but it seems the module does not build if the build path contains a :.
It may be a pyproject-hooks issue, I've not really checked.

I'm attaching failed build.log.

Source recipe to reproduce exactly is on python-setuptools-scm-ur, build program on lur.

@RonnyPfannschmidt
Copy link
Contributor

the build invocation looks incorrect

as its not using isolation, it may be necessary to add the necessary pythonpath entries to support build

https://github.com/pypa/setuptools-scm/blob/main/pyproject.toml#L9-L12 is supposed to ensure the backend can be imported

if it cant be found, path handling in the build tool is wrong

@theamericanaccount
Copy link
Author

Certainly it's not a path handling error in the build tool as it's a python error, but I'm working on fixing it by editing the toml file downstream in the recipe build file as you suggested.
I'm currently stuck on that it dosn't like absolute paths.
Thank you for the fast reply.

@theamericanaccount theamericanaccount changed the title module build error when build directory path contains a space module build error when build directory path contains a "+" Nov 4, 2024
@theamericanaccount
Copy link
Author

theamericanaccount commented Nov 4, 2024

@RonnyPfannschmidt the issue seems to be that the path gets split at the +, so maybe its a list/string issue in pyproject_hooks._impl.

EDIT: no sorry again it's at the ':'.

@theamericanaccount theamericanaccount changed the title module build error when build directory path contains a "+" module build error when build directory path contains a ":" Nov 4, 2024
@theamericanaccount
Copy link
Author

ok so i think the reason setting the pythonpath variable does not work is pyproject-hooks [opens]( a new python in a subprocess.

https://github.com/pypa/pyproject-hooks/blob/main/src/pyproject_hooks/_impl.py#L392-L396

@theamericanaccount
Copy link
Author

@RonnyPfannschmidt ok so the issue is at
https://github.com/pypa/pyproject-hooks/blob/main/src/pyproject_hooks/_impl.py#L382
when _call_hook calls os.pathsep.join and breaks the path.

As usual Microsoft, Windows and NTFS create issues even when they are not used.
Opening a related issue in pyproject-hooks.

@theamericanaccount
Copy link
Author

Okay so I've opened a related pyprojects-hooks issue and published a partial fix in a new minor release (v1.2.1) on the martian company namespace for the project.
I've also updated python-setuptools-scm ur recipe to depend on that version and published the package on the fur.
As I've written there this is the maximum I can currently afford to do unpaid.

@RonnyPfannschmidt
Copy link
Contributor

Please create a upstream pull request as well

@RonnyPfannschmidt
Copy link
Contributor

Ps colons are path separators only on unix

Windows uses semicolon and isn't affected

@theamericanaccount
Copy link
Author

theamericanaccount commented Nov 20, 2024

@RonnyPfannschmidt I am sorry but I've not opened a merge request upstream because I've just added code to report at failure one should not use the semicolons in the path.
I suppose a proper fix should not create any issue at all with paths containing them (for example by not launching another python instance or importing the modules another way) but that would require a more extensive work I can't currently afford right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants