scikit-build-core: bug: build directory should always be ignored
After a couple of days of wrangling I was finally able to get my wheel built and working properly. After everything was tested, I noticed that the custom local _build directory was showing up when I typed git status so I added that directory to .gitignore. Once it was in there, the wheel build broke. I was able to fix broken build by removing the directory from .gitingore. I verified this multiple times both directions.
For reference, this commit has the broken build:
https://github.com/andrewprock/pokerstove/commit/d67da05c79bf421d6151668b976fa0d35b61f852
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20
Commits related to this issue
- fix broken build and clean up dist files see issue for what may be a bug in scikit-build-core: https://github.com/scikit-build/scikit-build-core/issues/914 — committed to andrewprock/pokerstove by andrewprock 2 years ago
- fix broken build and clean up dist files see issue for what may be a bug in scikit-build-core: https://github.com/scikit-build/scikit-build-core/issues/914 — committed to andrewprock/pokerstove by andrewprock 2 years ago
- fix: ignore build dir automatically (#916) See #914. --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@user... — committed to scikit-build/scikit-build-core by henryiii 2 years ago
@henryiii meson emphatically does NOT do this. A gitignore file contains diametrically opposed semantics – it is defined by
git(1)to indicate files which shall not be committed to the git repository but which are build artifacts such as compiled .so files. If you use --force to add a file to the git repository anyway, then gitignore will be ignored and not processed for that file (since it is already checked into git, its sole use case no longer exists).Using gitignore for sdist or wheel filtering would prevent using gitignore for git. You’d either logically prevent inclusion of files you specifically want to include such as prebuilt arch-independent assets (sdist) or extension modules (wheel), or you would prevent checking useful development-related files into git, such as .github/workflows/* or ci-scripts/*.
Meson uses gitattributes for sdist filtering, via the “export-ignore” attribute, which also tells
git archiveto not include those files e.g. when using GitHub autogenerated tarballs. This is semantically relevant, because it’s intended bygit(1)to be used for files which are in a git repository, but which shouldn’t be exported out of it. (And that is exactly what you want for e.g. files that are only ever processed by GitHub Actions or CircleCI).It’s absolutely a backend bug if a project tries to correctly use correct git technology to perform git-related tasks and the backend inappropriately used it to mean something different.
This patch fixes it for me:
Checked via:
The “installer” in pip is literally just a zip extractor. Wheel installs do nothing more than extract a few directories in a zip file (with a .whl extension) into specific locations. That’s it.
If you want to make
site-packages/example.<...>.so, then you should do:And if you want to make to make
site-packages/example/extension.<...>.so, then you should do:You are “installing” into the main wheel directory (there are a few other directories that you can manually target, as well, like
SKBUILD_SCRIPTS_DIR). Then these directors are zipped up into a zip file with a.whlextension. Pip builds this wheel file, then installs it exactly the same way as if it download the .whl directly.Documentation can always be improved! Where were you looking and expecting to find it? It’s currently at https://scikit-build-core.readthedocs.io/en/latest/configuration.html#configuring-source-file-inclusion.