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

pip install with --no-build-isolation should support reusing existing build targets #164

Closed
HDembinski opened this issue Dec 16, 2022 · 3 comments
Milestone

Comments

@HDembinski
Copy link

The point of --no-build-isolation apart from debugging is to have a deterministic build directory, so that repeated builds can reuse targets that were already compiled. scikit-build-core generates a random build directory every time, even when --no-build-isolation is used, which prevents that.

When developing locally, it is important to be able to reuse targets from source files that have not changed.

ccache is not a solution, because it only works for C/C++ and not for Fortran source files.

@henryiii
Copy link
Collaborator

This is the first step mentioned in #114. On important feature is the build directory needs to have a subfolder at least with the current python interpreter & platform encoded (like setuptools does). It also needs to handle updating existing variables if they change (the cache init file we are using technically does support FORCE in all existing versions of CMake, though you really aren't supposed to use anything other than a simple cache set - so either we take advantage of that, or we edit the cache if it exists).

Not for --no-build-isolation, but we also need to handle moving isolated paths - cmake, ninja, pybind11, and any other pip dependencies move around if they are in the isolated environment, invalidating cached paths. We'll want to handle those too for #114.

Fortran is a whole other beast. It's not supported much or at all by Xcode (LLVM), MSVC, or WebAssembly (LLVM), which makes it quite painful to build correctly on anything other than linux. I believe they've been transpiling Fortran to C to make SciPy work in Pyodide.

@henryiii
Copy link
Collaborator

henryiii commented Feb 14, 2023

Editable installs will be a later release. This was added a while back and will be in 0.2.0 (opt-in ATM), but I do need to make sure it does still use a temp directory if not build from a source dir. Probably the last thing that needs to go in before 0.2. I'll close when that's checked / fixed.

It mostly works with isolation too, but things included that change directory (like pybind11) may trigger more rebuilds than necessary.

@henryiii
Copy link
Collaborator

I think this is okay since if you aren't in the source directory, you are in a temporary directory already so making the build directory a subdirectory of that is safe.

To use this:

[tool.scikit-build]
build-dir = "build/{cache_tag}"

Or set the matching config setting from the command line via config-settings. "build/{cache_tag}" is exactly what setuptools uses. "_skbuild/{cache_tag}" would be closer to classic scikit-build.

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