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

Could not compile custom plugins with a stable rust #7149

Closed
timofei-iatsenko opened this issue Mar 27, 2023 · 9 comments
Closed

Could not compile custom plugins with a stable rust #7149

timofei-iatsenko opened this issue Mar 27, 2023 · 9 comments
Labels
Milestone

Comments

@timofei-iatsenko
Copy link

timofei-iatsenko commented Mar 27, 2023

Describe the bug

Tried to build a plugin with swc_core@0.69.x and get

   Compiling errno v0.2.8
   Compiling num_cpus v1.14.0
error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /Users/tim/.cargo/registry/src/github.com-1ecc6299db9ec823/errno-0.2.8/src/lib.rs:20:33
   |
20 | #![cfg_attr(target_os = "wasi", feature(thread_local))]
   |                                 ^^^^^^^^^^^^^^^^^^^^^

λ rustc --version
rustc 1.65.0 (897e37553 2022-11-02)

However, compiles with nightly-2022-09-23

Input code

No response

Config

No response

Playground link

No response

Expected behavior

Compiles with stable rust

Actual behavior

No response

Version

0.69

Additional context

No response

@kdy1 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2023
@kdy1 kdy1 reopened this Mar 27, 2023
@timofei-iatsenko
Copy link
Author

If it's intended, I think it should be written in Plugin doc page. Because as far as i remember not every nightly and even not every stable version of Rust would work because of the issue

@kdy1
Copy link
Member

kdy1 commented Mar 28, 2023

It's not intended, we don't maintain errno-0.2.8

@timofei-iatsenko
Copy link
Author

timofei-iatsenko commented Mar 28, 2023

According cargo.lock errno came from

swc_ecma_transforms_testing@0.127.0 -> tempfile@3.4.0 -> rustix@0.36.7 -> errno@0.2.8

@kdy1 kdy1 added this to the Planned milestone Mar 28, 2023
@kdy1
Copy link
Member

kdy1 commented Mar 28, 2023

Oh, wait, you build swc_ecma_transforms_testing for wasm?
I think something is wrong there.

You can do like https://github.com/swc-project/plugins/blob/bb8f9a4b30a7130f50582f681db858ff98df921f/packages/emotion/transform/Cargo.toml#L33-L37 to avoid building the fixture testing system into the final Wasm file and avoid building testing crates for Wasm

@timofei-iatsenko
Copy link
Author

Well, it builds with stable rust but for development / testing still need to use nightly, which is I thinking is not good.
It may work well during dev, and not build in CI.

Also, this configuration was generated by SWC CLI, maybe it should be updated (if not already) to split prod / dev deps?

@kdy1
Copy link
Member

kdy1 commented Mar 31, 2023

I'll update the plugin template

@kdy1
Copy link
Member

kdy1 commented Mar 31, 2023

Oh plugin template was correct

@timofei-iatsenko
Copy link
Author

I think this could be closed.

@kdy1 kdy1 modified the milestones: Planned, v1.3.45 Apr 4, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented May 4, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants