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

PEP517 backend is non-deterministic #577

Open
nanonyme opened this issue Jan 28, 2024 · 4 comments
Open

PEP517 backend is non-deterministic #577

nanonyme opened this issue Jan 28, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@nanonyme
Copy link

nanonyme commented Jan 28, 2024

Long story short

We noticed in repro test that this package does not result in deterministic output. The problem is creation of temporary directory here https://github.com/aio-libs/frozenlist/blob/8c15ec9/packaging/pep517_backend/_backend.py#L199. It leaks into debuginfo (we spotted this through analysing _frozenlist.cpython-312-aarch64-linux-gnu.so.debug)

Expected behaviour

Debuginfo is deterministic

Actual behaviour

Debuginfo is not deterministic

Steps to reproduce

Build twice, extract debuginfo, run diffoscope on data.

Your environment

freedesktop-sdk.

@nanonyme
Copy link
Author

nanonyme commented Jan 28, 2024

The root cause seems to be https://github.com/aio-libs/frozenlist/blob/8c15ec9/packaging/pep517_backend/_backend.py#L289 where in-place build is forced to false when building wheel. This means the wheels will always be non-deterministic. This is not great because these days everyone is expected to first create a wheel before installing packages. (this is also what pip does by default)

@webknjaz
Copy link
Member

webknjaz commented Mar 6, 2024

This was asked on Matrix too and I sent that person to Cython, so they filed cython/cython#5949. I'd rather wait for them to figure out an acceptable solution before trying to invent hacks here. The solution will likely involve a PEP 517 config setting for a custom pre-determined path and/or a setting to build in-place.

@webknjaz webknjaz added the enhancement New feature or request label Mar 6, 2024
@nanonyme
Copy link
Author

nanonyme commented Mar 21, 2024

That sounds a bit odd though. We build a lot of projects with Cython (we build everything with pypa/build and use pypa/installer to install them) and frozenlist is the only one that is not deterministic.

@nanonyme
Copy link
Author

nanonyme commented Mar 21, 2024

Iirc most projects here do not create random dirs but build in subdir under source tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants