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

Only invoke vendor_rust if network isolation set #533

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pnasrat
Copy link
Contributor

@pnasrat pnasrat commented Jan 10, 2025

See: #529

While improving the vendor logic for more complex source cases this fixes building cryptography if network isolation turned off

Signed-off-by: Pris Nasrat [email protected]

See: python-wheel-build#529

While improving the vendor logic for more complex source cases this fixes building cryptography if network isolation turned off

Signed-off-by: Pris Nasrat <[email protected]>
Copy link
Collaborator

@tiran tiran left a comment

Choose a reason for hiding this comment

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

This should be a separate option. I don't like the idea that the network isolation flags affects how sdists and packages are built. It should be a separate option.

Network isolation is not available on most platforms except some Linux systems. Even on Linux, network isolation is only possible in some cases. For example, it doesn't work in user containers on Ubuntu unless root disables a policy.

@dhellmann
Copy link
Member

This should be a separate option. I don't like the idea that the network isolation flags affects how sdists and packages are built. It should be a separate option.

Network isolation is not available on most platforms except some Linux systems. Even on Linux, network isolation is only possible in some cases. For example, it doesn't work in user containers on Ubuntu unless root disables a policy.

I hadn't considered that, but it's a good point. Maybe the default behavior depends on whether network isolation is enabled? Or are they completely unrelated?

@tiran
Copy link
Collaborator

tiran commented Jan 20, 2025

I hadn't considered that, but it's a good point. Maybe the default behavior depends on whether network isolation is enabled? Or are they completely unrelated?

If we decide to make vendoring optional, then it should be a separate option. Hermetic builds and vendoring are not tightly coupled. All possible combination of network isolation flag and vendor flag have a use case

  1. build without network isolation and without vendoring
  2. vendor Rust without network isolation
  3. build with network isolation and without vendored Rust sources
  4. vendor + isolate

(1) and (3) are currently not possible because we don't have an option to disable vendoring. Several Linux distros like Fedora follow approach (3). Fedora installs Rust crates from RPMs and configures cargo to use local, pre-installed packages instead of crates.io.

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.

3 participants