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

Tool extraction failure #229

Closed
quinn opened this issue Nov 19, 2022 · 8 comments
Closed

Tool extraction failure #229

quinn opened this issue Nov 19, 2022 · 8 comments
Labels
A-cli Area: command line interface author-willing-to-impl The author of this issue is willing to try to implement the solution themselves. C-bug Category: bug P-high Priority: high tribble-reported This issue was reported through Tribble.

Comments

@quinn
Copy link

quinn commented Nov 19, 2022

This issue is reporting a bug in the code of Perseus. Details of the scope will be available in issue labels.
The author described their issue as follows:

error with perseus serve immediately after running perseus new

The steps to reproduce this issue are as follows:

$ perseus new appname
Your new app has been created! Run perseus serve -w to get to work! You can find more details, including about improving compilation speeds in the Perseus docs (https://arctic-hen7.github.io/perseus/en-US/docs/).
$ cd appname/src
$ perseus serve -w
🔏 Generating Cargo lockfile...✅
📥 Installing external tools...❌
Error: couldn't extract 'wasm-opt' (do you have the necessary permissions?)

Caused by:
failed to iterate over archive
Caused by:
failed to fill whole buffer

A minimum reproducible example is available at <>.

  • Hydration-related: false
  • The author is willing to attempt a fix: true
Tribble internal data

dHJpYmJsZS1yZXBvcnRlZCxDLWJ1ZyxBLWNsaSxhdXRob3Itd2lsbGluZy10by1pbXBs

@github-actions github-actions bot added A-cli Area: command line interface author-willing-to-impl The author of this issue is willing to try to implement the solution themselves. C-bug Category: bug tribble-reported This issue was reported through Tribble. labels Nov 19, 2022
@arctic-hen7
Copy link
Member

Hmm, that's extremely weird. What's your OS?

@arctic-hen7 arctic-hen7 changed the title error with perseus serve immediately after running perseus new Tool extraction failure Nov 19, 2022
@quinn
Copy link
Author

quinn commented Nov 20, 2022

@arctic-hen7 Ubuntu 22.04, also worth mentioning (thought I posted with issue) i'm on perseus 0.4 beta

This wasn't happening before, just started happening, which is what led me to try generating a new app

It sounds like a file perm error, where is wasm-opt being axtracted to?

@arctic-hen7
Copy link
Member

Hmm, same. It's extracted to your system cache directory, which should be something like ~/.cache/perseus-cli/tools for you. Could you try clearing that directory? Perseus should use the local dist/ directory if it finds the systemwide cache unusable, which implies that this might have been caused by a corruption of some sort. I've experienced some weird Cargo failures causing tool reinstallation in the past, so it could be something like that.

@arctic-hen7
Copy link
Member

UPDATE: This is now occurring on CI, so I think this might be a critical bug that's worked its way into the installation process somehow.

@arctic-hen7 arctic-hen7 pinned this issue Nov 20, 2022
@arctic-hen7 arctic-hen7 added the P-high Priority: high label Nov 20, 2022
@arctic-hen7
Copy link
Member

Okay, this has been caused by the wasm-opt team releasing a new version without including any release artifacts. The CLI defaults to the latest version, and it can't find the artifacts, hence the problem! Add --wasm-opt-version version_110 to the first Perseus command you run, and everything will work perfectly. (You won't need to add this flag again.)

@arctic-hen7
Copy link
Member

See WebAssembly/binaryen#5282.

arctic-hen7 added a commit that referenced this issue Nov 20, 2022
@quinn
Copy link
Author

quinn commented Nov 20, 2022

thank you! that fixed it. Fixed by running:

perseus serve -w --wasm-opt-version version_110

subsequent runs work without the flag:

perseus serve -w

@arctic-hen7
Copy link
Member

The artifacts for wasm-opt's parent package have now been released for v111, so this problem should no longer affect anyone! I'll leave this issue open until the upstream one is definitely closed, and then I'll remove the warning in the README.

@arctic-hen7 arctic-hen7 unpinned this issue Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: command line interface author-willing-to-impl The author of this issue is willing to try to implement the solution themselves. C-bug Category: bug P-high Priority: high tribble-reported This issue was reported through Tribble.
Projects
None yet
Development

No branches or pull requests

2 participants