Repository: wasmerio/wasmer (language: rust)

Issue:
Can't compile with js feature on nightly rustc
### Describe the bug

This is a continuation of #4468, which was closed as not planned for some reason. Wasmer 5.0.0 doesn't compile on nightly rustc on the wasm32-unknown-unknown target any more when the `js` feature is enabled due to this line:

https://github.com/wasmerio/wasmer/blob/af6f650b668d265820f6aa3d6bfa7609234b4c69/lib/api/src/lib.rs#L23

```sh
rustc -vV
```
```
rustc 1.84.0-nightly (b8c8287a2 2024-11-03)
binary: rustc
commit-hash: b8c8287a229cd79604aa84c25e1235fc78cd5f2e
commit-date: 2024-11-03
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3
```

Note that nightly is necessary for multithreading support on Web, I can't use stable.


Discussion / hints:

Fix patch:
diff --git a/Makefile b/Makefile
index 4f625e9499b..2304081a8b3 100644
--- a/Makefile
+++ b/Makefile
@@ -404,6 +404,9 @@ build-wasmer-wasmi:
 build-wasmer-jsc:
 	$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml --no-default-features --features="jsc,wat" --bin wasmer --locked
 
+build-wasmer-api-js:
+	$(CARGO_BINARY) rustc --target wasm32-unknown-unknown --release --manifest-path lib/api/Cargo.toml --no-default-features --features "js, js-default, wasm-types-polyfill, enable-serde" --crate-type=cdylib --locked
+
 build-wasmer-debug:
 	$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/cli/Cargo.toml $(compiler_features) --bin wasmer --locked
 
diff --git a/lib/api/src/lib.rs b/lib/api/src/lib.rs
index ec69685a6d4..52b13c18e64 100644
--- a/lib/api/src/lib.rs
+++ b/lib/api/src/lib.rs
@@ -19,8 +19,6 @@
     clippy::unicode_not_nfc,
     clippy::use_self
 )]
-#![allow(deprecated_cfg_attr_crate_type_name)]
-#![cfg_attr(feature = "js", crate_type = "cdylib")]
 
 //! [`Wasmer`](https://wasmer.io/) is the most popular
 //! [WebAssembly](https://webassembly.org/) runtime for Rust. It supports


Test patch: