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

exiv2: 0.27.2 -> 0.27.3 #96648

Merged
merged 1 commit into from Sep 4, 2020
Merged

exiv2: 0.27.2 -> 0.27.3 #96648

merged 1 commit into from Sep 4, 2020

Conversation

paperdigits
Copy link
Contributor

@paperdigits paperdigits commented Aug 30, 2020

Motivation for this change

Upgrade exiv2 to the latest released version.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

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

  1. Changes look mostly okay:

  2. It might be possible to remove these two lines:

    export LD_LIBRARY_PATH="$(realpath ../build/lib)"

    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib

    since set LD_LIBRARY_PATH when running tests Exiv2/exiv2#1213 should do that.

  3. Python tests have been run by default for a while now, we can remove:

    postCheck = ''
    (cd ../tests/ && python3 runner.py)
    '';

  4. 🔴 There is a regression in aarch64-linux builds compared to previous update:

    https://github.com/NixOS/nixpkgs/pull/67453/checks?check_run_id=203082000

    Upstream issue: exiv2 0.27.3 fails to build on PPC Exiv2/exiv2#1244
    Upstream pull request fixing that (likely not backportable): cmake/compilerFlags.cmake: properly detect availability of flags Exiv2/exiv2#1252

    Edit: This workaround might work https://github.com/Exiv2/exiv2/commit/1ea63ccb345a4498b41cb8842622ba7ecc9fd484.patch

  5. Could you add a comment that

    # Fix CMake export paths.
    postFixup = ''
    sed -i "$dev/lib/cmake/exiv2/exiv2Config.cmake" \
    -e "/INTERFACE_INCLUDE_DIRECTORIES/ s@\''${_IMPORT_PREFIX}@$dev@" \
    -e "/Compute the installation prefix/ a set(_IMPORT_PREFIX \"$out\")" \
    -e "/^get_filename_component(_IMPORT_PREFIX/ d"
    '';

    (introduced in f1a58ab)

    and

    # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
    # (setting it to an absolute path causes include files to go to $out/$out/include,
    # because the absolute path is interpreted with root at $out).
    "-DCMAKE_INSTALL_INCLUDEDIR=include"
    "-DCMAKE_INSTALL_LIBDIR=lib"

    (introduced in exiv2: fix exiv2.pc file #81091)

    can be removed once cmake: Fix paths with absolute GNUInstallDirs Exiv2/exiv2#1263 is merged?

@paperdigits
Copy link
Contributor Author

@jtojnar thanks for the quick review. I think I've hit every point you've made.

"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
];

patches = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, though it does not seem to work here. Maybe we also need to apply Exiv2/exiv2@dd2d181

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Patch Exiv2/exiv2@dd2d181 doesn't apply cleanly.

Copy link
Contributor

@jtojnar jtojnar Sep 1, 2020

Choose a reason for hiding this comment

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

Yes, the conflict would need to be resolved. (And ideally also send pull request upstream against 0.27-maintenance branch.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how to resolve the conflict and I don't have any arm systems to build against.

Copy link
Contributor

@jtojnar jtojnar Sep 4, 2020

Choose a reason for hiding this comment

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

I have resolved the conflict in Exiv2/exiv2#1271.

Currently verifying it natively on https://github.com/nix-community/aarch64-build-box (nix-build -A exiv2.all --argstr system aarch64-linux) and locally by cross-compiling (nix-shell -A pkgsCross.aarch64-multiplatform.netpbm).

Edit: confirmed that it builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jtojnar looks good!

@paperdigits
Copy link
Contributor Author

@vcunat I think this can be merged! Should take care of the security advisory.

};

patches = [
# included in next release
# Fix aarch64 build
(fetchpatch {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also link the pull request in a comment for easier triage in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

'';

# With CMake we have to enable samples or there won't be
# With CMake we have to enable samples or there won't be
Copy link
Contributor

Choose a reason for hiding this comment

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

This indentation is weird here. Otherwise looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@paperdigits
Copy link
Contributor Author

@jtojnar thanks for the help!

@jtojnar
Copy link
Contributor

jtojnar commented Sep 4, 2020

Thank YOU.

@jtojnar jtojnar merged commit e2a89f8 into NixOS:master Sep 4, 2020
@ckauhaus
Copy link
Contributor

ckauhaus commented Sep 7, 2020

@jtojnar Would it be possible to backport this to 20.03 as it is a security fix? (#88282)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants