Skip to content

[bazel] Fix and update emscripten_toolchain - #1060

Closed
jrandolf-old wants to merge 7 commits into
emscripten-core:mainfrom
mathematic-inc:main
Closed

jrandolf-old wants to merge 7 commits into
emscripten-core:mainfrom
mathematic-inc:main

Conversation

@jrandolf-old

Copy link
Copy Markdown

This PR makes several changes. See the commit descriptions.

Randolf Jung 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

sbc100 commented Jun 17, 2022

Copy link
Copy Markdown
Collaborator

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

@jrandolf-old jrandolf-old changed the title Fix and update emscripten_toolchain [bazel] Fix and update emscripten_toolchain Jun 17, 2022
Randolf Jung added 4 commits June 17, 2022 22:03
* 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.

@walkingeyerobot walkingeyerobot left a comment

Copy link
Copy Markdown
Collaborator

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:linkopt": linkopts,
"//command_line_option:platforms": [],
"//command_line_option:incompatible_enable_cc_toolchain_resolution": True,
"//command_line_option:platforms": ["@emsdk//:cpu_wasm32"],

Copy link
Copy Markdown
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
Copy Markdown
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?

@jrandolf-old jrandolf-old Jun 30, 2022 •

Copy link
Copy Markdown
Author

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.

Comment thread bazel/README.md

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

### Using --config=wasm

Copy link
Copy Markdown
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
Copy Markdown
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.

@jrandolf-old jrandolf-old Jul 5, 2022 •

Copy link
Copy Markdown
Author

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-old

Copy link
Copy Markdown
Author

I'll reopen this with my internal account.

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