Skip to content
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

Fix handlers_test linkage and windows failures #385

Merged
merged 2 commits into from
Jul 19, 2018

Conversation

piscisaureus
Copy link
Member

@piscisaureus piscisaureus commented Jul 19, 2018

Tested on linux and windows, but not on mac.

Fixes #380

@piscisaureus piscisaureus requested a review from ry July 19, 2018 07:09
@piscisaureus piscisaureus force-pushed the testlink branch 6 times, most recently from 81f254c to 83cab7b Compare July 19, 2018 12:12
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Works for me on mac

}
if (is_win) {
libs = [ "userenv.lib" ]
}
Copy link
Member

@ry ry Jul 19, 2018

Choose a reason for hiding this comment

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

Are these not discovered with the get_rust_ldflags.py?

Copy link
Member Author

Choose a reason for hiding this comment

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

They are, but test_cc still needs it here, because it's not linked with rust_executable.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment to that effect

Copy link
Member Author

Choose a reason for hiding this comment

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

done

"$rust_build:idna",
"$rust_build:percent_encoding",
"$rust_build:unicode_bidi",
"$rust_build:unicode_normalization",
Copy link
Member

Choose a reason for hiding this comment

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

This is unfortunate. What if we moved all the tests into their own file - handlers_test.rs ?

Copy link
Member Author

Choose a reason for hiding this comment

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

IDK - I thought of that too but I didn't try. I suspect its gonna be very brittle.

Another meh option is to generate a list of all crates in rust/BUILD.gn, and just pass that to all targets.

Maybe best to let it stew for a while and then ask some rust person for their advice.

Copy link
Member

@ry ry Jul 19, 2018

Choose a reason for hiding this comment

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

best to let it stew for a while

agree

Another meh option is to generate a list of all crates in rust/BUILD.gn

I believe fuchsia does something like this.

@@ -0,0 +1,115 @@
#!/usr/bin/env python
# Copyright 2018 Bert Belder <[email protected]>
Copy link
Member

@ry ry Jul 19, 2018

Choose a reason for hiding this comment

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

(We should change to "Deno authors" soon. Maybe after we move out of github.com/ry)

Please add a big comment at the top of this file explaining the purpose of get_rust_ldflags.py ... I think this is likely to be confusing to future readers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I'll add a big comment to rust.gni and a small one here. You can't say this file is sparsely commented...

Copy link
Member Author

Choose a reason for hiding this comment

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

comment: done

empty_rs_path,
"--test",
],
"list lines")
Copy link
Member

Choose a reason for hiding this comment

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

list lines?

Please point the reader to the soon-to-be-written comment at the top of get_rust_ldflags.py

Copy link
Member Author

Choose a reason for hiding this comment

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

gn help exec_script

output_file_rel = rebase_path(output_file, root_build_dir)
args += [ "--emit=$emit_type=$output_file_rel" ]

# TODO(ry) For unknown reasons emitting a depfile on tests doesn't work.
Copy link
Member

Choose a reason for hiding this comment

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

Remove

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@ry
Copy link
Member

ry commented Jul 19, 2018

~/src/deno/build_extra/rust> ./get_rust_ldflags.py empty.rs
warning: `-C save-temps` might not produce all requested temporary products when incremental compilation is enabled.

-L
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib
empty.crate.allocator.rcgu.o
-L
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-e2a1b7f1c041b010.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-d3791a2de87534f9.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-1086e1d0e6cd90ef.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-ce923fc11d74f968.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_system-e87ca03f4215e4ef.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-e959e9c0d1548c0e.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-37638280ec40d743.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-0766335b25639e9e.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-e1a6bc6fd1c79bbc.rlib
/Users/rld/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-c410c86b18328824.rlib
-l
System
-l
resolv
-l
pthread
-l
c
-l
m

It's unfortunate that it's now linking to files in /Users/rld/.rustup/. I suppose once we include rustc in third_party we can fix this?

@piscisaureus
Copy link
Member Author

piscisaureus commented Jul 19, 2018 via email

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM!

Thank you for taking on this beast of an issue.

@piscisaureus piscisaureus merged commit c67d98e into denoland:master Jul 19, 2018
@piscisaureus piscisaureus deleted the testlink branch July 19, 2018 20:10
piscisaureus pushed a commit to piscisaureus/deno that referenced this pull request Oct 7, 2019
hardfist pushed a commit to hardfist/deno that referenced this pull request Aug 7, 2024
Bumped versions for 0.238.0

Please ensure:
- [ ] Crate versions are bumped correctly
To make edits to this PR:
```shell
git fetch upstream release_0_238.0 && git checkout -b release_0_238.0 upstream/release_0_238.0
```

cc @mmastrac

Co-authored-by: mmastrac <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants