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

Download extra standard library packages only when cross-compiling #9557

Closed
mbrubeck opened this issue Feb 5, 2016 · 0 comments
Closed

Download extra standard library packages only when cross-compiling #9557

mbrubeck opened this issue Feb 5, 2016 · 0 comments

Comments

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Feb 5, 2016

Currently when downloading the Rust compiler, the bootstrap_rustc function downloads two copies of the standard libraries: one for the host platform, and one for cross-compiling to Android.

Instead, when not cross-compiling, we should download libraries for the host platform only. When cross-compiling (with mach build --target or mach build --android), we should download libraries for the host platform plus the specified target platform.

To implement this, the CommandBase.ensure_bootstrapped method should be changed to take an optional target parameter. The mach build command should pass a target to ensure_bootstrapped when --target or --android is specified. Then ensure_bootstrap and bootstrap_rustc should be split up into two phases: First, check for the compiler and host libraries (and download them if not found), then optionally check for the target libraries (and download them if not found).

dlrobertson added a commit to dlrobertson/servo that referenced this issue Feb 11, 2016
Split ensure_bootstrap into two phases including a phase checking the
compiler, and a phase checking for target libraries.
dlrobertson added a commit to dlrobertson/servo that referenced this issue Feb 12, 2016
Split ensure_bootstrap into two phases including a phase checking the
compiler, and a phase checking for target libraries.
dlrobertson added a commit to dlrobertson/servo that referenced this issue Feb 12, 2016
Split ensure_bootstrap into two phases including a phase checking the
compiler, and a phase checking for target libraries.
dlrobertson added a commit to dlrobertson/servo that referenced this issue Feb 12, 2016
Split ensure_bootstrap into two phases including a phase checking the
compiler, and a phase checking for target libraries.
dlrobertson added a commit to dlrobertson/servo that referenced this issue Feb 12, 2016
Split ensure_bootstrap into two phases including a phase checking the
compiler, and a phase checking for target libraries.
@KiChjang KiChjang added the C-assigned label Feb 12, 2016
bors-servo added a commit that referenced this issue Feb 12, 2016
Download extra stdlib only when required: #9557

Split [`ensure_bootstrap`](https://github.com/danlrobertson/servo/blob/i9557/python/servo/command_base.py#L397-L422) into two phases including a phase checking the compiler, and a phase checking for target libraries. E.g.

```
    # should download the stdlib for "i686-unknown-linux-gnu", "arm-linux-androideabi"
    # and the hosts target
    ./mach build -d --target i686-unknown-linux-gnu --android
    # should only download the stdlib for the hosts target
    ./mach build -d
```

Let me know if I missed anything! There are a few parts of this patch in its current state that I'm not a huge fan of, but I couldn't think of a better way in the moment.

Still new to working on servo, so any comments or critiques are welcome!

Fix #9557

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9611)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.