Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upWorking asmjs and wasm targets #36339
Conversation
rust-highfive
assigned
alexcrichton
Sep 8, 2016
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
I have lingering doubts about the modification to Thread: |
This comment has been minimized.
This comment has been minimized.
|
One thing to note about this patch is that debugging crate test failures is quite difficult because many failures result in aborts, not clean test failures. Often this is because of fatal errors in emscripten for various reasons; perhaps some because of the utterly broken unwinding support. |
This comment has been minimized.
This comment has been minimized.
|
In my opinion we should pass Other than that, there's the question of |
alexcrichton
reviewed
Sep 8, 2016
| .. Default::default() | ||
| }; | ||
| Ok(Target { | ||
| llvm_target: "asmjs-unknown-emscripten".to_string(), |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alexcrichton
reviewed
Sep 8, 2016
| @@ -1736,6 +1736,7 @@ mod tests { | |||
| } | |||
|
|
|||
| #[test] | |||
| #[cfg_attr(target_os = "emscripten", ignore)] | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
Sep 8, 2016
Member
Could we perhaps just #[cfg(target_os = "emscripten")] the whole module here?
alexcrichton
reviewed
Sep 8, 2016
| @@ -454,6 +454,7 @@ mod tests { | |||
| } | |||
|
|
|||
| #[test] | |||
| #[cfg_attr(target_os = "emscripten", ignore)] | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
reviewed
Sep 8, 2016
| @@ -378,6 +378,7 @@ mod tests { | |||
| } | |||
|
|
|||
| #[test] | |||
| #[cfg_attr(target_os = "emscripten", ignore)] | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
reviewed
Sep 8, 2016
| @@ -819,6 +819,7 @@ mod tests { | |||
|
|
|||
| #[test] | |||
| #[cfg_attr(target_os = "android", ignore)] | |||
| #[cfg_attr(target_os = "emscripten", ignore)] | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
reviewed
Sep 8, 2016
| @@ -1314,6 +1314,7 @@ mod tests { | |||
| } | |||
|
|
|||
| #[test] | |||
| #[cfg_attr(target_os = "emscripten", ignore)] | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
reviewed
Sep 8, 2016
| @@ -444,6 +444,7 @@ mod tests { | |||
| } | |||
|
|
|||
| #[test] | |||
| #[cfg_attr(target_os = "emscripten", ignore)] | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
reviewed
Sep 8, 2016
| @@ -32,6 +32,10 @@ unsafe impl Sync for Thread {} | |||
| impl Thread { | |||
| pub unsafe fn new<'a>(stack: usize, p: Box<FnBox() + 'a>) | |||
| -> io::Result<Thread> { | |||
| if cfg!(target_os = "emscripten") { | |||
| return Err(io::Error::new(io::ErrorKind::Other, "emscripten does not support threads")); | |||
| } | |||
This comment has been minimized.
This comment has been minimized.
alexcrichton
Sep 8, 2016
Member
Perhaps we could leave this out if it's only intended for debugging? In theory once we get panics working better the error messages would be higher quality?
alexcrichton
reviewed
Sep 8, 2016
|
|
||
| if let Some((printio, panicio)) = oldio { | ||
| if let Some(printio) = printio { | ||
| io::set_print(printio); |
This comment has been minimized.
This comment has been minimized.
alexcrichton
Sep 8, 2016
Member
I think this may be the bug you were seeing with not printing the test name. If the override wasn't previously set it returns None, so this is never reset to the normal stdout stream.
I think you may want to change this function to just take Option<Box> and that way it can be reset back to None
alexcrichton
referenced this pull request
Sep 8, 2016
Closed
Does our LLVM need the fastcomp backend for emscripten? #36356
This comment has been minimized.
This comment has been minimized.
|
I've realized one further issue where we may not need to actually include the fastcomp backend, but I would prefer to land this ahead of that and we can decide on it later. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
This may also want to use the support added in #36256 to figure out which node to run rather than always using |
This comment has been minimized.
This comment has been minimized.
|
I've got a patch to make the test changes, remove the Thread::spawn error handling, and fix libtest. Testing it now. Still have to investigate the jemalloc problems, though this can land without fixes for that. Still have to rebase to incorporate #36256. |
This comment has been minimized.
This comment has been minimized.
|
Please don't forget my remark. You may have linking errors and not realize it. |
This comment has been minimized.
This comment has been minimized.
|
@tomaka Thanks for the reminder. I will definitely add the |
brson
force-pushed the
brson:emscripten-new
branch
2 times, most recently
from
2ea0371
to
80a1288
Sep 15, 2016
This comment has been minimized.
This comment has been minimized.
brson
force-pushed the
brson:emscripten-new
branch
from
80a1288
to
3a4ac8a
Sep 16, 2016
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton I think this is ready to go but still running tests. |
brson
added some commits
Sep 7, 2016
brson
force-pushed the
brson:emscripten-new
branch
from
a5f5f9d
to
afa72b5
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
I've confirmed this build works with the smaller LLVM patch. |
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
brson commentedSep 8, 2016
•
edited
This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman.
It does a few things:
Notes and caveats:
--enable-rustbuild.Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies.
#36317 tracks work on this.
Fixes #36515
Fixes #36515
Fixes #36356