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

onig has a dependency on onig_sys 69.7.0 in crates #165

Closed
happysalada opened this issue Oct 22, 2021 · 9 comments
Closed

onig has a dependency on onig_sys 69.7.0 in crates #165

happysalada opened this issue Oct 22, 2021 · 9 comments
Assignees

Comments

@happysalada
Copy link

ref

in the dependencies part on the left it says that onig_sys should be 69.7.0 (instead of 69.7.1)
This causes compilation problems when trying to vendor the crates.
I'm not sure how to update that version

@happysalada
Copy link
Author

It looks like it might just be a matter of bumping this https://github.com/rust-onig/rust-onig/blob/main/onig/Cargo.toml#L38

@iwillspeak iwillspeak self-assigned this Oct 22, 2021
@iwillspeak
Copy link
Collaborator

Fixed in 6.3.1:

https://crates.io/crates/onig/6.3.1

@happysalada
Copy link
Author

Thank you so much for the very fast fix!

@iwillspeak
Copy link
Collaborator

We aim to please. Thanks for the report btw.

@happysalada
Copy link
Author

happysalada commented Oct 23, 2021

Sorry to bother with this. But using cargo vendor with one of the dependencies of one project being onig, I still get the following error

   Compiling tracing-limit v0.1.0 (/private/tmp/nix-build-vector-0.17.3.drv-0/source/lib/tracing-limit)
   Compiling fakedata v0.1.0 (/private/tmp/nix-build-vector-0.17.3.drv-0/source/lib/fakedata)
   Compiling num_enum v0.5.4
   Compiling heim v0.1.0-rc.1 (https://github.com/heim-rs/heim.git?rev=b292f1535bb27c03800cdb7509fa81a4085
   Compiling onig v6.3.1
error[E0425]: cannot find value `ONIG_SYN_OP2_QMARK_CAPITAL_P_NAME` in crate `onig_sys`
  --> /private/tmp/nix-build-vector-0.17.3.drv-0/vector-0.17.3-vendor.tar.gz/onig/src/flags.rs:74:22
   |
74 |         = (onig_sys::ONIG_SYN_OP2_QMARK_CAPITAL_P_NAME as u64);
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `
   |
  ::: /private/tmp/nix-build-vector-0.17.3.drv-0/source/target/x86_64-apple-darwin/release/build/onig_sys-
   |
3  | ...EN_IF_ELSE : u32 = 2097152 ; pub const ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP : u32 = 4194304 ; pub const
   |                                 ----------------------------------------------------------- similarly

error[E0425]: cannot find value `OnigSyntaxPython` in crate `onig_sys`
  --> /private/tmp/nix-build-vector-0.17.3.drv-0/vector-0.17.3-vendor.tar.gz/onig/src/syntax.rs:39:39
   |
39 |         unsafe { transmute(&onig_sys::OnigSyntaxPython) }
   |                                       ^^^^^^^^^^^^^^^^ help: a static with a similar name exists: `On
   |
  ::: /private/tmp/nix-build-vector-0.17.3.drv-0/source/target/x86_64-apple-darwin/release/build/onig_sys-
5ad7fd7cc508e343/out/bindings.rs:3:22644
   |
3  | ... } extern "C" { pub static mut OnigSyntaxPerl : OnigSyntaxType ; } extern "C" { pub static mut Oni
gSyntaxPerl_NG : OnigSyntaxType ; } ...
   |                    ------------------------------------------------ similarly named static `OnigSynta
xPerl` defined here

For more information about this error, try `rustc --explain E0425`.
error: could not compile `onig` due to 2 previous errors

When checking on the official rust documentation of the crate, those structs don't appear
http://rust-onig.github.io/rust-onig/onig_sys/
Could it be that the github version is not released to crates.io ?

I can confirm that the problem only seems to happen when you vendor dependencies. Using the normal compilation process, there doesn't seem to be any problems.

@iwillspeak
Copy link
Collaborator

I think the docs are just really old. The key marker here is the Python syntax. That is in the latest version on docs.rs: https://docs.rs/onig_sys/69.7.1/onig_sys/static.OnigSyntaxPython.html

@iwillspeak
Copy link
Collaborator

I don’t know about how vendoring works. Are you using 69.7.1 of onig_sys?

@iwillspeak
Copy link
Collaborator

iwillspeak commented Oct 23, 2021

On closer inspection it looks like your error is to do with the version of oniguruma (the native library) you’re compiling against. You could try either updating that, or switching to use the built-in copy of Oniguruma: https://github.com/rust-onig/rust-onig#build-errors-caused-by-libclangllvm

@happysalada
Copy link
Author

wow thank you for this! You are right, the oniguruma is one version behind!
I'm going to update that.
Since onig is a depedency of a dependency in the build, I don't think I can define the default-feature = false with the cargo cli.
Updating the oniguruma should work fine I think.
Thanks a lot for your help on this!

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

No branches or pull requests

2 participants