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

Building rust 1.81.0 does network access in the "build" phase #130708

Closed
he32 opened this issue Sep 22, 2024 · 3 comments
Closed

Building rust 1.81.0 does network access in the "build" phase #130708

he32 opened this issue Sep 22, 2024 · 3 comments
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@he32
Copy link
Contributor

he32 commented Sep 22, 2024

I tried to package rust 1.81.0 for pkgsrc-wip, and while trying to do a native build on NetBSD/amd64, I get:

STDERR ----
Updating crates.io index
warning: spurious network error (3 tries remaining): [5] Couldn't resolve proxy name (Could not resolve proxy: downloads-forbidden-except-during-fetch)
warning: spurious network error (2 tries remaining): [5] Couldn't resolve proxy name (Could not resolve proxy: downloads-forbidden-except-during-fetch)
warning: spurious network error (1 tries remaining): [5] Couldn't resolve proxy name (Could not resolve proxy: downloads-forbidden-except-during-fetch)
error: failed to sync
Caused by:
  failed to load pkg lockfile

Caused by:
  failed to get `serde` as a dependency of package `cargo-platform v0.1.8 (/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/src/tools/cargo/crates/cargo-platform)`

Caused by:
  download of config.json failed

Caused by:
  failed to download from `https://index.crates.io/config.json`

Caused by:
  [5] Couldn't resolve proxy name (Could not resolve proxy: downloads-forbidden-except-during-fetch)

Traceback (most recent call last):
  File "/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/./x.py", line 50, in <module>
    bootstrap.main()
  File "/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 1203, in main
    bootstrap(args)
  File "/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 1179, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 186, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/pkgsrc/wip/rust181/work/rustc-1.81.0-src/build/bootstrap/debug/bootstrap -v dist -j 32

I expected to see this happen: no download / network access during the build phase, please.

Instead, this happened: I got the above.

The pkgsrc packaging system insists on checksumming all the build components, all to be downloaded in the "fetch" phase and verified against already-recorded checksums, and therefore sets up an un-resolvable proxy to trap exactly this "anti-packaging" behavior. Doing network access of any type during the build phase is at best considered to be "bad form", as the components which go into the build could then vary depending on external unverifiable factors, possibly causing the build to produce inconsistent results between different builds. At worst this could be a security issue.

This means that the 1.81.0 tarball isn't completely "frozen"...

Hints for working around this gratefully accepted.

@he32 he32 added the C-bug Category: This is a bug. label Sep 22, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 22, 2024
@saethlin saethlin added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 22, 2024
@bjorn3
Copy link
Member

bjorn3 commented Sep 22, 2024

Duplicate of #130099.

tl;dr: While building the new source tarball as part of the build process, we try to vendor all dependencies even if they have already been vendored. Previously the resulting error when offline would be accidentally ignored, but due to a refactoring of the build system it no longer gets ignored, instead aborting the entire build.

As solution try backporting #130110 and set dist.vendor = false in config.toml. (I think --set dist.vendor=false would work if you use ./configure instead of manually creating config.toml.)

@workingjubilee
Copy link
Member

duplicate thus

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2024
@he32
Copy link
Contributor Author

he32 commented Sep 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants