Skip to content

Fix wasm-opt --version parsing#248

Merged
cmichi merged 5 commits into
masterfrom
cmichi-fix-wasm-opt-version-parsing
Apr 6, 2021
Merged

Fix wasm-opt --version parsing#248
cmichi merged 5 commits into
masterfrom
cmichi-fix-wasm-opt-version-parsing

Conversation

@cmichi

@cmichi cmichi commented Apr 6, 2021

Copy link
Copy Markdown
Collaborator

Closes #247.

The issue was that binaryen includes more extensive version information in the --version output only if built from source. If installed via a package manager the version output can be more compact.

I've also escalated this into the ticket https://github.com/paritytech/ci_cd/issues/121, to install binaryen from a package manager in our CI.

@cmichi
cmichi requested a review from ascjones April 6, 2021 03:10
Comment thread src/cmd/build.rs Outdated
.expect("Cannot convert stdout output of wasm-opt to string")
.trim();
let re = Regex::new(r"wasm-opt version (\d+)\s+").unwrap();
let re = Regex::new(r"wasm-opt version (\d+)").unwrap();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't spot it in the original PR but this should be an expect("invalid regex") or such.

@cmichi cmichi Apr 6, 2021

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Argh! Maybe we should consider adding a clippy rule for unwrap() outside tests.

Comment thread src/cmd/build.rs Outdated
@ascjones

ascjones commented Apr 6, 2021

Copy link
Copy Markdown
Collaborator

This might need a 0.11.1 release

@cmichi
cmichi merged commit ceb24bf into master Apr 6, 2021
@cmichi
cmichi deleted the cmichi-fix-wasm-opt-version-parsing branch April 6, 2021 09:14
@cmichi cmichi mentioned this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasm-opt version error on contract build

2 participants