-
Notifications
You must be signed in to change notification settings - Fork 247
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
troubleshoot()
misses .so errors that happen at the auditwheel step (was: when running cibuildwheel locally, a {project}/build directory may interfere)
#793
Comments
if you run build locally the |
How do you mean it's irrelevant? The fact that setuptools/pip prevents the build step is precisely the issue being raised here. |
The existence of a build directory, when building with setuptools is not irrelevant. Setuptools doesn't clean the directory before performing a build, so past build artifacts will get included in newer artifacts. See the pip 20.0 release fiasco for example. |
because if you have You could also change these behavior by for me build is to common name to block its usage. |
I know this. but
I know the pain of cleaning artifacts on Linux machines, but the requested change could create more problems than solve. |
Yea, I didn't mean to imply that you don't know that. What I was hinting at is that it is relevant to how the user's project would be built, which is what they're using cibuildwheel for. I do agree that the approach suggested by OP is the solution here and that this is not something that And given that you've already provided the context that the user might have needed, I'm gonna bow out now. |
I spent many hours investigating this issue. It's a nontrivial dirty state interaction, and the error message (through no fault of cibuildwheel) points in the wrong direction.
This is not actually true. When building a wheel only whitelisted files from the source tree are copied into the wheel. By default this is only .py files; everything else needs to be listed in the package's I understand that one could mitigating it by explicitly deleting |
If you have build wheels on CI how you could have dirty
I'm not sure. I need to check this. Last time when I do a similar mistake so files were copied. Maybe they fix it later. (I will check it today). |
Ok, so I've done some experiments so we're all on the same page... $ pwd
/Users/joerick/Desktop/test-project
$ tree
.
├── setup.cfg
├── setup.py
└── src
└── spam.c
1 directory, 3 files Installing it normally- $ pip install .
Processing /Users/joerick/Desktop/test-project
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Using legacy 'setup.py install' for spam, since package 'wheel' is not installed.
Installing collected packages: spam
Attempting uninstall: spam
Found existing installation: spam 0.1.0
Uninstalling spam-0.1.0:
Successfully uninstalled spam-0.1.0
Running setup.py install for spam ... done
Successfully installed spam-0.1.0
$ tree
.
├── setup.cfg
├── setup.py
└── src
└── spam.c
1 directory, 3 files So far, so good. No build artifacts added. Let's try installing that with $ git clean -df
$ tree
.
├── setup.cfg
├── setup.py
└── src
└── spam.c
1 directory, 3 files
$ pip install -e .
Obtaining file:///Users/joerick/Desktop/test-project
Installing collected packages: spam
Running setup.py develop for spam
Successfully installed spam-0.1.0
$ tree
.
├── build
│ ├── lib.macosx-10.9-x86_64-3.8
│ │ └── spam.cpython-38-darwin.so
│ └── temp.macosx-10.9-x86_64-3.8
│ └── src
│ └── spam.o
├── setup.cfg
├── setup.py
├── spam.cpython-38-darwin.so
├── spam.egg-info
│ ├── PKG-INFO
│ ├── SOURCES.txt
│ ├── dependency_links.txt
│ └── top_level.txt
└── src
└── spam.c
6 directories, 10 files So, a few things to note here. The build added So we could write rules to exclude the As an aside, I was curious what would happen when $ git clean -df
Removing build/
Removing spam.cpython-38-darwin.so
Removing spam.egg-info/
$ tree
.
├── setup.cfg
├── setup.py
└── src
└── spam.c
1 directory, 3 files
$ pip install --use-feature=in-tree-build .
Processing /Users/joerick/Desktop/test-project
Using legacy 'setup.py install' for spam, since package 'wheel' is not installed.
Installing collected packages: spam
Running setup.py install for spam ... done
Successfully installed spam-0.1.0
$ tree
.
├── build
│ ├── lib.macosx-10.9-x86_64-3.8
│ │ └── spam.cpython-38-darwin.so
│ └── temp.macosx-10.9-x86_64-3.8
│ └── src
│ └── spam.o
├── setup.cfg
├── setup.py
├── spam.egg-info
│ ├── PKG-INFO
│ ├── SOURCES.txt
│ ├── dependency_links.txt
│ └── top_level.txt
└── src
└── spam.c This is slightly different from the |
No. This is the failure path:
Looking around the code, the troubleshoot message does not print when cibuildwheel/cibuildwheel/linux.py Lines 313 to 317 in 1ceaeb4
|
Thanks for getting back @jbarlow83!
Yes, that sounds possible. I think we should adapt this clause to catch auditwheel failures too, and print the same message. I don't think we can do anything further, even if we did delete the If anyone has time to send a PR updating that |
troubleshoot()
misses .so errors that happen at the auditwheel step (was: when running cibuildwheel locally, a {project}/build directory may interfere)
setuptools uses By the time we get to The core devs have noticed this is a problem in other areas and there's a draft PEP to make the cache directory configurable. That's what would be best when it's available - use a /tmp directory and avoid these issues, and there's no problem for users who happen to be doing strange things in their build folder. |
This is true, but the caches are not just in
There are also caches written that are stored alongside the source files, as well as in
Not true, I think. The |
You can easily confirm that the compiled
Hack
I stand corrected. Container changes won't show up in the host, so troubleshoot() may be viable after all. |
did you try this with a cleaned I still do not understand what is clue. As far as I understand you try to push some solution for local |
To reproduce:
pip install -e .
cibuildwheel --plat linux
You will probably get error messages that complain about use of newer GLIBC symbols. These will coincide with the host machine's GLIBC.
The reason is that locally installing the package (
pip install [-e] .
orpython setup.py bdist_wheel
) will create built libraries in thebuild/
directory. And then, cibuildwheel maps the local directory to{project}/build
in the container, and when Docker container run pip, pip thinks that the C extension is already built and up to date, so it skips building it and uses the wrong version.I suggest creating an additional volume mapping from e.g.
host:/tmp/cibuildwheel-build
tocontainer:/project/build
, so that the container is isolated from the local build directory (and so that these temporary objects can be accessed if the build fails).The text was updated successfully, but these errors were encountered: