Skip to content

Conversation

giacomobenedetti
Copy link

For source distribution:

  • The source distribution can be manipulated/compromised the same way of bdists. Moreover, it may help as fallback when only platform-specific wheels are available.

For Python version:

  • it may be not necessary, I didn't find any specific reproducibility issue caused by python version.
  • it avoids some build failures caused by no longer supported libraries
  • a step is added to the strategy for rebuilding Python packages (ce35553)

This PR requires the Executor logic proposed in PR #427
In case that PR isn't accepted I can decouple this dependency!

@wbxyz
Copy link
Member

wbxyz commented Apr 14, 2025

This is awesome, thanks for adding it! We've been wanting this for a while :)

Comment on lines 155 to 157
if strings.Contains(r, "python_version") {
r = strings.Split(r, ";")[0]
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just strip all quoted_markers as described in the dependency spec?

If I understand the grammar correctly, we could maybe just always split on ";" regardless of the "python_version" being present?

Otherwise, maybe we should match on the full env_var?

return nil, fs.ErrNotExist
}

func inferRequirements(name, version string, zr interface{}) ([]string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, it would be nice to avoid interface{} types in the function signature and as local variables. Without a specific interface type, it becomes harder to reason about what the code is going to do with this object.

In this case, I think the function immediately returns with an empty reqs when a tar.Reader is provided? If so, then maybe this could stay specific to just *zip.Reader, and the caller can just use an empty reqs when processing tar files?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe this could accept a function that just reads files, and it could be independent of zip or tar dependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still interested to see if we can find a way to avoid this interface{} type. Could we use just a regular reader type?

if ! command -v curl &> /dev/null; then
apk add clang curl build-base patch zip zlib-dev libffi-dev linux-headers readline-dev openssl openssl-dev sqlite-dev bzip2-dev xz-dev
fi
curl https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the pyenv-installer should be pinned?

I'd maybe lean towards yes but I'm open to suggestions there.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't infer the version of python it may be useful to pin it. But I don't have a strong opinion here, for what I saw so far the python version has a limited impact on the build. However, it may be useful from an attestation point of view.

Runs: textwrap.Dedent(`
if [ ! -d "/root/.pyenv" ]; then
if ! command -v curl &> /dev/null; then
apk add clang curl build-base patch zip zlib-dev libffi-dev linux-headers readline-dev openssl openssl-dev sqlite-dev bzip2-dev xz-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite a big set of dependencies, are these all required for installing python? I guess I shouldn't be surprised, maybe we should pin version numbers here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those dependencies were only for using pyenv. Even if we end up by using it, we can probably find a smarter way to deal with this!

return nil, fs.ErrNotExist
}

func inferRequirements(name, version string, zr interface{}) ([]string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still interested to see if we can find a way to avoid this interface{} type. Could we use just a regular reader type?

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

Successfully merging this pull request may close these issues.

2 participants