ayzim
ayzim copied to clipboard
error with “cargo build”
When I use "cargo build --verbose"to build the project,I encounter the following problem: error: failed to parse registry's information for: serde
Caused by:
Feature derive depends on serde_derive which is not an optional dependency.
Consider adding optional = true to the dependency
But I never change anything in the project.
And if I add optional = true to the dependency, I still get the same error.
Unfortunately this seems like a bug in cargo/newer formats of the registry https://github.com/rust-lang/cargo/issues/14237
Not really sure if there's a way to work around this, so the only option would be to update ayzim to latest rust - possible, but a bit annoying.
Are you sure you need this project? It was designed to optimise asm.js files, but these days people generally use wasm - so I'm not sure it's worth the effort to update.
(note: I think the same techniques used in ayzim could be used to speed up binaryen (the wasm optimiser) if that's something you wanted to pursue)
Unfortunately this seems like a bug in cargo/newer formats of the registry rust-lang/cargo#14237
Not really sure if there's a way to work around this, so the only option would be to update ayzim to latest rust - possible, but a bit annoying.
Are you sure you need this project? It was designed to optimise asm.js files, but these days people generally use wasm - so I'm not sure it's worth the effort to update.
(note: I think the same techniques used in ayzim could be used to speed up binaryen (the wasm optimiser) if that's something you wanted to pursue)
Thanks for your reply!
Actually I want to get some function pairs that written in different language like rust and c++ but have the identical functionality to develop and evaluate my tools , which is used to automatically translate the functions that written in other language to rust. And I found that you used rust to rewrite the Emscripten asm.js optimizer based on function level. So I can get some function pairs from your project and the Emscripten asm.js optimizer. But in order to evaluate my tools, I have to run your project.
I see, interesting.
With that context, I want to note there are minor differences between ayzim and the emscripten optimiser. It's been a while now, but from memory the emscripten optimiser tries quite hard (sacrificing performance in some cases) to be deterministic e.g. with generating variable names and I'm not sure that ayzim is - partly because replicating exact behaviour was a touch tricky, partly because performance was my highest concern. (of course, for a fair comparison you'd need to compare against the emscripten optimiser from ~7 years ago too)
If you want to proceed with this, you have a few options to solve the two issues of the plugin and the cargo issue (unfortunately I'm not enthused to follow any of them myself since I'm not using this project atm).
The cargo issue looks like it'll need this project to use a different version of rust. Your choices are:
- fully update rust
- minimally update rust to the version that has cargo with this bug fixed (apparently cargo 0.19 - I don't know what rust nightly version that corresponds to so you'd need to do digging)
When doing this, you'll need to figure out mast!. The mast! macro plugin is a simple macro to make writing box patterns easier - it just expands any tuple struct in a pattern like A(B(_)) to box A(box B(_)). You could:
a. remove the plugin entirely and write a small script to expand all the macros/do it by hand
b. (if fully updating rust) replace the plugin with a proc macro - I don't know how hard it'd be to do this
c. (if minimally updating rust) update the plugin - shouldn't be too hard
Overall, for someone who wanted to pursue this I'd probably recommend the combination of 1 + a - it requires the least knowledge of rust/this project and should be possible without too much learning about the project.
I see, interesting.
With that context, I want to note there are minor differences between ayzim and the emscripten optimiser. It's been a while now, but from memory the emscripten optimiser tries quite hard (sacrificing performance in some cases) to be deterministic e.g. with generating variable names and I'm not sure that ayzim is - partly because replicating exact behaviour was a touch tricky, partly because performance was my highest concern. (of course, for a fair comparison you'd need to compare against the emscripten optimiser from ~7 years ago too)
If you want to proceed with this, you have a few options to solve the two issues of the plugin and the cargo issue (unfortunately I'm not enthused to follow any of them myself since I'm not using this project atm).
The cargo issue looks like it'll need this project to use a different version of rust. Your choices are:
- fully update rust
- minimally update rust to the version that has cargo with this bug fixed (apparently cargo 0.19 - I don't know what rust nightly version that corresponds to so you'd need to do digging)
When doing this, you'll need to figure out
mast!. Themast!macro plugin is a simple macro to make writing box patterns easier - it just expands any tuple struct in a pattern likeA(B(_))tobox A(box B(_)). You could: a. remove the plugin entirely and write a small script to expand all the macros/do it by hand b. (if fully updating rust) replace the plugin with a proc macro - I don't know how hard it'd be to do this c. (if minimally updating rust) update the plugin - shouldn't be too hardOverall, for someone who wanted to pursue this I'd probably recommend the combination of 1 + a - it requires the least knowledge of rust/this project and should be possible without too much learning about the project.
Thank you very much, again!
The version I choose is the one you mentioned in the REAMDE.
Besides, I'ill try to use the combination of 1 + a to solve the problem.