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

FreeBSD port / vendor OpenSSL issue #967

Closed
nunotexbsd opened this issue Aug 16, 2022 · 10 comments
Closed

FreeBSD port / vendor OpenSSL issue #967

nunotexbsd opened this issue Aug 16, 2022 · 10 comments
Labels
A-distribution Area: package distribution and installers

Comments

@nunotexbsd
Copy link

Hello,

I'm porting lapce to FreeBSD but ports framework gives me the following warning:

Please make sure this port uses the system OpenSSL and consider removing
CARGO_CRATES=openssl-src-111.21.0+1.1.1p (a vendored copy of OpenSSL) from
the build, e.g., by patching Cargo.toml appropriately.

Is there a way to avoid:

[[package]]
name = "openssl-src"
version = "111.21.0+1.1.1p"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d0a8313729211913936f1b95ca47a5fc7f2e04cd658c115388287f8a8361008"
dependencies = [
 "cc",
]

and use FreeBSD OpenSSL?

Thanks,
Nuno Teixeira

@MinusGix MinusGix added the A-distribution Area: package distribution and installers label Aug 16, 2022
@MinusGix
Copy link
Member

You probably need to mess with features for both https://docs.rs/reqwest/latest/reqwest/ and https://github.com/rust-lang/git2-rs/, which we use and depend on the openssl-src crate. Maybe just reqwest's native-tls feature is needed to be enabled?

@panekj
Copy link
Collaborator

panekj commented Aug 16, 2022

OPENSSL_NO_VENDOR: 1 # don't even try to build without it on musl

this should be just enough

@nunotexbsd
Copy link
Author

I switched to 796008b but it still fetches openssl-src-111.22.0+1.1.1q from cargo.lock and if I remove it:

===>   Updating Cargo.lock
error: no matching package found
searched package name: `openssl-src`
perhaps you meant:      openssl-sys
location searched: registry `crates-io`
required by package `openssl-sys v0.9.75`
    ... which satisfies dependency `openssl-sys = "^0.9.0"` of package `git2 v0.14.4`
    ... which satisfies dependency `git2 = "^0.14.4"` of package `lapce-proxy v0.1.3 (/usr/home/nunotex/Work/freebsd/ports/editors/lapce/work/lapce-796008b/lapce-proxy)`
    ... which satisfies path dependency `lapce-proxy` of package `lapce v0.1.3 (/usr/home/nunotex/Work/freebsd/ports/editors/lapce/work/lapce-796008b)`
*** Error code 101

Any hints?

@panekj
Copy link
Collaborator

panekj commented Aug 16, 2022

It will be fetched no matter what unless you patch out Cargo.toml's to not include any (default) features that can pull in openssl-src and update the lockfile.

@nunotexbsd
Copy link
Author

The only occurrence that I found is: lapce-proxy/Cargo.toml:git2 = { version = "0.14.4", features = ["vendored-openssl"] }.

What should be changed?

@panekj
Copy link
Collaborator

panekj commented Aug 16, 2022

diff --git a/lapce-proxy/Cargo.toml b/lapce-proxy/Cargo.toml
index ac93cbf..f7b2fd5 100644
--- a/lapce-proxy/Cargo.toml
+++ b/lapce-proxy/Cargo.toml
@@ -32,7 +32,7 @@ serde_json = "1.0.59"
 anyhow = "1.0.32"
 home = "0.5.3"
 toml_edit = { version = "0.14.4", features = ["easy"] }
-git2 = { version = "0.14.4", features = ["vendored-openssl"] }
+git2 = { version = "0.14.4", features = [] }
 lapce-core = { path = "../lapce-core" }
 lapce-rpc = { path = "../lapce-rpc" }
 trash = "2.1"

I don't know what's the *bsd ports framework, so you want to run cargo fetch --locked, patch the Cargo.toml then cargo generate-lockfile --offline

@nunotexbsd
Copy link
Author

nunotexbsd commented Aug 16, 2022

Hi,

Ok. I think it's better to build it without removing vendor openssl for now and for better debugging on what's is happening.
I've made a FreeBSD port at PR265892 and there's a url link for build log. I now use poudriere clean environment build tool to make it better for debug.
(Patch for removing vendor openssl is present but not in use.)

What make me to retrocess about removing vendor openssl is because I noticed that there are ports with the same issue like gitui in the port devel/gitui so it is better to take that issue when I have a working/buildable port.

I think you help me enough and I thank you for that because I learned more about rust/cargo mechanics.
It will very nice if you could take a look at PR, patch have comments on it to easier debug.

Cheers,
Nuno Teixeira

@nunotexbsd nunotexbsd changed the title FreeBSD build: vendor OpenSSL FreeBSD port / vendor OpenSSL issue Aug 21, 2022
@nunotexbsd
Copy link
Author

FreeBSD PR: 265892

@panekj
Copy link
Collaborator

panekj commented Sep 13, 2022

I believe this has been resolved

@panekj panekj closed this as completed Sep 13, 2022
@nunotexbsd
Copy link
Author

Hi @panekj!

Yes it is, sorry I forgot to close it.

I'm having troubles adding FreeBSD target to druid, could you please take a look at linebender/druid#2249 when you have the time?

Cheers and thanks for your great help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-distribution Area: package distribution and installers
Projects
None yet
Development

No branches or pull requests

3 participants