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

Support llvm-15 for inkwell #365

Closed
wants to merge 9 commits into from
Closed

Support llvm-15 for inkwell #365

wants to merge 9 commits into from

Conversation

ksolana
Copy link
Contributor

@ksolana ksolana commented Nov 1, 2022

Description

Added llvm-15 support
#359

Issues

Still has build errors.

argo build
   Compiling inkwell v0.1.0 (/run/media/inkwell)
error: One of the LLVM feature flags must be provided: llvm4-0 llvm5-0 llvm6-0 llvm7-0 llvm8-0 llvm9-0 llvm10-0 llvm11-0 llvm12-0 llvm13-0 llvm14-0 llvm15-0 
   --> src/lib.rs:97:9
    |
97  |         compile_error!(concat!("One of the LLVM feature flags must be provided: ", $($all, " "),*));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
108 | assert_unique_used_features! {"llvm4-0", "llvm5-0", "llvm6-0", "llvm7-0", "llvm8-0", "llvm9-0", "llvm10-0", "llvm11-0", "llvm12-0", "llvm13-0", "llvm14-0", "llvm15-0"}
    | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `assert_used_features` which comes from the expansion of the macro `assert_unique_used_features` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `llvm_sys`
 --> src/support/error_handling.rs:4:5
  |
4 | use llvm_sys::core::{LLVMGetDiagInfoDescription, LLVMGetDiagInfoSeverity};
  |     ^^^^^^^^ use of undeclared crate or module `llvm_sys`

@TheDan64
Copy link
Owner

TheDan64 commented Nov 1, 2022

Still has build errors.

As mentioned in the issue, it's not just as simple as updating the Cargo.toml :)

Off the top of my head, there's at least a few more things needed:

And probably more..

@ksolana
Copy link
Contributor Author

ksolana commented Nov 1, 2022

This macro still errors out. What is it looking for?

$ cargo build
   Compiling inkwell v0.1.0 (/run/media/adityak/tb_half/inkwell)
error: One of the LLVM feature flags must be provided: llvm4-0 llvm5-0 llvm6-0 llvm7-0 llvm8-0 llvm9-0 llvm10-0 llvm11-0 llvm12-0 llvm13-0 llvm14-0 llvm15-0 
   --> src/lib.rs:97:9
    |
97  |         compile_error!(concat!("One of the LLVM feature flags must be provided: ", $($all, " "),*));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
108 | assert_unique_used_features! {"llvm4-0", "llvm5-0", "llvm6-0", "llvm7-0", "llvm8-0", "llvm9-0", "llvm10-0", "llvm11-0", "llvm12-0", "llvm13-0", "llvm14-0", "llvm15-0"}
    | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation

@TheDan64
Copy link
Owner

TheDan64 commented Nov 2, 2022

Need to specify an llvm version feature flag

@ksolana
Copy link
Contributor Author

ksolana commented Nov 3, 2022

Need to specify an llvm version feature flag

Can you point to the code where I need to specify that?

@TheDan64
Copy link
Owner

TheDan64 commented Nov 3, 2022

cargo build --features llvm15-0

@TheDan64 TheDan64 self-requested a review November 4, 2022 01:20
@gavrilikhin-d
Copy link
Contributor

...And add llvm15-0 as supported version to README 😀

@gavrilikhin-d
Copy link
Contributor

gavrilikhin-d commented Nov 9, 2022

But there is a problem. LLVM is moving to opaque pointers. In llvm 15 non-opaque pointer access may already have been removed from API

@TheDan64
Copy link
Owner

Opaque ptrs are still optional in LLVM15, we can figure out come the LLVM16 release

@ksolana
Copy link
Contributor Author

ksolana commented Nov 21, 2022

Fixed cargo build --features llvm15-0. Still some work is required to fix cargo test --features llvm15-0

src/values/traits.rs Outdated Show resolved Hide resolved
@hedgar2017
Copy link
Contributor

@aditya-solana I've finished support in this PR. Please check if you'd like to add anything.
But I'd like to run the CI before merging. Unfortunately, it doesn't work for LLVM 15.

@ksolana
Copy link
Contributor Author

ksolana commented Dec 2, 2022

@hedgar2017
Thanks for your efforts!

@hedgar2017
Copy link
Contributor

@aditya-solana I think you may close this PR. We'll wait until the CI is fixed and then merge mine.

@ksolana
Copy link
Contributor Author

ksolana commented Dec 11, 2022

closing

@ksolana ksolana closed this Dec 11, 2022
@ksolana ksolana deleted the llvm-15 branch December 11, 2022 06:42
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.

4 participants