about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-05-02 09:09:54 -0400
committerGitHub <noreply@github.com>2017-05-02 09:09:54 -0400
commit5b4e8d0917f3c1d2fa746c5fd1bef86f05d75132 (patch)
treefe6d2d8dba0c761ef1dab6d5fcd9ced27a9cfec2 /src/test/incremental/thinlto
parent50517d58a2f43779c27478baf77f938c0b3ebba0 (diff)
parent04e4d426a169a26d498bf22d2c2d01bc7b14fbcd (diff)
downloadrust-5b4e8d0917f3c1d2fa746c5fd1bef86f05d75132.tar.gz
rust-5b4e8d0917f3c1d2fa746c5fd1bef86f05d75132.zip
Rollup merge of #41661 - barik:master, r=alexcrichton
Under MinGW, x.py fails to run with UnboundLocalError.

Under MinGW, `x.py` will fail with the following errors:

```bash
$ ./x.py
Traceback (most recent call last):
  File "./x.py", line 20, in <module>
    bootstrap.main()
  File "C:/src/rust/src/bootstrap/bootstrap.py", line 620, in main
    bootstrap()
  File "C:/src/rust/src/bootstrap/bootstrap.py", line 601, in bootstrap
    rb.build = rb.build_triple()
  File "C:/src/rust/src/bootstrap/bootstrap.py", line 459, in build_triple
    if os.environ.get('MSYSTEM') == 'MINGW64':
UnboundLocalError: local variable 'os' referenced before assignment
```

The reason is due to the `build_triple` function in `src/bootstrap/bootstrap.py` (Line 416):

```python
if ostype == 'Linux':
    os = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding)

```

Here, the assignment to `os` is causing the `os` module to be shadowed.

Then, in (Line 459):

```python
if os.environ.get('MSYSTEM') == 'MINGW64':
    cputype = 'x86_64'
```

`os` now refers to the uninitialized local variable, not the `os` module.

Easiest fix is to simply rename the `os` variable to something like `os_from_sp`.

Also, there is a small typo fix in `x.py` referencing the wrong file name.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions