Skip to content

Conversation

rgonzalezfluendo
Copy link
Contributor

I am working on adding support to gst-plugins-rs to gst.wasm. gst.wasm is a GStreamer port to WebAssembly where meson works correctly for all C/C++ projects. The last release of Rust, version 1.84, unblocks an issue with that language. Rust 1.84 uses the latest emsdk 3.1.68. Among many other things, it fixed an issue with Emscripten dynamic linking and libc. After that, no native-static-libs in the output if running:

rustc --target=wasm32-unknown-emscripten --crate-type staticlib --print native-static-libs - < /dev/null

Note:

[cerbero-web-wasm32] root@f4b4c9e2e3b8:/gst-plugins-rs# rustc --version
rustc 1.83.0 (90b35a623 2024-11-26)
[cerbero-web-wasm32] root@f4b4c9e2e3b8:/gst-plugins-rs# rustc --target=wasm32-unknown-emscripten --crate-type staticlib --print native-static-libs - < /dev/null
note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.

note: native-static-libs: -lc

[cerbero-web-wasm32] root@f4b4c9e2e3b8:/gst-plugins-rs# rustup default beta
info: using existing install for 'beta-x86_64-unknown-linux-gnu'
info: default toolchain set to 'beta-x86_64-unknown-linux-gnu'

  beta-x86_64-unknown-linux-gnu unchanged - rustc 	1.84.0-beta.5 (0857a8e32 2024-12-27)

[cerbero-web-wasm32] root@f4b4c9e2e3b8:/gst-plugins-rs# rustc --version
rustc 1.84.0-beta.5 (0857a8e32 2024-12-27)
[cerbero-web-wasm32] root@f4b4c9e2e3b8:/gst-plugins-rs# rustc --target=wasm32-unknown-emscripten --crate-type staticlib --print native-static-libs - < /dev/null
[cerbero-web-wasm32] root@f4b4c9e2e3b8:/gst-plugins-rs#

@bonzini bonzini added this to the 1.7 milestone Dec 31, 2024
return
if self.info.system == 'emscripten':
# no match and emscripten is valid after rustc 1.84
return
Copy link
Member

Choose a reason for hiding this comment

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

If it's expected to always not match, should we skip running rustc --crate-type staticlib --print ....... entirely, and simply return early from the function depending on self.version comparison?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mimicked the baremetal flow where not early-return. I understood that running "rustc" was interesting to check it the compiler can compile staticlib.

However, the decision is yours. Please let me know your preference, and I would be happy to assist with the early return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bonzini bonzini modified the milestones: 1.7, 1.7.1 Jan 27, 2025
@eli-schwartz eli-schwartz removed this from the 1.7.1 milestone Mar 26, 2025
@eli-schwartz
Copy link
Member

This PR cannot be backported (?) to the stable release as it has not been merged to master (!!) -- unsetting from the milestone...

@bonzini bonzini added this to the 1.8 milestone Mar 27, 2025
@bonzini
Copy link
Collaborator

bonzini commented Apr 9, 2025

@rgonzalezfluendo can you rebase to fix CI?

@bonzini
Copy link
Collaborator

bonzini commented Apr 16, 2025

It didn't fix CI but the failures are independent.

@dcbaker
Copy link
Member

dcbaker commented Apr 16, 2025

@bonzini: is this ready for merge? It's a pretty small bug fix so should be suitable for merge during the release period

@bonzini
Copy link
Collaborator

bonzini commented Apr 16, 2025

Yes, I think everything in the milestone should be suitable... Only @eli-schwartz had some cosmetic comments.

@bonzini bonzini modified the milestones: 1.8, 1.9 Apr 29, 2025
@bonzini bonzini modified the milestones: 1.9, 1.8.2 May 24, 2025
@eli-schwartz eli-schwartz modified the milestones: 1.8.2, 1.8.3 Jun 9, 2025
@bonzini
Copy link
Collaborator

bonzini commented Jun 20, 2025

@rgonzalezfluendo can you rebase to make the CI green?

Rust 1.84 uses the latest emsdk 3.1.68 [1], and it fixed an
issue with Emscripten dynamic linking and libc [2]. After that no
native-static-libs in the output if running:

```
rustc --target=wasm32-unknown-emscripten --crate-type staticlib --print native-static-libs - < /dev/null
```

[1] rust-lang/rust#131533
[2] rust-lang/libc#4002
@bonzini bonzini modified the milestones: 1.8.3, 1.9 Jul 29, 2025
@jpakkane jpakkane merged commit 7d44982 into mesonbuild:master Aug 10, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants