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

Servo to compile and run on FreeBSD #11625

Open
dlrobertson opened this Issue Jun 5, 2016 · 14 comments

Comments

Projects
None yet
6 participants
@dlrobertson
Contributor

dlrobertson commented Jun 5, 2016

Get servo to compile and run on FreeBSD.

@dlrobertson

This comment has been minimized.

Show comment
Hide comment
@dlrobertson

dlrobertson Jun 5, 2016

Contributor

This is my latest quest. I'll refer relevant PRs to this issue

Contributor

dlrobertson commented Jun 5, 2016

This is my latest quest. I'll refer relevant PRs to this issue

@dlrobertson dlrobertson changed the title from Servo to compile on FreeBSD to Servo to compile and run on FreeBSD Jun 5, 2016

bors-servo added a commit that referenced this issue Jun 5, 2016

Auto merge of #11626 - danlrobertson:freebsd-host-triple, r=larsbergs…
…trom

Add FreeBSD to `host_triple`

Add freebsd to `host_triple` so that the correct nightly compiler will be downloaded. There are still other crates that need patching to compile, but this is a start.
---
- [ ] `./mach build -d` does not report any errors
  - Other crates need patches
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because: the correct compiler is not downloaded without this commit

Part of: #11625

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11626)
<!-- Reviewable:end -->

bors-servo added a commit that referenced this issue Jun 5, 2016

Auto merge of #11626 - danlrobertson:freebsd-host-triple, r=larsbergs…
…trom

Add FreeBSD to `host_triple`

Add freebsd to `host_triple` so that the correct nightly compiler will be downloaded. There are still other crates that need patching to compile, but this is a start.
---
- [ ] `./mach build -d` does not report any errors
  - Other crates need patches
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because: the correct compiler is not downloaded without this commit

Part of: #11625

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11626)
<!-- Reviewable:end -->

@cbrewster cbrewster added the A-build label Jun 7, 2016

@myfreeweb

This comment has been minimized.

Show comment
Hide comment
@myfreeweb

myfreeweb commented Oct 22, 2016

Webrender works after Daggerbot/x11-rs#52, servo/gleam#91, servo/webrender#466 :)

@dlrobertson

This comment has been minimized.

Show comment
Hide comment
@dlrobertson

dlrobertson Nov 8, 2016

Contributor

@myfreeweb Thats so awesome! Thanks for the great work!

Contributor

dlrobertson commented Nov 8, 2016

@myfreeweb Thats so awesome! Thanks for the great work!

@dlrobertson

This comment has been minimized.

Show comment
Hide comment
@dlrobertson

dlrobertson Nov 8, 2016

Contributor

ipc-channel works with servo/ipc-channel#102

Contributor

dlrobertson commented Nov 8, 2016

ipc-channel works with servo/ipc-channel#102

@nox

This comment has been minimized.

Show comment
Hide comment
@nox

nox Oct 2, 2017

Member

Is this still an issue, or can it now be compiled on this system?

Member

nox commented Oct 2, 2017

Is this still an issue, or can it now be compiled on this system?

@jdm jdm added the B-meta label Oct 2, 2017

@jbeich

This comment has been minimized.

Show comment
Hide comment
@jbeich

jbeich Oct 2, 2017

Contributor

Probably not yet.

$ pkg install git py27-virtualenv gmake pkgconf
$ git clone https://github.com/servo/servo/
$ (cd servo; ./mach build --release)
[...]
   Compiling gaol v0.0.1 (https://github.com/servo/gaol#227ff0ba)
error[E0432]: unresolved import `platform::process`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:13:25
   |
13 | use platform::process::{self, Process};
   |                         ^^^^ no `process` in `platform`

error[E0432]: unresolved import `platform::process`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:13:15
   |
13 | use platform::process::{self, Process};
   |               ^^^^^^^ Could not find `process` in `platform`

error[E0432]: unresolved import `platform::ChildSandbox`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:22:20
   |
22 | pub use platform::{ChildSandbox, Sandbox};
   |                    ^^^^^^^^^^^^ no `ChildSandbox` in `platform`

error[E0432]: unresolved import `platform::Sandbox`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:22:34
   |
22 | pub use platform::{ChildSandbox, Sandbox};
   |                                  ^^^^^^^ no `Sandbox` in `platform`

error[E0412]: cannot find type `Operation` in module `platform`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/profile.rs:99:32
   |
99 |     PlatformSpecific(platform::Operation),
   |                                ^^^^^^^^^ not found in `platform`
   |
help: possible candidate is found in another module, you can import it into scope
   |
13 | use profile::Operation;
   |

error[E0599]: no method named `support` found for type `&profile::Operation` in the current scope
   --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/profile.rs:132:29
    |
132 |             match operation.support() {
    |                             ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `support`, perhaps you need to implement it:
            candidate #1: `profile::OperationSupport`

error: aborting due to 6 previous errors

error: Could not compile `gaol`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Build FAILED in 0:09:09
Contributor

jbeich commented Oct 2, 2017

Probably not yet.

$ pkg install git py27-virtualenv gmake pkgconf
$ git clone https://github.com/servo/servo/
$ (cd servo; ./mach build --release)
[...]
   Compiling gaol v0.0.1 (https://github.com/servo/gaol#227ff0ba)
error[E0432]: unresolved import `platform::process`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:13:25
   |
13 | use platform::process::{self, Process};
   |                         ^^^^ no `process` in `platform`

error[E0432]: unresolved import `platform::process`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:13:15
   |
13 | use platform::process::{self, Process};
   |               ^^^^^^^ Could not find `process` in `platform`

error[E0432]: unresolved import `platform::ChildSandbox`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:22:20
   |
22 | pub use platform::{ChildSandbox, Sandbox};
   |                    ^^^^^^^^^^^^ no `ChildSandbox` in `platform`

error[E0432]: unresolved import `platform::Sandbox`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:22:34
   |
22 | pub use platform::{ChildSandbox, Sandbox};
   |                                  ^^^^^^^ no `Sandbox` in `platform`

error[E0412]: cannot find type `Operation` in module `platform`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/profile.rs:99:32
   |
99 |     PlatformSpecific(platform::Operation),
   |                                ^^^^^^^^^ not found in `platform`
   |
help: possible candidate is found in another module, you can import it into scope
   |
13 | use profile::Operation;
   |

error[E0599]: no method named `support` found for type `&profile::Operation` in the current scope
   --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/profile.rs:132:29
    |
132 |             match operation.support() {
    |                             ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `support`, perhaps you need to implement it:
            candidate #1: `profile::OperationSupport`

error: aborting due to 6 previous errors

error: Could not compile `gaol`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Build FAILED in 0:09:09
@jdm

This comment has been minimized.

Show comment
Hide comment
@jdm

jdm Oct 2, 2017

Member

I have filed servo/gaol#38 to track that.

Member

jdm commented Oct 2, 2017

I have filed servo/gaol#38 to track that.

@myfreeweb

This comment has been minimized.

Show comment
Hide comment
@myfreeweb

myfreeweb Oct 3, 2017

First: since we have some issues with Rust itself…

…here's a working nightly Rust toolchain for FreeBSD 12-CURRENT: rustc std cargo rls analysis docs. Use libc from here and mio from there.

Now, some PRs:

I actually managed to compile servo!! But it doesn't work yet :(

Some odd issues:

  • the compiled servo binary messes up Mesa OpenGL loading (MESA-LOADER: failed to retrieve device information, then falls back to software rendering), just like anything compiled with a patched compiler from rustup — but I'm now using my new rustc build — that compiles WebRender/glutin/limn examples without this issue!
  • something causes the final executable to be linked with an unnecessary stdc++ (doesn't exist in default path), I had to create a dummy library and shove it into /usr/lib/libstdc++.so. Is there a way to trace where the link flags are coming from?
  • std::fs::canonicalize fails ("not a directory") both in Servo and in WebRender's build.rs — when WebRender is built in Servo. But it does not fail when WebRender is built standalone! (I logged the argument in build.rs — it was the same between the two builds.) WTF?!

UPD: lol, mach has been using the nightly toolchain in rustup instead of my custom toolchain.

myfreeweb commented Oct 3, 2017

First: since we have some issues with Rust itself…

…here's a working nightly Rust toolchain for FreeBSD 12-CURRENT: rustc std cargo rls analysis docs. Use libc from here and mio from there.

Now, some PRs:

I actually managed to compile servo!! But it doesn't work yet :(

Some odd issues:

  • the compiled servo binary messes up Mesa OpenGL loading (MESA-LOADER: failed to retrieve device information, then falls back to software rendering), just like anything compiled with a patched compiler from rustup — but I'm now using my new rustc build — that compiles WebRender/glutin/limn examples without this issue!
  • something causes the final executable to be linked with an unnecessary stdc++ (doesn't exist in default path), I had to create a dummy library and shove it into /usr/lib/libstdc++.so. Is there a way to trace where the link flags are coming from?
  • std::fs::canonicalize fails ("not a directory") both in Servo and in WebRender's build.rs — when WebRender is built in Servo. But it does not fail when WebRender is built standalone! (I logged the argument in build.rs — it was the same between the two builds.) WTF?!

UPD: lol, mach has been using the nightly toolchain in rustup instead of my custom toolchain.

@jdm

This comment has been minimized.

Show comment
Hide comment
@jdm

jdm Oct 3, 2017

Member

stdc++ comes from rust-mozjs.

Member

jdm commented Oct 3, 2017

stdc++ comes from rust-mozjs.

@myfreeweb

This comment has been minimized.

Show comment
Hide comment
@myfreeweb

myfreeweb Oct 3, 2017

That's just mozjs and I fixed that one ;)

myfreeweb commented Oct 3, 2017

That's just mozjs and I fixed that one ;)

@myfreeweb

This comment has been minimized.

Show comment
Hide comment
@myfreeweb

myfreeweb Oct 3, 2017

OHH YEAHHHH

screen_2017-10-04-01 43 19

myfreeweb commented Oct 3, 2017

OHH YEAHHHH

screen_2017-10-04-01 43 19

@myfreeweb

This comment has been minimized.

Show comment
Hide comment
@myfreeweb

myfreeweb Oct 3, 2017

Pushed my WIP changes to servo itself to my fork. Sandboxing doesn't work yet (need to openat resources like the UA stylesheet from a pre-opened folder fd instead of straight up open) — I'll work on that next. (Nevermind the -S in the screenshot, that was with a build of Gaol that does not cap_enter, for a moment I forgot I can just leave out the flag.)

myfreeweb commented Oct 3, 2017

Pushed my WIP changes to servo itself to my fork. Sandboxing doesn't work yet (need to openat resources like the UA stylesheet from a pre-opened folder fd instead of straight up open) — I'll work on that next. (Nevermind the -S in the screenshot, that was with a build of Gaol that does not cap_enter, for a moment I forgot I can just leave out the flag.)

@dlrobertson

This comment has been minimized.

Show comment
Hide comment
@dlrobertson

dlrobertson Oct 3, 2017

Contributor

That is beautiful!

Contributor

dlrobertson commented Oct 3, 2017

That is beautiful!

@myfreeweb

This comment has been minimized.

Show comment
Hide comment
@myfreeweb

myfreeweb Nov 6, 2017

So, time for an update :)

Updated changes: https://github.com/myfreeweb/servo/tree/freebsd

More PRs:

And sandboxing actually works!

screen_2017-11-06-21 08 38-fs8

Not perfectly, sometimes I'm still getting "not permitted" errors / RecvErrors / SendErrors, I'll need to see where they're coming from… But it successfully navigates between pages with the child process sandboxed!

myfreeweb commented Nov 6, 2017

So, time for an update :)

Updated changes: https://github.com/myfreeweb/servo/tree/freebsd

More PRs:

And sandboxing actually works!

screen_2017-11-06-21 08 38-fs8

Not perfectly, sometimes I'm still getting "not permitted" errors / RecvErrors / SendErrors, I'll need to see where they're coming from… But it successfully navigates between pages with the child process sandboxed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment