Skip to content

[bazel] Fix and update emscripten_toolchain #1060

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

Closed
wants to merge 7 commits into from

Conversation

jrandolf
Copy link

This PR makes several changes. See the commit descriptions.

jrandolf added 3 commits June 17, 2022 20:49
This allows consumption of this script for non-Bazel usage.

For example, for `rules_foreign_cc`.
@sbc100
Copy link
Collaborator

sbc100 commented Jun 17, 2022

when making changes to the bazel toolchain would you mind prefixing the PR title with [bazel]?

@jrandolf jrandolf changed the title Fix and update emscripten_toolchain [bazel] Fix and update emscripten_toolchain Jun 17, 2022
@jrandolf jrandolf force-pushed the main branch 2 times, most recently from f3f4cc6 to 02ccf04 Compare June 17, 2022 19:57
* Removes `asm` CPU target.
* [feat] Add `wasm32` and `wasm64` CPU targets.
* Fix static library linker flags.
* Use the new `platform` API for toolchains
* Add a `emsdk_register_toolchains` for Platform toolchains.
Copy link
Collaborator

@walkingeyerobot walkingeyerobot left a comment

Choose a reason for hiding this comment

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

Thanks very much for the PR! I'm excited to get this in. Apologies for the slowness in getting to this review; it's a busy holiday season right now where I am.

"//command_line_option:features": features,
"//command_line_option:dynamic_mode": "off",
"//command_line_option:linkopt": linkopts,
"//command_line_option:platforms": [],
"//command_line_option:incompatible_enable_cc_toolchain_resolution": True,
"//command_line_option:platforms": ["@emsdk//:cpu_wasm32"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this need to be set to cpu_wasm64 if we're targeting wasm64?

f.write(param)
f.write('\n')
sys.argv[1] = '@' + new_param_filename
else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

are there cases where we wouldn't only get the single @ file?

Copy link
Author

@jrandolf jrandolf Jun 30, 2022

Choose a reason for hiding this comment

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

This occurs in, e.g., foreign_cc builds.

@@ -54,17 +56,3 @@ and all of its dependencies, and does not require amending `.bazelrc`. This
is the preferred way, since it also unpacks the resulting tarball.

See `test_external/` for an example using [embind](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html).

### Using --config=wasm
Copy link
Collaborator

Choose a reason for hiding this comment

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

does --config=wasm no longer work?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In an ideal world, --config=wasm32 and --config=wasm64 are both allowed, and --config=wasm just points to --config=wasm32 for backwards compatibility.

Copy link
Author

@jrandolf jrandolf Jul 5, 2022

Choose a reason for hiding this comment

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

I'm not sure what you mean by "backwards-compatibility". If we update the config here, it doesn't imply it propagates to the user. In particular, this only affects developers of this repo, not external users.

@jrandolf
Copy link
Author

jrandolf commented Jul 6, 2022

I'll reopen this with my internal account.

@jrandolf jrandolf closed this Jul 6, 2022
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.

3 participants