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

AssertionError: "Editable installs cannot rebuild an absolute wheel.install-dir. Use an override to change if needed." #909

Open
Jacobfaib opened this issue Sep 24, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Jacobfaib
Copy link

Given

[tool.scikit-build]
wheel.install-dir = "/data"

It is not possible to do editable installs:

$ pip install -e .

because scikit_build.build.wheel.py::_make_editable() throws.

Commenting out this check did not seem to break anything immediately with the wheel, so perhaps this check can be moved to runtime install of install-time.

@henryiii
Copy link
Collaborator

henryiii commented Sep 24, 2024

You can't install editably to /data. See https://peps.python.org/pep-0660/#limitations

With regard to the wheel .data directory, this PEP focuses on making the purelib and platlib categories (installed into site-packages) “editable”. It does not make special provision for the other categories such as headers, data and scripts. Package authors are encouraged to use console_scripts, make their scripts tiny wrappers around library functionality, or manage these from the source checkout during development.

@henryiii
Copy link
Collaborator

Though, it's possible that it could still work as long as you don't want the editable parts to be in /data, we should to verify that. The check might be too restrictive.

@Jacobfaib
Copy link
Author

Jacobfaib commented Sep 24, 2024

Though, it's possible that it could still work as long as you don't want the editable parts to be in /data, we should to verify that.

Yes, that is exactly what my build is doing. Some pieces are being installed into /data (and I'm OK that those aren't "editable" in the python sense), but other parts are being installed normally into site-packages. And those work with editable installs.

Hence why commenting out the assert did not brick the build.

@Jacobfaib
Copy link
Author

Jacobfaib commented Oct 1, 2024

So is it possible for scikit-build-core to defer this check? It looks like the generated _<package>_editable.py::install() has a rebuild parameter that is passed to ScikitBuildRedirectingFinder(). This in turn is then used in ScikitBuildRedirectingFinder.find_spec():

# ...
if self.rebuild_flag: # A.K.A. "rebuild"
    self.rebuild()

Perhaps the "is install-dir absolute" check can be put inside self.rebuild, that way it only fires if the feature is actually requested (and exercised).

@henryiii henryiii added the bug Something isn't working label Oct 1, 2024
@LecrisUT
Copy link
Collaborator

LecrisUT commented Oct 1, 2024

Another approach that we should eventually support is to not run cmake --install at all and redirect the editable paths to the build directory. Would that also be a workable workflow for you? You would need to do some manipulation to make the build directory be workable, without the wheel.install-dir = "/data" assumption.

@Jacobfaib
Copy link
Author

cmake --install at all and redirect the editable paths to the build directory.

That would be even better. I am stuffing a bunch of non-python stuff (big fat shared libs) into the wheel. Copying these into the wheel takes a long time, so if scikit-build-core could skip doing that for editable builds and just leave them in the build directory that would dramatically speed up our workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants