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

Crate fails to build in github actions on version macOS 12.6.5 #8

Open
JoshuaNitschke opened this issue May 30, 2023 · 9 comments
Open

Comments

@JoshuaNitschke
Copy link
Contributor

JoshuaNitschke commented May 30, 2023

As an FYI this crate no longer builds on github actions runs-on: macos-latest

I'm sort of waiting for the next image update to see if it is still broken, but thought I'd report this in case anyone else has the issue later.

openssl = { version = "0.10", features = ["vendored"] }
[xmlsec = "0.2.2"]

Failure is on

Operating System
  macOS
  12.6.5
Runner Image
  Image: macos-12
  Included Software: https://github.com/actions/runner-images/blob/macOS-12/20230505.1/images/macos/macos-12-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20230505.1

Last time it successfully built was on:

Operating System
  macOS
  12.6.4
  21G526
Runner Image
  Image: macos-12
  Included Software: https://github.com/actions/runner-images/blob/macOS-12/20230328.1/images/macos/macos-12-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20230328.1

Current errors:

error[E0425]: cannot find function `xmlSecOpenSSLTransformHmacMd5GetKlass` in module `bindings`
     --> /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xmlsec-0.2.2/src/crypto/openssl.rs:80:55
      |
80    |             Self::HmacMd5       => unsafe { bindings::xmlSecOpenSSLTransformHmacMd5GetKlass() },
      |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `xmlSecOpenSSLTransformHmacSha1GetKlass`
      |
     ::: /Users/runner/work/my-project/my-project/target/release/build/xmlsec-ce71c6600a0b42d1/out/bindings.rs:61325:5
      |
61325 |     pub fn xmlSecOpenSSLTransformHmacSha1GetKlass() -> xmlSecTransformId;
      |     --------------------------------------------------------------------- similarly named function `xmlSecOpenSSLTransformHmacSha1GetKlass` defined here

error[E0425]: cannot find function `xmlSecOpenSSLTransformMd5GetKlass` in module `bindings`
     --> /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xmlsec-0.2.2/src/crypto/openssl.rs:87:55
      |
87    |             Self::Md5           => unsafe { bindings::xmlSecOpenSSLTransformMd5GetKlass() },
      |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `xmlSecOpenSSLTransformEcdhGetKlass`
      |
     ::: /Users/runner/work/my-project/my-project/target/release/build/xmlsec-ce71c6600a0b42d1/out/bindings.rs:61309:5
      |
61309 |     pub fn xmlSecOpenSSLTransformEcdhGetKlass() -> xmlSecTransformId;
      |     ----------------------------------------------------------------- similarly named function `xmlSecOpenSSLTransformEcdhGetKlass` defined here

error[E0425]: cannot find function `xmlSecOpenSSLTransformRsaMd5GetKlass` in module `bindings`
     --> /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xmlsec-0.2.2/src/crypto/openssl.rs:89:55
      |
89    |             Self::RsaMd5        => unsafe { bindings::xmlSecOpenSSLTransformRsaMd5GetKlass() },
      |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `xmlSecOpenSSLTransformRsaOaepGetKlass`
      |
     ::: /Users/runner/work/my-project/my-project/target/release/build/xmlsec-ce71c6600a0b42d1/out/bindings.rs:61389:5
      |
61389 |     pub fn xmlSecOpenSSLTransformRsaOaepGetKlass() -> xmlSecTransformId;
      |     -------------------------------------------------------------------- similarly named function `xmlSecOpenSSLTransformRsaOaepGetKlass` defined here

error[E0308]: mismatched types
     --> /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xmlsec-0.2.2/src/keys.rs:90:13
      |
88    |         let key = unsafe { bindings::xmlSecOpenSSLAppKeyLoadMemory(
      |                            --------------------------------------- arguments to this function are incorrect
89    |             buffer.as_ptr(),
90    |             buffer.len() as u32,
      |             ^^^^^^^^^^^^^^^^^^^ expected `u64`, found `u32`
      |
note: function defined here
     --> /Users/runner/work/my-project/my-project/target/release/build/xmlsec-ce71c6600a0b42d1/out/bindings.rs:60638:12
      |
60638 |     pub fn xmlSecOpenSSLAppKeyLoadMemory(
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: you can convert a `u32` to a `u64`
      |
90    |             (buffer.len() as u32).into(),
      |             +                   ++++++++

error[E0308]: mismatched types
     --> /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xmlsec-0.2.2/src/keys.rs:125:17
      |
122   |             bindings::xmlSecOpenSSLAppKeyCertLoadMemory(
      |             ------------------------------------------- arguments to this function are incorrect
...
125   |                 buff.len() as u32,
      |                 ^^^^^^^^^^^^^^^^^ expected `u64`, found `u32`
      |
note: function defined here
     --> /Users/runner/work/my-project/my-project/target/release/build/xmlsec-ce71c6600a0b42d1/out/bindings.rs:60689:12
      |
60689 |     pub fn xmlSecOpenSSLAppKeyCertLoadMemory(
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: you can convert a `u32` to a `u64`
      |
125   |                 (buff.len() as u32).into(),
      |                 +                 ++++++++

Some errors have detailed explanations: E0308, E0425.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `xmlsec` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.
@lweberk
Copy link

lweberk commented May 31, 2023

Since this is a recurring theme, perhaps its best to approach this with conditional compilation. What do you think?

@JoshuaNitschke
Copy link
Contributor Author

Since this is a recurring theme, perhaps its best to approach this with conditional compilation. What do you think?

Sorry for being dense, but I'm not sure I am following what you are suggesting.

Are you saying add feature flags to the crate for these functions allowong opt out to avoid compiling?

@lweberk
Copy link

lweberk commented May 31, 2023

Not at all, totally legitimate question. My bad for not being thorough. I'm referring specifically to this. More than a feature flag, it is a way to have a specific piece of code compile only on certain conditions. It uses the exact same mechanism as features.

@JoshuaNitschke
Copy link
Contributor Author

@lweberk maybe. I think it has more to do the openssl/libxml version installed on mac os x and for that reason wouldn't want to go with an OS level target.

This has been compiling flawlessly for years on github actions, and on my older mac it still does as well.

Thus, doing an OS target seems a bit too heavy of a hammer...

@lweberk
Copy link

lweberk commented May 31, 2023

I see. You have a point there. There is also the case of multiple libs being shipped on the same platform with different sets of support for the different crypto algorithm families. So its a highly moving target.

That makes me think back to you mentioning feature flags. Have feature flags for the different crypto algo families. In this case I can see MacOS is shipping openssl without MD5 and its variants. Which can be seen as a very sensible thing to do. Perhaps a flag for all MD5, as well as the AES-CBC which are already out commented due to Ubuntu incompatibilities. And so on and so forth...

Currently I'm totally swamped, will have a deeper look at it during the weekend.

@itsbalamurali
Copy link

@lweberk perhaps moving to https://github.com/RustCrypto would help?

@lweberk
Copy link

lweberk commented Jul 4, 2023

@itsbalamurali No, unfortunately not. Since we are wrapping libxmlsec, it in turn having its own notion of its backend for sourcing its crypto primitives

@Will5
Copy link

Will5 commented Dec 4, 2024

I'm experiencing this same issue on my MacBook Pro, Apple M1 Max, Version 15.1.1. Any chance a fix is available?

@JoshuaNitschke
Copy link
Contributor Author

JoshuaNitschke commented Dec 5, 2024

@Will5 I'm building on Github Actions OSX with my fork. I don't have a mac to test with.

xmlsec = { git = "https://github.com/JoshuaNitschke/rust-xmlsec" }

It however fails to sign xml for me. Maybe you can help with it, I don't have a mac, so its hard for me to move this further:

#13 (comment)

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

4 participants