-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Cannot build numpy in specific situation #60
Comments
Confirmed that I can reproduce this - and, interestingly, I also see the "forge failure causes shell exit" bug in the |
I've resolved the "forge failure causes shell exit" problem - but now I'm seeing this build numpy failure on every build... still trying to understand what is going on here. It appears to be a discrepancy between what happens when you invoke |
My thought was it's because |
The problem appears to be a problem with the OS-level |
Perhaps just for my own edification, how do you know this wasn't happening two weeks ago? I guess more to the point, are you confident that testing was using a short enough parent file path to My impression is this has been a latent issue that I just happened to finally encounter. |
I know it was working 2 weeks ago because I was able to publish numpy versions using this script; I'm now seeing this problem in every build, not just the However.... those builds were done prior to the |
Yup. It's the path rewriting thing you flagged. Prior to the /me swears extensively. So - there's a fix needed in crossenv to ensure that the exec shim is always used; with an alternate (more permanent) fix upstream in pip as well. |
(also, put another tally in the "RKM, just pay attention to what Russell Martin says, and your life will be a lot easier" column... :-) ) |
haha, careful! I can't vouch for everything I say... FWIW, I am still curious if this is a valid file path for crossenv to put in to sysconfig; while we've only seen an issue when the file path is put in to a shebang, perhaps other use cases also assume it to be directly executable or something. |
The path that is in the shebang is the "host Python" - however, the "host Python" can't be an executable (at least, not easily), because it's a shell wrapper around the build Python. The only way that you could make it an actual executable is by writing a binary wrapper that does what a shell script does... which is possible, but not really nice to work with. Given that the script works fine in every context except I've pushed an update to my branch of crossenv that patches the problem. I'm working on a bug report and patch for distutils (which will eventually turn in to a vendored patch in pip). |
The patch for distlib is now available: pypa/distlib#231 This patch has also been incorporated into the patch for pip: pypa/pip#12962 Once the patch for pip has been landed, the crossenv modification will no longer be required; however, there will be a need to modify mobile-forge ensure that the version of pip is up to date. As soon as someone can confirm that numpy builds are working for them, I think this bug can be closed. |
A patch to enforce pip updates: #64 |
Curious...what was the resolution here?
Builds in my VM now. |
Calling |
I'm in the process of adding numpy to the CI system in #65, as that would have revealed this bug; but I'm hitting a C++ issue on x86 builds. I'll use that PR to close this one once I've worked out what is going on. |
Describe the bug
When the number of characters for the parent file path for the mobile-forge repo is sufficiently low, the numpy build fails.
Steps to reproduce
Clone mobile-forge in to
/tmp
and attempt to build numpy.Expected behavior
Numpy can build regardless of where mobile-forge exists in the file system.
The underlying problem is the shebang that
pip
creates for ninja which is used by numpy's build system. Numpy invokes ninja with this file:The problem here is that
venv3.11-ios_13_0_arm64_iphoneos/cross/bin/python3.11
is not a binary; it is another python script that eventually callsos.execv()
forvenv3.11-ios_13_0_arm64_iphoneos/build/bin/python3.11
....and this python3.11 is a binary.pip
creates this shebang when installing ninja. As you can see there, if the shebang is long enough, it creates a shebang that has/bin/sh
runvenv3.11-ios_13_0_arm64_iphoneos/build/bin/python3.11
. This avoids this issue altogether.pip
does a lot of introspection to determine what to use for the shebang....and a lot of the possible values come fromsysconfig
. Given how much crossenv is messing with sysconfig, this could possibly be considered a bug in crossenv.Screenshots
No response
Environment
Logs
numpy-1.26.2-cp311-ios_13_0_x86_64_iphonesimulator.log
numpy-1.26.2-cp311-ios_13_0_arm64_iphonesimulator.log
numpy-1.26.2-cp311-ios_13_0_arm64_iphoneos.log
Additional context
No response
The text was updated successfully, but these errors were encountered: