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

wasmer-wasix unkown import "env" "now" #4037

Closed
WanderLanz opened this issue Jun 26, 2023 · 2 comments
Closed

wasmer-wasix unkown import "env" "now" #4037

WanderLanz opened this issue Jun 26, 2023 · 2 comments
Assignees
Labels
priority-medium Medium priority issue
Milestone

Comments

@WanderLanz
Copy link

WanderLanz commented Jun 26, 2023

wasmer-wasix dependency tempfile-v3.4.0 relies on fastrand-v1.9.0 which still has this issue for wasm32-unkown-unknown (web) target related to feature flag misconfiguration with the instant crate (outlined in this issue). This issue looks to be fixed in fastrand-v2.0.0, and tempfile-v3.6.0 depends on fastrand-v2.0.0 now. Also mentioned in wasm-bindgen on this issue and in parking-lot on this issue.

wasmer-wasix v0.x.x
└── tempfile v3.4.0 <-- v3.6.0 uses fastrand v2.0.0
    ├── cfg-if v1.0.0
    └── fastrand v1.9.0 <-- misconfigured feature flags, sometimes makes feature resolver "fail"? fixed in v2.0.0?
        └── instant v0.1.12 (*) <-- origin of (import "env" "now" (func ...))

As a temporary workaround for anyone who encounters this issue, you can try and pin the instant crate itself, as mentioned here:

[dependencies]
instant = { version = "0.1", features = ["wasm-bindgen"] } # same version pinned as `fastrand` v1.9

I haven't seen anyone else mention this issue and it didn't even manifest until I tried to implement HttpClient, so this probably isn't an issue for everyone.

It might just be the resolver being weird, but I thought I'd give anyone a heads up.

EDIT: see below

@ptitSeb ptitSeb added the priority-medium Medium priority issue label Jun 27, 2023
@ptitSeb ptitSeb added this to the v4.0.1 milestone Jun 27, 2023
@ptitSeb ptitSeb self-assigned this Jun 27, 2023
ptitSeb added a commit that referenced this issue Jun 28, 2023
@WanderLanz
Copy link
Author

WanderLanz commented Jun 30, 2023

So sorry, I made a goofy mistake of checking the git tempfile source for the dependency graph. tempfile v3.6.0 still depends on fastrand 1.x, so it still needs the instant-pin fix.

However, updating tempfile doesn't break anything and should have probably still been done just as with other dependencies, thank you for the quick response to this.

@ptitSeb ptitSeb modified the milestones: v4.1, v4.2 Jul 18, 2023
@ptitSeb ptitSeb assigned Michael-F-Bryan and unassigned ptitSeb Aug 17, 2023
@Michael-F-Bryan
Copy link
Contributor

This is no longer an issue as of the latest master (64ab037).

You can verify it using the following:

$ cargo tree --package=wasmer-wasix --features=js,wasmer/js,wasmer/std --target=wasm32-unknown-unknown --edges=features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants