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

Load libsecret by its SONAME, libsecret-1.so.0 #13927

Merged
merged 1 commit into from
May 20, 2024

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented May 17, 2024

The library name libsecret-1.so is only found in -dev or -devel packages on many distros, and it's usually only a symlink. For example, this is what I have on Fedora:

/usr/lib64/libsecret-1.so -> libsecret-1.so.0
/usr/lib64/libsecret-1.so.0 -> libsecret-1.so.0.0.0
/usr/lib64/libsecret-1.so.0.0.0

$ rpm -qf /usr/lib64/libsecret*
libsecret-devel-0.21.4-2.fc40.x86_64
libsecret-0.21.4-2.fc40.x86_64
libsecret-0.21.4-2.fc40.x86_64

The middle libsecret-1.so.0 filename matches the actual SONAME in the library, which you can see with readelf -d, and this is what programs built directly against this library will use. It's a better choice for dynamic loaders too, so devel packages aren't needed.

The library name `libsecret-1.so` is only found in `-dev` or `-devel`
packages on many distros, and it's usually only a symlink. For example,
this is what I have on Fedora:

    /usr/lib64/libsecret-1.so -> libsecret-1.so.0
    /usr/lib64/libsecret-1.so.0 -> libsecret-1.so.0.0.0
    /usr/lib64/libsecret-1.so.0.0.0

    $ rpm -qf /usr/lib64/libsecret*
    libsecret-devel-0.21.4-2.fc40.x86_64
    libsecret-0.21.4-2.fc40.x86_64
    libsecret-0.21.4-2.fc40.x86_64

The middle `libsecret-1.so.0` filename matches the actual `SONAME` in
the library, which you can see with `readelf -d`, and this is what
programs built directly against this library will use. It's a better
choice for dynamic loaders too, so devel packages aren't needed.
@rustbot
Copy link
Collaborator

rustbot commented May 17, 2024

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-credential-provider Area: credential provider for storing and retreiving credentials S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 17, 2024
@cuviper
Copy link
Member Author

cuviper commented May 17, 2024

I see that #12518 was tested on Arch -- its libsecret is all one package for devel and runtime.

@weihanglo
Copy link
Member

Just check ArchLinux and yes it should be compatible.

[root@5dbfc70bf9f7 lib]# ls -l /usr/lib/libsecret*
lrwxrwxrwx 1 root root     16 Feb 23 18:02 /usr/lib/libsecret-1.so -> libsecret-1.so.0
lrwxrwxrwx 1 root root     20 Feb 23 18:02 /usr/lib/libsecret-1.so.0 -> libsecret-1.so.0.0.0
-rwxr-xr-x 1 root root 383008 Feb 23 18:02 /usr/lib/libsecret-1.so.0.0.0
[root@5dbfc70bf9f7 lib]# readelf -d /usr/lib/libsecret-1.so | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libsecret-1.so.0]

We should have some container tests for this dlopen integration (and credential providers in general), though no need to block this PR.

@weihanglo
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented May 20, 2024

📌 Commit 4ee7b9c has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2024
@bors
Copy link
Collaborator

bors commented May 20, 2024

⌛ Testing commit 4ee7b9c with merge bb6e446...

@bors
Copy link
Collaborator

bors commented May 20, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing bb6e446 to master...

@bors bors merged commit bb6e446 into rust-lang:master May 20, 2024
21 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request May 22, 2024
Update cargo

9 commits in 0de7f2ec6c39d68022e6b97a39559d2f4dbf3930..84dc5dc11a9007a08f27170454da6097265e510e
2024-05-17 16:54:54 +0000 to 2024-05-20 18:57:08 +0000
- Fix warning about unused Permissions (rust-lang/cargo#13938)
- fix: support IPv6-only network for cargo fix (rust-lang/cargo#13907)
- Load `libsecret` by its `SONAME`, `libsecret-1.so.0` (rust-lang/cargo#13927)
- docs(ref): Simplify check-cfg build.rs docs (rust-lang/cargo#13937)
- Make `git::use_the_cli` test truly locale independent (rust-lang/cargo#13935)
- Silence warnings running embedded unittests. (rust-lang/cargo#13929)
- Fix warning output in build_with_symlink_to_path_dependency_with_build_script_in_git (rust-lang/cargo#13930)
- Fix:  Make path dependencies with the same name stays locked (rust-lang/cargo#13572)
- Temporarily fix standard_lib tests on linux. (rust-lang/cargo#13931)

r? ghost
@rustbot rustbot added this to the 1.80.0 milestone May 22, 2024
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 24, 2024
Update cargo

9 commits in 0de7f2ec6c39d68022e6b97a39559d2f4dbf3930..84dc5dc11a9007a08f27170454da6097265e510e
2024-05-17 16:54:54 +0000 to 2024-05-20 18:57:08 +0000
- Fix warning about unused Permissions (rust-lang/cargo#13938)
- fix: support IPv6-only network for cargo fix (rust-lang/cargo#13907)
- Load `libsecret` by its `SONAME`, `libsecret-1.so.0` (rust-lang/cargo#13927)
- docs(ref): Simplify check-cfg build.rs docs (rust-lang/cargo#13937)
- Make `git::use_the_cli` test truly locale independent (rust-lang/cargo#13935)
- Silence warnings running embedded unittests. (rust-lang/cargo#13929)
- Fix warning output in build_with_symlink_to_path_dependency_with_build_script_in_git (rust-lang/cargo#13930)
- Fix:  Make path dependencies with the same name stays locked (rust-lang/cargo#13572)
- Temporarily fix standard_lib tests on linux. (rust-lang/cargo#13931)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-credential-provider Area: credential provider for storing and retreiving credentials S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants