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

Fix bootstrap failing on win32 #71964

Merged
merged 1 commit into from
May 14, 2020

Conversation

jcotton42
Copy link
Contributor

@jcotton42 jcotton42 commented May 7, 2020

python x.py -h # or really any x.py command

would fail with

info: Downloading and building bootstrap before processing --help
      command. See src/bootstrap/README.md for help with common
      commands.
Updating only changed submodules
Submodules updated in 0.15 seconds
Traceback (most recent call last):
  File "x.py", line 11, in <module>
    bootstrap.main()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 960, in main
    bootstrap(help_triggered)
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 925, in bootstrap
    build.build = args.build or build.build_triple()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 731, in build_triple
    return default_build_triple()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 184, in default_build_triple
    ostype = require(["uname", "-s"], exit=required).decode(default_encoding)
AttributeError: 'NoneType' object has no attribute 'decode'

This PR defers the decode call until after we're sure ostype and cputype are not None, as they would be on Windows since uname doesn't exist

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 7, 2020
@Mark-Simulacrum
Copy link
Member

Huh. Surprising that we didn't catch this in CI, but I guess maybe we either have uname or don't test that platform? Regardless, this seems fine, so @bors r+ rollup

Thanks!

@bors
Copy link
Contributor

bors commented May 7, 2020

📌 Commit 7204fe4 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 7, 2020
@jcotton42
Copy link
Contributor Author

Huh. Surprising that we didn't catch this in CI, but I guess maybe we either have uname or don't test that platform? Regardless, this seems fine, so @bors r+ rollup

Thanks!

Does your Windows build env have MinGW even when testing MSVC builds? Because I have MSVC but not MinGW on my box. That's the only thing I can think of.

@bors
Copy link
Contributor

bors commented May 7, 2020

@jcotton42: 🔑 Insufficient privileges: Not in reviewers

@bors
Copy link
Contributor

bors commented May 7, 2020

@jcotton42: 🔑 Insufficient privileges: not in try users

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 7, 2020
…dows, r=Mark-Simulacrum

Fix bootstrap failing on win32

```powershell
python x.py -h # or really any x.py command
```
would fail with
```
info: Downloading and building bootstrap before processing --help
      command. See src/bootstrap/README.md for help with common
      commands.
Updating only changed submodules
Submodules updated in 0.15 seconds
Traceback (most recent call last):
  File "x.py", line 11, in <module>
    bootstrap.main()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 960, in main
    bootstrap(help_triggered)
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 925, in bootstrap
    build.build = args.build or build.build_triple()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 731, in build_triple
    return default_build_triple()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 184, in default_build_triple
    ostype = require(["uname", "-s"], exit=required).decode(default_encoding)
AttributeError: 'NoneType' object has no attribute 'decode'
```

This PR defers the `decode` call until after we're sure `ostype` and `cputype` are not `None`, as they would be on Windows since `uname` doesn't exist
@Mark-Simulacrum
Copy link
Member

r=me with commits squashed

Yeah, that sounds quite plausible.

@mati865
Copy link
Contributor

mati865 commented May 7, 2020

@Mark-Simulacrum all Windows builds on the CI are started from MSYS2 which provides uname and various other POSIX tools.

@jcotton42
Copy link
Contributor Author

Bumping this PR since it's been a few days and it will make it annoying/difficult for anyone on Windows to contribute to Rust until it's merged.

@mati865
Copy link
Contributor

mati865 commented May 12, 2020

r=me with commits squashed

@jcotton42 it's waiting for you to squash the commits.

@jcotton42
Copy link
Contributor Author

Oh I'm dumb, thanks @mati865, will do that right now

@jcotton42 jcotton42 force-pushed the bootstrap_decode_none_windows branch from e7d6ef0 to 34b2072 Compare May 12, 2020 14:52
@jcotton42
Copy link
Contributor Author

Rebased and squashed

@Mark-Simulacrum
Copy link
Member

@bors r+ p=1 (but can be rolled up)

@bors
Copy link
Contributor

bors commented May 12, 2020

📌 Commit 34b2072 has been approved by Mark-Simulacrum

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 12, 2020
…dows, r=Mark-Simulacrum

Fix bootstrap failing on win32

```powershell
python x.py -h # or really any x.py command
```
would fail with
```
info: Downloading and building bootstrap before processing --help
      command. See src/bootstrap/README.md for help with common
      commands.
Updating only changed submodules
Submodules updated in 0.15 seconds
Traceback (most recent call last):
  File "x.py", line 11, in <module>
    bootstrap.main()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 960, in main
    bootstrap(help_triggered)
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 925, in bootstrap
    build.build = args.build or build.build_triple()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 731, in build_triple
    return default_build_triple()
  File "C:\Users\Joshua\Projects\forks\rust\src\bootstrap\bootstrap.py", line 184, in default_build_triple
    ostype = require(["uname", "-s"], exit=required).decode(default_encoding)
AttributeError: 'NoneType' object has no attribute 'decode'
```

This PR defers the `decode` call until after we're sure `ostype` and `cputype` are not `None`, as they would be on Windows since `uname` doesn't exist
bors added a commit to rust-lang-ci/rust that referenced this pull request May 14, 2020
Rollup of 12 pull requests

Successful merges:

 - rust-lang#71525 (`prefix` should not be mutable.)
 - rust-lang#71741 (Pointer printing: do not print 0 offset)
 - rust-lang#71870 (Be slightly more precise about any::type_name()'s guarantees.)
 - rust-lang#71909 (Document From trait for Option implementations)
 - rust-lang#71964 (Fix bootstrap failing on win32)
 - rust-lang#72137 (Clean up E0581 explanation)
 - rust-lang#72138 (Add doc comment for `rustc_middle::mir::mono::Linkage`)
 - rust-lang#72150 (Remove UnnormalizedProjection)
 - rust-lang#72151 (Update books)
 - rust-lang#72163 (docs: remove comment referencing non-existent method)
 - rust-lang#72169 (Clean up E0582 explanation)
 - rust-lang#72183 (Fix Arc::decr_strong_count doc test)

Failed merges:

r? @ghost
@bors bors merged commit 577da45 into rust-lang:master May 14, 2020
@jcotton42 jcotton42 deleted the bootstrap_decode_none_windows branch May 14, 2020 17:06
@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants