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

go run fails #1303

Closed
joshlf opened this issue Mar 5, 2021 · 12 comments
Closed

go run fails #1303

joshlf opened this issue Mar 5, 2021 · 12 comments
Labels
A-builds Area: Building the documentation for a crate C-build-failure Category: This is a crate that failed to build

Comments

@joshlf
Copy link

joshlf commented Mar 5, 2021

Crate name: mundane
Build failure link: https://docs.rs/crate/mundane/0.4.4/builds/357678

Additional details: Based on the following log output, I believe what's happening is that, since the GOCACHE environment variable is not set, go run is defaulting to $HOME/.cache, and I'm guessing that $HOME is set to /. This means that go run tries creating /.cache, which it doesn't have permission to do. See here for more details on Go's build cache.

[INFO] [stderr]   cd /opt/rustwide/workdir/boringssl/boringssl/crypto/err && /usr/bin/go run err_data_generate.go > /opt/rustwide/target/debug/build/mundane-6275d256bd1e392c/out/boringssl/build_1/crypto/err_data.c
[INFO] [stderr]   failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
@jyn514
Copy link
Member

jyn514 commented Mar 5, 2021

Most of the build environment is read-only. You could try setting GOCACHE to a subdirectory of the target directory in your build script.

@joshlf
Copy link
Author

joshlf commented Mar 5, 2021

My thinking is that it would make sense to set GOCACHE to some reasonable value for all docs.rs builds; I can't think of a reason that it would need to be specific to Mundane?

@jyn514
Copy link
Member

jyn514 commented Mar 5, 2021

Hmm, I wonder if it makes sense rather than fixing GOCACHE specifically to set HOME to a temporary directory.

@joshlf
Copy link
Author

joshlf commented Mar 5, 2021

That makes sense too, although I'd be worried about that having more wide-ranging implications (much more software uses HOME than GOCACHE), so I feel like just setting GOCACHE would be safer.

@jyn514 jyn514 added the A-builds Area: Building the documentation for a crate label Mar 5, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 5, 2021

Note that this is blocked on a rustwide update one way or another: #1278

@jyn514 jyn514 added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label Mar 5, 2021
@joshlf
Copy link
Author

joshlf commented Mar 6, 2021

I'm not sure I understand why the change we're discussing here is blocked on #1278? Is it just that all docs.rs deployments are blocked on it?

@jyn514
Copy link
Member

jyn514 commented Mar 6, 2021

Docs.rs doesn't set any of these variables itself, they're set through rustwide. Rustwide 0.12 has switched to tokio 1.0, and I'm not willing to have over 600 dependencies just to fix this bug.

@joshlf
Copy link
Author

joshlf commented Mar 6, 2021

Ah, I understand, gotcha.

@jyn514
Copy link
Member

jyn514 commented Mar 24, 2021

@joshlf go fails even with HOME set to a writeable directory:

2021/03/24 12:21:02 [INFO] rustwide::cmd: [stderr]   [37/272] Generating err_data.c
2021/03/24 12:21:02 [INFO] rustwide::cmd: [stderr]   FAILED: crypto/err_data.c 
2021/03/24 12:21:02 [INFO] rustwide::cmd: [stderr]   cd /opt/rustwide/workdir/boringssl/boringssl/crypto/err && /usr/bin/go run err_data_generate.go > /opt/rustwide/target/debug/build/mundane-6275d256bd1e392c/out/boringssl/build_1/crypto/err_data.c
2021/03/24 12:21:02 [INFO] rustwide::cmd: [stderr]   go: golang.org/x/crypto@v0.0.0-20200622213623-75b288015ac9: Get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20200622213623-75b288015ac9.mod: dial tcp: lookup proxy.golang.org on 10.3.0.1:53: dial udp 10.3.0.1:53: connect: network is unreachable
2021/03/24 12:21:02 [INFO] rustwide::cmd: [stderr]   [38/272] Generating cipher_extra/chacha20_poly1305_x86_64.S
2021/03/24 12:21:02 [INFO] rustwide::cmd: [stderr]   ninja: build stopped: subcommand failed.

@jyn514
Copy link
Member

jyn514 commented Mar 24, 2021

You could vendor the sources, but we will not lift the network restriction for any crate.

@jyn514 jyn514 added the C-build-failure Category: This is a crate that failed to build label Mar 24, 2021
@jyn514 jyn514 removed the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label Apr 15, 2021
@jyn514
Copy link
Member

jyn514 commented Jun 12, 2021

@joshlf are you planning to follow up on this? I'm willing to set HOME, but only if it actually helps crates build, otherwise there doesn't seem to be much point.

@jyn514
Copy link
Member

jyn514 commented Jun 21, 2021

Closing this since this isn't something we can fix.

@jyn514 jyn514 closed this as completed Jun 21, 2021
ctz added a commit to rustls/rustls that referenced this issue Mar 1, 2024
The docs.rs environment has golang installed, but doesn't have
the environment variables needed to make it actually work:
rust-lang/docs.rs#1303

So avoid that entirely.
github-merge-queue bot pushed a commit to rustls/rustls that referenced this issue Mar 1, 2024
The docs.rs environment has golang installed, but doesn't have
the environment variables needed to make it actually work:
rust-lang/docs.rs#1303

So avoid that entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate C-build-failure Category: This is a crate that failed to build
Projects
None yet
Development

No branches or pull requests

2 participants