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

Case insensitivity strikes again ("failed to move output file" while building Python on Mac) #1144

Closed
mrdomino opened this issue Apr 12, 2024 · 6 comments

Comments

@mrdomino
Copy link
Collaborator

mrdomino commented Apr 12, 2024

The symptom is this:

% make MODE=aarch64 o/aarch64/third_party/python

failed to move output file
/Users/joshin/src/cosmo/o/tmp/o_aarch64_third_party_python_python
o/aarch64/third_party/python/python
.cosmocc/3.3.3/bin/aarch64-linux-cosmo-objcopy -S o/aarch64/third_party/python/python.dbg o/aarch64/third_party/python/python
consumed 8,805µs wall time
ballooned to 12,544kb in size
needed 7,492us cpu (66% kernel)
caused 1,474 page faults (99% memcpy)
39 context switches (5% consensual)

make: *** [build/rules.mk:27: o/aarch64/third_party/python/python] Error 90

The cause seems to be that there is a o/aarch64/third_party/python/Python directory, and Mac filesystems are usually case-insensitive.

@croqaz
Copy link

croqaz commented Apr 18, 2024

Hey! I'm not a maintainer of this repo, but I was able to run this command no problem on Debian Linux. My filesystems is also case-insensitive.

@mrdomino
Copy link
Collaborator Author

How is your file system case insensitive on Linux? Usually Linux is case sensitive, in which case the command would succeed.

@croqaz
Copy link

croqaz commented Apr 18, 2024

Ugh you're right, sorry about that. Please ignore my comment. My ingrish is failing me.

@croqaz
Copy link

croqaz commented Apr 18, 2024

I suppose in that case the Windows build should also fail: https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity

@mrdomino
Copy link
Collaborator Author

third_party/python/Python is just part of the source distribution. It's probably not practical to rename it.

So I think the binary needs to go somewhere else, or be called something else.

I suggest, as a really lame cop-out, naming it python3.

@mrdomino
Copy link
Collaborator Author

@jart?

mrdomino added a commit to mrdomino/cosmopolitan that referenced this issue May 24, 2024
When we removed the com suffix from ape binaries, we broke the build for
ape's python for any case-insensitive file system, i.e. Windows and XNU,
because there is a third_party/python/Python that gets mirrored in the o
directory with the python object files and clashes with the binary name.
This patch hacks around this by renaming the binary to "python3" so that
it no longer clashes with that directory.
@jart jart closed this as completed in 0768807 May 24, 2024
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

No branches or pull requests

2 participants