Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to disable Rust download and force use of pre-installed Rust?

126 views
Skip to first unread message

sow...@gmail.com

unread,
May 11, 2016, 10:02:47 AM5/11/16
to mozilla-...@lists.mozilla.org
Hi!

I am working on building Servo on Power8 LE machine. The Servo build script checks and downloads Rust compiler and uses it for building Servo.

I have a couple of difficulties here.

First, the link which is used to by the build script to download Rust compiler is not working. I verified this by trying to access it using firefox (https://static-rust-lang-org.s3.amazonaws.com/dist/2016-05-07/rustc-nightly-unknown-unknown-linux-gnu.tar.gz). It seems that the portal is expecting a login, as I am getting following error message:

The website declined to show this webpage
*This website requires you to log in.

Error XML is:
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>9D1DA9878FD57D98</RequestId><HostId>YiooNOR8oCoV6b3ATNJbmh8rlWOmjZ+mgZ4vSHgQZitNbDs7LZJVbDvaAU7MN+h1YEpuaJKtHQ4=</HostId></Error>

Second, I was looking for a way to completely bypass Rust download at build time. I do have Rust 1.8.0 version which works on Power8/LE and I want to use the pre-installed Rust version instead of downloaded one.

I was going through the python scripts under Servo/python directory and the boostrap_commands.py script appears to be the one which downloads Rust. Is it possible to bypass this script and make it use local Rust installation? Has anyone tried using pre-installed Rust compiler?

Thanks,
Atul.

Jack Moffitt

unread,
May 11, 2016, 10:21:58 AM5/11/16
to dev-...@lists.mozilla.org
> Second, I was looking for a way to completely bypass Rust download at build time. I do have Rust 1.8.0 version which works on Power8/LE and I want to use the pre-installed Rust version instead of downloaded one.

You can control this behavior by customizing the servobuild file. See
https://github.com/servo/servo/blob/master/servobuild.example#L16-L24
for the relevant area. Instructions are at the top of the file.

Note that you will not be able to build with 1.8.0 since we depend on
many features available only in nightly. You can see which nightly we
download by looking at the date in
https://github.com/servo/servo/blob/master/rust-nightly-date
(currently 2016-05-07). It may work with slightly newer or older
nightlies as well.

I suspect the reason you can't download the nightly is that the
platform detection code is returning "unknown" for your processor. You
might consider filing a bug for that. What target triple do you
normally use?

jack.

Michal Suchanek

unread,
May 11, 2016, 4:38:06 PM5/11/16
to dev-...@lists.mozilla.org
Hello,

On 11 May 2016 at 16:21, Jack Moffitt <ja...@metajack.im> wrote:

> Note that you will not be able to build with 1.8.0 since we depend on
> many features available only in nightly. You can see which nightly we
> download by looking at the date in
> https://github.com/servo/servo/blob/master/rust-nightly-date
> (currently 2016-05-07). It may work with slightly newer or older
> nightlies as well.
>
> I suspect the reason you can't download the nightly is that the
> platform detection code is returning "unknown" for your processor. You
> might consider filing a bug for that. What target triple do you
> normally use?

Is such download even available?

Back when I tried to build servo for ARM rust claimed ARM
compatibility but I could not find a prebuilt compiler.

I downloaded the x86 version and kind of cross-compiled rust using
qemu and tweaked the servo build script to skip the download.

The built servo was more flaky than the x86 one. iirc it seemed to
require more featureful graphics than fbdev. And i did not have the
exact nightly used by the build script, too.

Thanks

Michal

Simon Sapin

unread,
May 11, 2016, 5:00:59 PM5/11/16
to dev-...@lists.mozilla.org
On 11/05/16 21:29, Michal Suchanek wrote:
> Hello,
>
> On 11 May 2016 at 16:21, Jack Moffitt <ja...@metajack.im> wrote:
>
>> Note that you will not be able to build with 1.8.0 since we depend on
>> many features available only in nightly. You can see which nightly we
>> download by looking at the date in
>> https://github.com/servo/servo/blob/master/rust-nightly-date
>> (currently 2016-05-07). It may work with slightly newer or older
>> nightlies as well.
>>
>> I suspect the reason you can't download the nightly is that the
>> platform detection code is returning "unknown" for your processor. You
>> might consider filing a bug for that. What target triple do you
>> normally use?
>
> Is such download even available?

You can find the level of Rust support for various platforms documented
here:
https://doc.rust-lang.org/book/getting-started.html#platform-support

If you navigate to https://static.rust-lang.org/dist/2016-05-07/ (or
similarly for another date) you can find the official builds as well as
rustc-nightly-src.tar.gz, the source package that you can build yourself.


> Back when I tried to build servo for ARM rust claimed ARM
> compatibility but I could not find a prebuilt compiler.

rust-lang.org only started making builds of the standard library for
cross-compiling to ARM a few months ago, but it’s been functional (with
users building their compiler and standard library themselves) for
longer than that.


> I downloaded the x86 version and kind of cross-compiled rust using
> qemu and tweaked the servo build script to skip the download.

As Jack mentioned, you can copy servobuild.example to .servobuild and
configure it with the location of your Rust build. No need to tweak the
script.


> The built servo was more flaky than the x86 one. iirc it seemed to
> require more featureful graphics than fbdev. And i did not have the
> exact nightly used by the build script, too.

Servo does do a lot of stuff of the GPU, but I don’t know the exact
requirements.

--
Simon Sapin

sow...@gmail.com

unread,
May 12, 2016, 8:20:38 AM5/12/16
to mozilla-...@lists.mozilla.org
Thanks all for the response! Since I had a pre-compiled version of Rust, I found an easier way to use it. I copied my Rust directory under servo/.servo/rust/2016-05-07 and make a soft link with name "rustc-nightly-unknown-unknown-linux-gnu" pointing to my Rust directory.

After this almost immediately I ran into similar issue for Cargo. Here too, I had a pre-compiled Cargo bootstrap available to me, hence used it to build Cargo locally.

After this I also modified servo/python/servo/command_base.py to set "system-rust" and "system-cargo" to be "True".

This seems to have worked and now I am presented with about a dozen "unresolved" names (e.g. keywords::Invalid) in Servo code.

Thanks,
Atul.

Michael Howell

unread,
May 12, 2016, 9:21:16 AM5/12/16
to dev-...@lists.mozilla.org, mozilla-...@lists.mozilla.org
Rust 1.8 isn't going to work. Servo uses unstable features of Rust, which
means it needs a Rust nightly.

Sorry about that.

On Wed, May 11, 2016, 07:02 <sow...@gmail.com> wrote:

> Hi!
>
> I am working on building Servo on Power8 LE machine. The Servo build
> script checks and downloads Rust compiler and uses it for building Servo.
>
> I have a couple of difficulties here.
>
> First, the link which is used to by the build script to download Rust
> compiler is not working. I verified this by trying to access it using
> firefox (
> https://static-rust-lang-org.s3.amazonaws.com/dist/2016-05-07/rustc-nightly-unknown-unknown-linux-gnu.tar.gz).
> It seems that the portal is expecting a login, as I am getting following
> error message:
>
> The website declined to show this webpage
> *This website requires you to log in.
>
> Error XML is:
> <Error><Code>AccessDenied</Code><Message>Access
> Denied</Message><RequestId>9D1DA9878FD57D98</RequestId><HostId>YiooNOR8oCoV6b3ATNJbmh8rlWOmjZ+mgZ4vSHgQZitNbDs7LZJVbDvaAU7MN+h1YEpuaJKtHQ4=</HostId></Error>
>
> Second, I was looking for a way to completely bypass Rust download at
> build time. I do have Rust 1.8.0 version which works on Power8/LE and I
> want to use the pre-installed Rust version instead of downloaded one.
>
> I was going through the python scripts under Servo/python directory and
> the boostrap_commands.py script appears to be the one which downloads Rust.
> Is it possible to bypass this script and make it use local Rust
> installation? Has anyone tried using pre-installed Rust compiler?
>
> Thanks,
> Atul.
> _______________________________________________
> dev-servo mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo
>

Michael Howell

unread,
May 12, 2016, 9:21:17 AM5/12/16
to dev-...@lists.mozilla.org, mozilla-...@lists.mozilla.org
0 new messages