#221 Adjust build flags to allow the new implementation using --package-metadata
Closed a year ago by decathorpe. Opened 2 years ago by zbyszek.
fedora-rust/ zbyszek/rust2rpm package-notes-new-version  into  main

file modified
+1 -1
@@ -12,7 +12,7 @@ 

    -Ccodegen-units=%rustflags_codegen_units

    -Clink-arg=-Wl,-z,relro

    -Clink-arg=-Wl,-z,now

-   %{?_package_note_file:-Clink-arg=-Wl,-dT,%{_package_note_file}}

+   %([ 0%{?_package_note_status} -gt 0 ] && echo "-Clink-arg=%_package_note_flags")

    --cap-lints=warn

  }

  

C.f. https://src.fedoraproject.org/rpms/package-notes/pull-request/4.
This version should be compatible with both the old and new definitions
in package-notes-srpm-macros.

Is this the emergency patch that you pushed to the rust-packaging?

Is this new RPM macro syntax backwards compatible with the RPM version on older Fedora branches (and EPEL? or Mageia / OpenSUSE?)? If not, we'll need to take care not to break things there :(

Is this the emergency patch that you pushed to the rust-packaging?

Yep.

Is this new RPM macro syntax backwards compatible with the RPM version on older Fedora branches (and EPEL? or Mageia / OpenSUSE?)? If not, we'll need to take care not to break things there :(

It's compatible with previous release of rpm (4.17), so all versions of Fedora are OK.
I don't know what versions of rpm are present in other distributions… I guess one option would be to allow them to comment out this line if they don't use package notes or the syntax doesn't work for them.

It won't work for anything older than RPM 4.16: https://rpm.org/wiki/Releases/4.16.0#expressions-spec-and-macros

rebased onto 9900d7f

2 years ago

OK, I adjusted it to use %() instead. PTAL.

Can you run test builds in COPR to check whether this works, before we push this to Fedora? :)

Coming back to this: Is this change backwards compatible with older Fedora releases, or should it only be applied on Fedora 37+? What about EPEL 9?

This version should be compatible with both the old and new definitions
in package-notes-srpm-macros.

Meh, I should have read this more carefully. This sounds like it would be safe to merge this PR and still push any new versions of rust2rpm to all current branches of Fedora and EPEL 9?

This is still not compatible with anything older than RPM 4.16, as %[...] was introduced in that release.

The current downstream patch in Fedora is this one:
https://src.fedoraproject.org/rpms/rust-packaging/blob/rawhide/f/0001-Adjust-build-flags-to-allow-the-new-implementation-u.patch

Is that better? Or worse? At least the downstream patch is tested to work on Fedora 37+ ... and this PR wasn't.

Merged here: https://pagure.io/fedora-rust/rust-packaging/c/4af0bbcb54aa6f4eb428a7966f602fa9b2437023?branch=main

All current branches of Fedora and even RHEL 9 have RPM 4.16, so I don't see a problem with using this syntax.

Pull-Request has been closed by decathorpe

a year ago
Metadata