Open juli1 opened 1 year ago
This action uses cross to cross-compile by default, and the cross wiki has a section on openssl.
Probably the easiest way is to enable the vendored
feature of openssl
crate.
The problem is that I do not control how openssl
is imported since it's imported by my dependencies (I do not import it directly). I will try to go the route to install libssl
but there are other challenges to do this in GitHub actions.
Because of the feature unification, it will work even if you add openssl
with vendored
feature enabled as a dependency of your crate.
Also, I think another way that might work is to install the toolchain for linux using setup-cross-toolchain-action mentioned in cross-compilation examples in readme, then enable the APT packages for arm64 (sudo dpkg --add-architecture arm64
) and install libssl-dev:arm64
via APT.
Thank you for your email! I am trying to include the vendored
feature for openssl
and see if this works.
I already tried to install libssl-dev:arm64
in the GitHub action. For a reason I still do not understand, dpkg --add-architecture
adds invalid sources in the sources.list
, which results to the following error.
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.38 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.38 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-security/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.38 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.38 80]
@taiki-e
Thanks for your quick response!
Enabling vendored can fix this issue on Mac and Linux, but not work on Windows.
It produces another error error: failed to run custom build command for
openssl-sys v0.9.95``
Same as https://github.com/p2panda/send-to-node/issues/7
Adding vendored breaks the windows build actually. It works fine before.
Hmm, is it possible to use the way that doesn't use openssl (i.e., use rustls)?.
Adding vendored breaks the windows build actually.
It is actually quite odd that it is failing though, since tarpaulin can build with this action and vendored feature enabled openssl without problems.
It is actually quite odd that it is failing though, since tarpaulin can build with this action and vendored feature enabled openssl without problems.
Thanks!
I have followed https://github.com/xd009642/tarpaulin/blob/a33d6dae1bac153a3c59cd112c74fccc58ea11dc/Cargo.toml#L64 and solved this problem.
It seems that this problem caused by the difference between git2/openssl
and openssl
.
Thanks for the awesome library.
I am sorry to also report the same issue and I know you have pointed people in the right direction, but I still am not able to solve the open ssl issue.
What I am getting in the CI/CD:
error[E0433]: failed to resolve: could not find `unix` in `os`
--> src\setup\files.rs:6:14
|
6 | use std::os::unix::fs::PermissionsExt;
| ^^^^ could not find `unix` in `os`
|
note: found an item that was configured out
--> /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04\library\std\src\os\mod.rs:26:9
note: found an item that was configured out
--> /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04\library\std\src\os\mod.rs:64:9
error[E0599]: no function or associated item named `from_mode` found for struct `Permissions` in the current scope
--> src\setup\files.rs:14:52
|
14 | fs::set_permissions(path, fs::Permissions::from_mode(0o700))
| ^^^^^^^^^ function or associated item not found in `Permissions`
error[E0599]: no function or associated item named `from_mode` found for struct `Permissions` in the current scope
--> src\setup\files.rs:24:69
|
24 | fs::set_permissions(config_json_file_path, fs::Permissions::from_mode(0o600))
| ^^^^^^^^^ function or associated item not found in `Permissions`
Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `tracer` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
and in my cargo toml:
[dependencies] clap = { version = "4.5.4", features = ["derive"] } anyhow = "1.0.81" tokio = { version = "1.0.1", features = ["full"] } reqwest = { version = "0.11", features = ["json"] } serde_json = "1.0.64" serde = { version = "1.0.127", features = ["derive"] } config = "0.13" tokio-util = "0.6.8" tokio-tungstenite = "0.13.0" dirs = "3.0" tempfile = "3.10.1" sysinfo = "0.30.11" bstr = "1.9.1" log = "0.4.14" openssl = { version = "0.10", features = ["vendored"] }
But I keep getting deployment issues on windows:
error[E0433]: failed to resolve: could not find unix
in os
Or:
Run taiki-e/upload-rust-binary-action@v1 Run bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
tracer v0.0.56 (/Users/runner/work/tracer-cli/tracer-cli)
does not have the feature vendored-openssl
Error: Process completed with exit code 101.@davincios Your issue sounds like a bug in your code, not an openssl-related problem. Please submit a new issue with complete information (e.g., link to the repository) on the actual code that has the error and a link to full CI/CD logs.
@taiki-e awesome thank you for the quick response. I have opened a new issue with a link to the repository.
That code issue occurs only on Windows builds though still, although I have now reconfigured it. Somehow I cannot solve this openssl-sys v0.9.102 issue.
Here is my new opened issue, I would greatly appreciate any help! 😀
https://github.com/taiki-e/upload-rust-binary-action/issues/76
I am trying to cross-compile a program. There is the matrix of all the values that I defined:
When compiling for Linux, I get the following output below. I tried installing
libssl-dev
in the GitHub action but it does not solve the problem.Any idea how to solve this?
Thanks!