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

x.py has exponental resource usage with no progress #72523

Closed
Kixiron opened this issue May 24, 2020 · 8 comments
Closed

x.py has exponental resource usage with no progress #72523

Kixiron opened this issue May 24, 2020 · 8 comments
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Kixiron
Copy link
Member

Kixiron commented May 24, 2020

I attempted to use x.py with all of the following commands

$ python x.py --help
$ python x.py build -j1 --stage 1 src/libstd
$ python x.py build -i -j1 --stage 1 src/libstd
$ python x.py build -i --stage 1 src/libstd

but instead of doing what it's supposed to do, there was instead zero terminal output and and continuously increasing number of spawned python processes, ranging from 3827 pythons with x.py --help to well over 10000 pythons with python x.py build -j1 --stage 1 src/libstd. This number was steadily increasing though, I just had to kill it before my computer crashed. Killing the builds was also incredibly difficult, ctrl+cs do nothing, task manager crashes when it's opened and x'ing the window does nothing. The only semi-reliable way I found to kill the process was to kill every python process that was running, then x.py exited with still no output. On the python x.py build -i --stage 1 src/libstd command in particular, the spawning was so out of control that I had to restart my entire system in order to regain control.

This was the first build of rustc that I've done, so there were no prior or cached artifacts

Meta

Arch

Windows 10 Pro version 1909, OS build 18363.836
Python 3.7.3
The results were the same in both Powershell and CMD

Git

This occurred on 4774f9b, but I haven't attempted to bisect for the root cause yet

config.toml

These were the only configuration values that I changed

[llvm]
assertions = true

[build]
verbose = 1
profiler = true

[rust]
debug = true
codegen-units = 0
debug-assertions = true
backtrace = true
parallel-compiler = true
@Kixiron Kixiron added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) O-windows Operating system: Windows labels May 24, 2020
@Kixiron
Copy link
Member Author

Kixiron commented May 24, 2020

I believe I've found part of the problem, the shebang was doing something really weird and hiding all output. Changing the shebang in x.py to #! /usr/bin/python fixed the no-output problem perfectly

@Kixiron
Copy link
Member Author

Kixiron commented May 24, 2020

This may be partially due to the fact that on my system I have python as an alias to python3, while both py and python3 both do nothing

@ratijas
Copy link
Contributor

ratijas commented May 25, 2020

both py and python3 both do nothing

What do you mean?

@mati865
Copy link
Contributor

mati865 commented May 25, 2020

Changing the shebang in x.py to #! /usr/bin/python fixed the no-output problem perfectly

That would break building inside MSYS2 (and maybe Git for Windows) shell.

This may be partially due to the fact that on my system I have python as an alias to python3,

Maybe it doesn't like the alias?

while both py and python3 both do nothing

What do you mean? Runinng python3 x.py does nothing?

@Kixiron
Copy link
Member Author

Kixiron commented May 25, 2020

python3 and py are unbound on my system

@Kixiron
Copy link
Member Author

Kixiron commented May 25, 2020

After a little investigation, it seems that #! /usr/bin/env python is infinitely recursing!

@ratijas
Copy link
Contributor

ratijas commented May 25, 2020

After a little investigation, it seems that #! /usr/bin/env python is infinitely recursing!

So, ultimately, it's a problem with your setup, and not in x.py or rust itself?

@Kixiron
Copy link
Member Author

Kixiron commented May 25, 2020

I guess so, closing for that reason

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. O-windows Operating system: Windows 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

3 participants