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

PATH variable grows each time compiler is run #17327

Closed
brson opened this issue Sep 17, 2014 · 19 comments
Closed

PATH variable grows each time compiler is run #17327

brson opened this issue Sep 17, 2014 · 19 comments
Labels
O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@brson
Copy link
Contributor

brson commented Sep 17, 2014

Trying to turn on windows tests (#16457) I'm now hitting errors like

---- path::GenericPath::set_extension_0 stdout ----
    error: could not exec the linker `gcc`: OS Error 206: The filename or extension is too long.

    error: aborting due to previous error
    task 'path::GenericPath::set_extension_0' failed at 'Box<Any>', C:\bot\slave\auto-win32-32-opt\b\src\libsyntax\ast_util.rs:784

Windows hates long paths.

@brson brson added O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 17, 2014
@brson
Copy link
Contributor Author

brson commented Sep 17, 2014

Doesn't reproduce locally so must be related to the length of the temp dir on the bots specifically.

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

The error seems related to this one on so. At some point in execution CreateProcess just starts failing with error 206 and then keeps failing. It doesn't have anything to do with the length of the tmp path.

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

Related Eclipse bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=327193

@alexcrichton
Copy link
Member

I suspect that you may want to fix this block of code to only append something once. Perhaps that's where the huge environment is coming from?

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

With either RUST_TEST_TASKS=1 make check-stage2-doc-crate-core or RUST_TEST_TASKS=1 make check-stage2-doc-crate-std I get 134 passes, then all subsequent tests fail.

@alexcrichton
Copy link
Member

In rustdoc all instances of rustc happen in the same process, so that environment variable is just continuously growing.

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

@alexcrichton That is an interesting block of code! With rustdoc running in-process rustc's in parallel this is very racy (though even without parallel tests this is failing).

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

It does seem like a possibility that the environment is accumulating w/o bound

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

@alexcrichton That block of code does try to reset the environment, which seems like it should work sequentially.

@alexcrichton
Copy link
Member

It is a bit racy, yes, but I'd be more worried about every test adding the same paths to PATH and it just keeps growing and growing (and the bug report just said that big processes caused problems)

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

There's more racy environment code in phase 6.

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

@alexcrichton This code does try to restore the original PATH. Are you seeing somewhere it doesn't?

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

I'll instrument the compiler to check out the environment at every step.

@vadimcn
Copy link
Contributor

vadimcn commented Sep 18, 2014

Oh, is rustdoc actually running multiple compilations in parallel in the same process? Yes, in that case mutating a global variable is not good.

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

The PATH variable is definitely going off the rails here even with sequential testing.

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

Hm, wait. The revision I'm testing on the bots contains neither of those setenv calls.... /me confused

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

It would definitely help if I was using a build of Rust that wasn't from August.

@brson brson changed the title Doc tests produce long paths PATH variable grows each time compiler is run Sep 18, 2014
@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

Still investigating how master treats PATH across multiple compilations, but I can't reproduce the original error. This may be nothing (though the race is still an issue).

@brson
Copy link
Contributor Author

brson commented Sep 18, 2014

Indeed I think this is not an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants