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

Migrate to Rust 2021 Edition #123

Closed
idavis opened this issue May 26, 2022 · 4 comments · Fixed by #185
Closed

Migrate to Rust 2021 Edition #123

idavis opened this issue May 26, 2022 · 4 comments · Fixed by #185
Assignees
Labels
good first issue Good for newcomers maintenance Code quality improvement or maintenance

Comments

@idavis
Copy link
Collaborator

idavis commented May 26, 2022

With the release of Rust 1.56, the 2021 Rust Edition has been available. The there is a migration guide to new edition.

@idavis idavis added maintenance Code quality improvement or maintenance good first issue Good for newcomers unitaryhack-bounty labels May 26, 2022
@divshacker
Copy link

divshacker commented Jun 2, 2022

Hey, I am interested in working on this issue.
I have done a try updating the new version of rust but facing some errors.

  • cargo fix --edition works but throws a error
  process didn't exit successfully: `/home/divshacker/pyqir/target/debug/build/llvm-ir-c75243ba21a4165f/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'llvm-ir: Please select an LLVM version using a Cargo feature.', /home/divshacker/.cargo/registry/src/github.com-1ecc6299db9ec823/llvm-ir-0.8.1/build.rs:22:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed 
  • Cargo.toml don't have the edition field.

Please help me out by resolving this error.

Thanks

@idavis
Copy link
Collaborator Author

idavis commented Jun 3, 2022

Hi @divshacker, thank you for your interest.

Please take a look at the development guide on how to build PyQIR. The build script must be run prior to using cargo commands. Then you can use the commands in the development section of the docs.

If you want to use an existing installation of LLVM, you can set the environment variables so that the build doesn't have to compile LLVM.

@divshacker
Copy link

I have tried to run build.sh but it is exiting every time and not building the LLVM completely. First, I have tested it in my system, then I used docker and created the environment and ran build.sh but still throws error that cargo can't LLVM automatically. I don't know what happens but still this the problem. I think person who have already a working enviornment can run cargo fix --edition to fix this issue, I have tried to build a working environment but fail every time

@idavis
Copy link
Collaborator Author

idavis commented Jun 17, 2022

@divshacker We need the exact command and error that you are getting. Also, cargo fix --edition will not work without the additional feature flags outlined in the documentation I linked to above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers maintenance Code quality improvement or maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants