Skip to content

Get servo working on win32 - #7878

Closed
vvuk wants to merge 7 commits into
servo:masterfrom
vvuk:win32
Closed

vvuk wants to merge 7 commits into
servo:masterfrom
vvuk:win32

Conversation

@vvuk

@vvuk vvuk commented Oct 5, 2015

Copy link
Copy Markdown
Contributor

This depends on a bunch of other PRs; full instructions and outstanding PRs are at https://hackpad.com/Servo-on-Windows-C1LPcI2bP25

Most of the servo-side work is just some glue bits for fonts and some build changes.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 5, 2015
@highfive

highfive commented Oct 5, 2015

Copy link
Copy Markdown

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

@highfive

highfive commented Oct 5, 2015

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@nox nox added P-windows Any version of Windows capable of running Servo S-needs-rebase There are merge conflict errors. labels Oct 5, 2015
@nox

nox commented Oct 5, 2015

Copy link
Copy Markdown
Contributor

@vvuk This needs a rebase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use std::thread::sleep here.

@vvuk
vvuk force-pushed the win32 branch 2 times, most recently from 7b6f3fe to 975ff99 Compare October 6, 2015 16:12
@vvuk

vvuk commented Oct 6, 2015

Copy link
Copy Markdown
Contributor Author

Ok, I tracked down the unicode PATH junk. virtualenv's activate_this.py script is doing that munging, because it's using some file functions that are somewhere returning a unicode string on windows (needlessly). I added a comment and do the ascii-fying only on windows... I think doing ascii is as correct as anything else, because unicode env vars will simply not work with this anyway to begin with.

For the thread sleep bit, std::thread::sleep states that a signal won't cause an early return, whereas usleep() would get woken up by a signal... if std::thread::sleep is still okay, we can change that in a followup commit as it's not really windows specific.

@vvuk
vvuk force-pushed the win32 branch 2 times, most recently from 3880829 to 0ba7f93 Compare October 6, 2015 16:38
@waddlesplash

Copy link
Copy Markdown

FWIW - the plan is to add a Windows buildbot so that checks are run on Windows for every commit, correct? Or is it too early for that?

@vvuk

vvuk commented Oct 6, 2015

Copy link
Copy Markdown
Contributor Author

Yup, that's the plan. I was going to work with someone to help make that happen, I just can't maintain it myself.

@waddlesplash

Copy link
Copy Markdown

Awesome. I don't use Linux anywhere but VMs anymore, and Rust on Haiku is still too alpha for Servo, so getting Servo working on Windows might motivate me to contribute...

@jasonwilliams

Copy link
Copy Markdown
Contributor

@vvuk any way for me to help you with the windows buildbot?

@nox

nox commented Oct 10, 2015

Copy link
Copy Markdown
Contributor
./components/util/workqueue.rs:13: use statement is not in alphabetical order
    expected: deque::{Abort, BufferPool, Data, Empty, Stealer, Worker}
    found: libc::funcs::posix88::unistd::usleep
./components/util/workqueue.rs:14: use statement is not in alphabetical order
    expected: libc::funcs::posix88::unistd::usleep
    found: deque::{Abort, BufferPool, Data, Empty, Stealer, Worker}

@nox nox added S-fails-tidy `./mach test-tidy` reported errors. and removed S-needs-rebase There are merge conflict errors. labels Oct 10, 2015
@pcwalton

Copy link
Copy Markdown
Contributor

This looks good to me. Not sure who else should review—@jdm maybe?

@jdm

jdm commented Oct 13, 2015

Copy link
Copy Markdown
Member

Very little of this stuff appears to be in my area of expertise. @frewsxcv do you want to take a look at the python-related changes?

@frewsxcv

Copy link
Copy Markdown
Contributor

@frewsxcv frewsxcv added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. S-fails-tidy `./mach test-tidy` reported errors. labels Oct 13, 2015
@vvuk

vvuk commented Oct 13, 2015

Copy link
Copy Markdown
Contributor Author

Yes, this build can't succeed until the dependent pull requests are all merged in. The link in the first comment has the full list and info.

@frewsxcv frewsxcv added the S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. label Oct 13, 2015
@eefriedman eefriedman added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 2, 2015
@metajack

metajack commented Nov 3, 2015

Copy link
Copy Markdown
Collaborator

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #8288) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 5, 2015
@frewsxcv

frewsxcv commented Nov 5, 2015

Copy link
Copy Markdown
Contributor

@lygstate

Copy link
Copy Markdown

Updated list:

servo/skia#74

@jasonwilliams

Copy link
Copy Markdown
Contributor

@lygstate looks like servo/skia#74 is done?

@lygstate

Copy link
Copy Markdown

wow looks great hope this can be merged now

@jdm jdm removed the S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. label Nov 28, 2015
@adamncasey

Copy link
Copy Markdown
Contributor

I've had a go at rebasing (https://github.com/adamncasey/servo/tree/win32-rebase) and getting it to compile again.

A number of packages need cargo updating (but not too far, or else we hit use rustc-plugin; problems). Might be useful if these cargo updates are done in a separate PR.

However, I'm stuck on getting gaol and servo-glutin to build. https://gist.github.com/adamncasey/58da60a5672b62c9232e

servo-glutin could just be a cargo update or small change to fix.
But I can't see any indication of windows support in the gaol library - which could be the issue. @pcwalton ?

@adamncasey

Copy link
Copy Markdown
Contributor

Servo-glutin build fixes: servo/glutin#56

@adamncasey

Copy link
Copy Markdown
Contributor

I stubbed out what's required for gaol to build on windows: https://github.com/adamncasey/gaol
I assume servo won't actually run on windows with this code (Every required function returns an error stating this feature isn't supported), but getting it building on a CI would be a great start. Someone who understands gaol a bit more will likely want to rewrite everything I've done at some point.

I'm also finding that this commit to libANGLE broke the build on windows. Removing that one line fixes it.: servo/angle@429f752
Quite strange. It causes dllexport / dllimport errors.

The final problem I've hit is that I get linker errors at the end of the build:

note: C:\msys64\home\Adam\servo\servo\target\debug\deps\libjs-b63ddf1f18d33225.rlib(js-b63ddf1f18d33225.0.o): In function `js::jsapi_windows_gcc_64::JSTracer::setTracingLocation':
C:/msys64/home/Adam/servo/servo/.cargo\git\checkouts\rust-mozjs-ebb4917e843c0a11\master\src/jsapi_windows_gcc_64.rs:443: undefined reference to `JSTracer::setTracingLocation(void*)'
C:\msys64\home\Adam\servo\servo\target\debug\deps\libjs-b63ddf1f18d33225.rlib(js-b63ddf1f18d33225.0.o): In function `js::jsapi_windows_gcc_64::JSTracer::unsetTracingLocation':
C:/msys64/home/Adam/servo/servo/.cargo\git\checkouts\rust-mozjs-ebb4917e843c0a11\master\src/jsapi_windows_gcc_64.rs:447: undefined reference to `JSTracer::unsetTracingLocation()'
C:\msys64\home\Adam\servo\servo\target\debug\deps\libjs-b63ddf1f18d33225.rlib(js-b63ddf1f18d33225.0.o): In function `js::jsapi_windows_gcc_64::JSTracer::tracingLocation':
C:/msys64/home/Adam/servo/servo/.cargo\git\checkouts\rust-mozjs-ebb4917e843c0a11\master\src/jsapi_windows_gcc_64.rs:452: undefined reference to `JSTracer::tracingLocation(void**)'
collect2.exe: error: ld returned 1 exit status

This didn't happen when I built @vvuk 's code a few weeks back, so I'm a bit confused.

@vvuk

vvuk commented Jan 6, 2016

Copy link
Copy Markdown
Contributor Author

This hacks around/fixes the angle issue:

vvuk/angle@46a73e1

@vvuk

vvuk commented Jan 6, 2016

Copy link
Copy Markdown
Contributor Author

I filed servo/mozjs#70 for the JSTracer::setTracingLocation issue... gcc doesn't seem to be generating a public symbol for an inline-defined method.

@vvuk

vvuk commented Jan 6, 2016

Copy link
Copy Markdown
Contributor Author

Using the msys python (see issue #9168) With the angle hack and the mozjs fix, and using the gaol linked above with win32 stubs, I get a complete build.

@larsbergstrom

Copy link
Copy Markdown
Contributor

The angle issue has been merged in:
servo/angle#5

So, we now need to do the following to land:

@larsbergstrom

Copy link
Copy Markdown
Contributor

I've added the changes to cfg-out gaol and done a bunch of cargo updates here:
https://github.com/larsbergstrom/servo/tree/win32

We now just need to wait for mozjs to land and then to add a readme!

@jasonwilliams

Copy link
Copy Markdown
Contributor

Im working on the readme, i need to start again though i think, some things have changed since i last ran through it all.

@vvuk do we still need to install the native python? (at the top of the hackpad)

Last night i hit the angle issue, is this now fixed on @larsbergstrom's win32 branch? or do i need to build of another branch?

@vvuk

vvuk commented Jan 7, 2016

Copy link
Copy Markdown
Contributor Author

@vvuk do we still need to install the native python? (at the top of the hackpad)

I haven't tried without it -- the mozjs makefile.cargo still explicitly references it. I'll try without it shortly and see what happens.

@larsbergstrom

Copy link
Copy Markdown
Contributor

@Jayflux my win32 branch does also have the angle update (it was landed, so it's just a cargo update).

I'm in the middle of a small rebase because my hacky gaol fixes weren't split into a commit and didn't quite work well on some other platforms :-) I also need to make sure Cargo.lock is in sync across all the ports, since I did a bit of hand-editing on the main one just to get things to work. Should be up in ~30 minutes.

@larsbergstrom

Copy link
Copy Markdown
Contributor

Just did another push -f to my win32 branch; this should have everything except for the mozjs fix and a readme.

@vvuk

vvuk commented Jan 7, 2016

Copy link
Copy Markdown
Contributor Author

The native python seems to still be required; the issue seems to be that sys.executable is set incorrectly if python is invoked with an explicit c:/... path.

vladimir@grizzly[467]$ pwd
/c/proj/r/servo/target/debug/build/mozjs_sys-e1a009922d76a686
vladimir@grizzly[468]$ C:/proj/r/servo/python/_virtualenv/bin/python2.7 -c 'import sys; print sys.executable'
/c/proj/r/servo/target/debug/build/mozjs_sys-e1a009922d76a686/C:/proj/r/servo/python/_virtualenv/bin/python2.7

if it's invoked as /c/proj/..., then the path ends up correct.

@larsbergstrom larsbergstrom mentioned this pull request Jan 20, 2016
@larsbergstrom

Copy link
Copy Markdown
Contributor

moved to #9385

bors-servo pushed a commit that referenced this pull request Jan 23, 2016
…oal95

Win32 support

r? @frewsxcv for python stuff
r? @pcwalton for the "remove usage of Gaol" stuff for Win32
r? anybody else for misc cargo.lock updates, etc.

This replaces #7878.

This works best with servo/mozjs#71, too, to enable static linking, but can be run without (via some PATH hackery).

The instructions are here, and will be added to a .md file in the repo once the mozjs changes also land:
https://hackpad.com/Servo-on-Windows-C1LPcI2bP25

I'd like to get these changes landed because I've been rebasing them for months, they're otherwise quite stable, and don't affect our other platforms and targets.

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

Labels

P-windows Any version of Windows capable of running Servo S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-needs-rebase There are merge conflict errors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.