Skip to content

vendored-openssl broken with new resolver #718

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

Closed
extrawurst opened this issue Jun 6, 2021 · 3 comments · Fixed by #719
Closed

vendored-openssl broken with new resolver #718

extrawurst opened this issue Jun 6, 2021 · 3 comments · Fixed by #719

Comments

@extrawurst
Copy link
Contributor

over at gitui a user noted that we start to see openssl as a dylib dependency on macos:

otool -L target/debug/gitui
target/debug/gitui:
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 59754.100.106)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1775.118.101)
	/usr/local/opt/[email protected]/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
	/usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)

no the interesting part is: we use git2 via:

git2 = { version = "0.13", features = ["vendored-openssl"] }

now this worked up until now but started to stop actually vendoring (and therefore not having a dependency on openssl shared objects) since we use resolver = "2".

Now I am wondering is that something about how this feature is implemented or actually a bug in the new resolver ? 😱

see gitui-org/gitui#772 (comment)

@extrawurst
Copy link
Contributor Author

so I dug some more: I was wondering why cargo does not suffer the same issue if I enable the new resolver in there. it seems to be fixable by pinning the openssl crate with its vendoring feature on the top level (in cargo) instead of using git2-rs's feature for it does the trick. The same works in gitui: gitui-org/gitui#772 (comment)

That is just a workaround and means the vendored-ssl feature is rendered useless when using the new resolver.

alexcrichton added a commit to alexcrichton/git2-rs that referenced this issue Jun 7, 2021
Turns out the git2 dependency on openssl-sys was conditional to happen
everywhere but macOS, which means that vendored-openssl didn't work. The
fix here is to forward the feature to the `libgit2-sys` crate which
depends on `openssl-sys` even on macOS.

Closes rust-lang#718
@alexcrichton
Copy link
Member

Ah the fix here is relatively simple I think -- #719 -- and it's just macOS specific because the git2 crate itself conditionally depends on openssl-sys, notably not on macOS

@extrawurst
Copy link
Contributor Author

@alexcrichton ha I totally did not see that! thanks for looking into it ❤️

alexcrichton added a commit that referenced this issue Jun 7, 2021
Turns out the git2 dependency on openssl-sys was conditional to happen
everywhere but macOS, which means that vendored-openssl didn't work. The
fix here is to forward the feature to the `libgit2-sys` crate which
depends on `openssl-sys` even on macOS.

Closes #718
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 a pull request may close this issue.

2 participants