Bug 2314879 - Rust 1.81+ implicitly / automatically sets soname on cdylib targets
Summary: Rust 1.81+ implicitly / automatically sets soname on cdylib targets
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rust
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Josh Stone
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-09-26 11:59 UTC by Fabio Valentini
Modified: 2024-10-12 01:51 UTC (History)
7 users (show)

Fixed In Version: rust-1.81.0-4.fc42 rust-1.81.0-4.fc41 rust-1.81.0-4.fc40 rust-1.81.0-4.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-10-08 02:02:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rust-lang rust pull 126094 0 None Merged linker: Link dylib crates by path 2024-09-26 19:33:56 UTC
Github rust-lang rust pull 130960 0 None Merged Only add an automatic SONAME for Rust dylibs 2024-10-08 23:58:27 UTC
Red Hat Issue Tracker FC-1316 0 None None None 2024-10-10 05:17:29 UTC

Description Fabio Valentini 2024-09-26 11:59:28 UTC
Description of problem:
=======================

We found that recent builds of Python modules with "native" Rust cores (i.e. using PyO3, built with setuptools_rust or maturin) started getting RPM provides for their soname, which is not intended or wanted.

Looking back through build logs (and trying to build with older versions of maturin), we determined that the only likely suspect responsible for this change is the update from Rust 1.80 to 1.81, and that something in the build process is now setting the SONAME header in cdylib targets where previously this didn't happen without *explcitly* doing so (via build.rs script or external tools).

This causes RPM to improperly generate Provides for this shared object / .so file where previously no such metadata was added automatically. Looking at other Python packages that ship native modules, having an SONAME ELF header set is not expected for .so files like this, since they are *dynamically loadable plugins* and not expected to be linked with at all.

Version-Release number of selected component (if applicable):
=============================================================

"good": rust-1.80.1-1.fc41
"bad":  rust-1.81.0-1.fc42

How reproducible:
=================

These packages all appear to be affected:

- python-cramjam
- python-cryptography
- python-nh3
- python-orjson
- python-pendulum
- python-pydantic-core
- python-rpds-py
- python-watchfiles

Builds with Rust 1.80 did *not* have an SOANME ELF header, but builds with Rust 1.81 do.

Steps to Reproduce:
===================

1. build one of the affected packages with Rust 1.81 on Fedora (Rawhide)
2. see soname being set, and RPM generating Provides for the shared object, i.e. like "Provides: libcryptography_rust.so()(64bit)"

Actual results:
===============

The SONAME elf header is implicitly / automatically set

Expected results:
=================

The SONAME elf header is *not* implicitly / automatically set, and continues to require the user to use a build.rs script to do this ("rustc-cdylib-link-arg"), use the "cdylib-link-lines" crate, or use the cargo-c tool.

Additional info:
================

Making it easier to set the SONAME of cdylib .so objects produced by rustc / cargo is welcome, but this looks like an unintentional behaviour change instead.

Comment 1 Ben Beasley 2024-09-26 12:09:09 UTC
The following commit looks like it *could* be responsible:

- It was first released in Rust 1.81
- It contains changes to shared-library/dylib linking, including SONAMEs

https://github.com/rust-lang/rust/commit/565ddfb48ca2a3b24236c2b393ec14eb86d64a7a

Comment 2 Fedora Update System 2024-10-03 14:50:11 UTC
FEDORA-2024-f5e48710f6 (rust-1.81.0-4.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f5e48710f6

Comment 3 Fedora Update System 2024-10-03 14:50:11 UTC
FEDORA-2024-f353abeb4a (rust-1.81.0-4.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f353abeb4a

Comment 4 Fedora Update System 2024-10-04 01:40:56 UTC
FEDORA-2024-f353abeb4a has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f353abeb4a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f353abeb4a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2024-10-04 02:18:29 UTC
FEDORA-2024-70c557d9af has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-70c557d9af`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-70c557d9af

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2024-10-04 02:56:52 UTC
FEDORA-2024-f5e48710f6 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f5e48710f6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f5e48710f6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2024-10-08 02:02:27 UTC
FEDORA-2024-f5e48710f6 (rust-1.81.0-4.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2024-10-12 01:41:24 UTC
FEDORA-2024-f353abeb4a (rust-1.81.0-4.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2024-10-12 01:51:48 UTC
FEDORA-2024-70c557d9af (rust-1.81.0-4.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.