Skip to content

Create binutils 2.38 holdback set of releases#187972

Merged
trofi merged 2 commits intoNixOS:masterfrom
trofi:binutils-2.38-holdback
Aug 24, 2022
Merged

Create binutils 2.38 holdback set of releases#187972
trofi merged 2 commits intoNixOS:masterfrom
trofi:binutils-2.38-holdback

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Aug 23, 2022

Description of changes

binutils-2.39 will be a disruptive release: #185297.
It changes disassembly API and broke perf for all old linux releases. We will need to hold
back old release until all dependencies are ported to 2.39.

This change introduces held back release of libbfd and libopcodes. It's a copy of current
binutils release.

The plan is to pin all to-be-broken packages to this 2.38 release.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Having all 3 of binutils, libbfd, libopcodes in one directory eases
copying of the whole directory when we need to hold back old version of
the whole of binutils or of it's pieces.
@trofi trofi mentioned this pull request Aug 23, 2022
13 tasks
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Aug 23, 2022
@ofborg ofborg bot requested review from Ericson2314 and lovesegfault August 23, 2022 07:09
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Aug 23, 2022
@trofi
Copy link
Contributor Author

trofi commented Aug 23, 2022

Example use case is bpftools:

build failure:

error: builder for '/nix/store/vgxg4zvgcifm80q1zmiamwkkb45fjf4m-bpftools-5.19.2.drv' failed with exit code 2;
       last 10 log lines:
       >       |             ^~~~~~~~~~~~~~~~~~~~~
       > jit_disasm.c:105:17: error: too few arguments to function 'init_disassemble_info'
       >   105 |                 init_disassemble_info(&info, stdout,
       >       |                 ^~~~~~~~~~~~~~~~~~~~~

Example fix:

--- a/pkgs/os-specific/linux/bpftools/default.nix
+++ b/pkgs/os-specific/linux/bpftools/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv
-, libopcodes, libbfd, elfutils, readline
+, libopcodes_2_38, libbfd_2_38, elfutils, readline
 , linuxPackages_latest, zlib
 , python3, bison, flex
 }:
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   inherit (linuxPackages_latest.kernel) version src;

   nativeBuildInputs = [ python3 bison flex ];
-  buildInputs = [ libopcodes libbfd elfutils zlib readline ];
+  buildInputs = [ libopcodes_2_38 libbfd_2_38 elfutils zlib readline ];

   preConfigure = ''
     patchShebangs scripts/bpf_doc.py

@trofi trofi force-pushed the binutils-2.38-holdback branch from 6406e9c to a622084 Compare August 23, 2022 07:50
@trofi trofi marked this pull request as draft August 23, 2022 08:23
@trofi
Copy link
Contributor Author

trofi commented Aug 23, 2022

Needs headers fixes

2.39 has an API breakage that will take users some time to migrate.
Create _2_38 versions to allow them to hand on an old version for a
while.
@trofi trofi force-pushed the binutils-2.38-holdback branch from a622084 to 7fe41f9 Compare August 23, 2022 20:13
@trofi trofi marked this pull request as ready for review August 23, 2022 20:18
@trofi
Copy link
Contributor Author

trofi commented Aug 23, 2022

Tested this change on binutils-2.39 branch by pinning linuxPackages.perf and bpftools to old binutils libraries. Both built successfully.

Ready for review.

Copy link
Member

@lovesegfault lovesegfault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for all the work trofi

@trofi trofi merged commit 8329438 into NixOS:master Aug 24, 2022
@trofi trofi deleted the binutils-2.38-holdback branch August 24, 2022 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants