-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make compiletest set cwd before running js tests #42059
Make compiletest set cwd before running js tests #42059
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @brson |
Update: The following tests fail on run-pass:
|
Thanks for the PR @derekdreery! We'll check in now and again to make sure @brson or another reviewer gets to this soon. |
ping @brson, welcome back from PTO! here's a PR for you to review! ❤️ |
@derekdreery I'm forgetting why, but can you remind me why this is necessary to do on these tests (change the cwd)? Also, I wonder if we may wish to change the cwd for all tests instead of just emscripten/wasm ones? |
The emscripten tools (node) expect the wasm file to be in the cwd, so tests don't work without setting the cwd to the directory of the file.
I seem to recall that @brson was worried that this would cause test failures for other targets, but I may be mistaken. |
Ah ok, can we try setting it for all tests perhaps? It'd be great to avoid a bunch of "if-wasm-else-this" statements throughout |
Ok I'll have a go. I'll let travis do the work rather than run it locally. |
ff7050b
to
91f236d
Compare
I think we're almost there but a codegen test needs fixing:
|
@derekdreery This looks ready except for the |
@@ -18,6 +18,8 @@ pub fn target() -> Result<Target, String> { | |||
vec!["-s".to_string(), | |||
"BINARYEN=1".to_string(), | |||
"-s".to_string(), | |||
"BINARYEN_METHOD='native-wasm,interpret-binary'".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interpret-binary is not necessary any more, node 8.0 can run wasm. See #42631
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh cool I'll update
Edit: By default, emscripten provides its own node
version 4. Running the tests would require the user to have an up to date version of node installed. I can do it on my computer but any CI scripts would have to make sure they have the correct version of node available, and that it was first in PATH
.
@arielb1 I'm not familiar with the LLVM instructions in that test - can you give me some pointers? EDIT: I understand what debuginfo is trying to do now, but not how this case should be fixed. The choices are
Can anyone advise? |
I think that's because the cwd of rustc itself is changed, right? Perhaps the cwd could only be changed for the test process and not the rustc process? |
|
Indeed yeah! And for the commands just for the target process, not for rustc itself. |
ping @derekdreery, just wanted to keep this on your radar! |
Hi I'm just unsure of how to proceed.
…On 22 Jun 2017 15:39, "Alex Crichton" ***@***.***> wrote:
ping @derekdreery <https://github.com/derekdreery>, just wanted to keep
this on your radar!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42059 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABU-XncG5rxkNN6JVktAgczKH6s0sLNbks5sGnyLgaJpZM4NeBzW>
.
|
@derekdreery does my comment above make sense? Only setting the cwd for the test process, not the rustc one? |
@derekdreery just checking in to make sure you saw @alexcrichton's earlier comment. Please let us know if there's more information we can provide to help. |
Hi sorry for the lead time. I've been away from my computer. Will endeavor
to fix this this week.
…On 30 Jun 2017 21:51, "Jake Goulding" ***@***.***> wrote:
@derekdreery <https://github.com/derekdreery> just checking in to make
sure you saw @alexcrichton <https://github.com/alexcrichton>'s earlier
comment
<#42059 (comment)>.
Please let us know if there's more information we can provide to help.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42059 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABU-XiUmoqdQgUI486yoRK1UQ-YDw3aCks5sJV_RgaJpZM4NeBzW>
.
|
Hi @derekdreery - are you still looking on this PR? Just a friendly ping to make sure this isn't getting lost. |
Apologies for the time. I made this PR because I've used rust quite a lot and want to understand/contribute to the internals a bit more. I'm finding doing this PR very helpful for getting used to the structure of rust-lang/rust, but it means my work is quite slow (not helped by having to earn money by doing paid work etc. :P ) |
OK so I've done some more work on this. Since node 8 supports wasm native (pointed out by @malbarbo), I used my own So I suspect that this PR will become redundant, but then there is the question: What is the best way to set up testing in CI? Is it to just override the node version used? And if so how do I get the What do people think of this? |
@derekdreery oh the CI testing is all done through docker images in |
91f236d
to
5aa8cc8
Compare
I've changed #!/usr/bin/python
import os
REMOVE_STRING = ":/home/rdodd/packages/emsdk-portable/node/4.1.1_64bit/bin"
def main():
old_path = os.environ["PATH"]
new_path = old_path.replace(REMOVE_STRING, "")
print(new_path)
if __name__ == '__main__':
main() I could add some code to compiletest to do this (actually splitting the path, not using this hacky string replace), but it feels like it should be in the docker shell script. I'm going to let the automated tests run to see if this is indeed an issue, and then have a think about how to solve it. |
We could use emulated wasm on node v4, but it would be an order of magnitude slower |
@derekdreery thanks! Do you think this is ready to merge? Or because you need a local workaround do you think we should hold off? |
I think yes it can be merged, and the workaround can be added in a separate PR, if you want to run the test suite against emscripten target in the future. That test would fail currently as there are some things (e.g. inline asm) that won't work with emscripten, and those tests need to be ignored for this target.~ I'm confused as to why some mac targets are failing. |
The logs were AWOL and those targets would be skipped anyway given it was just a PR build, so I restarted the jobs and now they show as fine. |
I think with this implemented we should be able to remove this workaround, right? Could this PR also delete those shim |
@derekdreery - @alexcrichton thinks you can remove the workaround. Just a friendly ping to keep this on your radar. |
Hi yeah sorry didn't realise you were waiting on me. I'll have a look. |
I've removed the workaround you mention, and put node in the PATH. |
@bors: r+ Thanks! |
📌 Commit 874ecdc has been approved by |
…xcrichton Make compiletest set cwd before running js tests Proposed fix for #38800. Not all tests pass yet - I will mention failures here once the test suite has finished.
☀️ Test successful - status-appveyor, status-travis |
Proposed fix for #38800.
Not all tests pass yet - I will mention failures here once the test suite has finished.