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

libjxl: init at 2021-06-22-409efe02 (jpeg-xl reference implementation) #103160

Merged
merged 2 commits into from Jun 26, 2021

Conversation

nh2
Copy link
Contributor

@nh2 nh2 commented Nov 8, 2020

Motivation for this change

Packages the JPEG XL reference implementation: jpeg-xl.

I start this as a draft PR because:

  • need to fix that their git submodule setup is currently broken (https://gitlab.com/wg1/jpeg-xl/-/issues/57), so src is from my fork.
  • I'm not sure I want to be maintainer for it, would be nice if somebody else would step up.

Also I'm PRing it against 20.09 to make it easy to test, of course it'll have to be rebased against master for the final PR.

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.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/packages-looking-for-a-maintainer/5442/5

pkgs/development/libraries/jpeg-xl/default.nix Outdated Show resolved Hide resolved
Comment on lines 56 to 57
cmakeFlags = [
];
Copy link
Member

Choose a reason for hiding this comment

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

Is this meant to be empty?

Copy link
Contributor Author

@nh2 nh2 Nov 8, 2020

Choose a reason for hiding this comment

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

I kept it empty for now just to make clear to whoever would like to step up for maintenance that this is a cmake bulid and that this is where options would go.

We might for example be interested in these: https://gitlab.com/wg1/jpeg-xl/-/blob/4d70bd58fbcb758b61446aba447fedd9177a00c9/CMakeLists.txt#L98-104

set(JPEGXL_FORCE_SYSTEM_GTEST false CACHE BOOL
    "Force using system installed googletest (gtest/gmock) instead of third_party/googletest source.")
set(JPEGXL_FORCE_SYSTEM_BROTLI false CACHE BOOL
    "Force using system installed brotli instead of third_party/brotli source.")
set(JPEGXL_FORCE_SYSTEM_HWY false CACHE BOOL
    "Force using system installed highway (libhwy-dev) instead of third_party/highway source.")

if we want it to use our system libs (but I'm also OK with it using its submodule libs, as I'm not sure if jpeg-xl often patches them).

If we find we need to cmakeFlags, we can of course remove that empty list. I've removed it now, we can add it back when needed.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should use system libs if they are available or add a comment to use them in the future except if they are heavily patched.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine by me, but then we first need to have a good look into whether they changed important stuff or not.

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've added a comment.

pkgs/development/libraries/jpeg-xl/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/jpeg-xl/default.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Nov 11, 2020

Result of nixpkgs-review pr 103160 run on x86_64-darwin 1

1 package failed to build:
  • jpeg-xl
/tmp/nix-build-jpeg-xl-2020-10-29-8f2e0857.drv-0/jpeg-xl-8f2e085/lib/extras/codec_apng.cc:222:13: error: use of undeclared identifier 'fmemopen'; did you mean 'freopen'?
  if (!(f = fmemopen((void*)bytes.data(), bytes.size(), "rb"))) {
            ^~~~~~~~
            freopen
/nix/store/h144jawqa92rqjhaahrsikq5j2dwkh5n-Libsystem-osx-10.12.6/include/stdio.h:248:7: note: 'freopen' declared here
FILE    *freopen(const char * __restrict, const char * __restrict,
         ^
/tmp/nix-build-jpeg-xl-2020-10-29-8f2e0857.drv-0/jpeg-xl-8f2e085/lib/extras/codec_apng.cc:222:22: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'void *'
  if (!(f = fmemopen((void*)bytes.data(), bytes.size(), "rb"))) {
                     ^~~~~~~~~~~~~~~~~~~
/nix/store/h144jawqa92rqjhaahrsikq5j2dwkh5n-Libsystem-osx-10.12.6/include/stdio.h:248:38: note: passing argument to parameter here
FILE    *freopen(const char * __restrict, const char * __restrict,
                                        ^
2 errors generated.
make[2]: *** [lib/CMakeFiles/jxl_extras-static.dir/build.make:160: lib/CMakeFiles/jxl_extras-static.dir/extras/codec_apng.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1180: lib/CMakeFiles/jxl_extras-static.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 103160 run on x86_64-linux 1

1 package failed to build:
  • jpeg-xl
hash mismatch in fixed-output derivation '/nix/store/05w2idsr1j896cjaxnd2hwiwk1sfq3hb-jpeg-xl-131953a':
  wanted: sha256:09vp73wqrhflv26xbikcpiw2bb37ffgc3skggpwycdcswn919m85
  got:    sha256:10xaqnmw48sz274m1gf2762xpy0sd453mmh10j8j432wx14y2pss
cannot build derivation '/nix/store/mrwwq6vfk4kikw7z8yjqx7zmrjj49a5j-jpeg-xl-2020-11-10-131953af.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ama94bv01n0bh6fdk1a4l7ls6y5j3phj-env.drv': 1 dependencies couldn't be built

@stale
Copy link

stale bot commented Jun 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 22, 2021
@nh2 nh2 changed the base branch from release-20.09 to master June 22, 2021 16:41
@nh2
Copy link
Contributor Author

nh2 commented Jun 22, 2021

Hmm, I just updated this, but now noticed that they moved from Gitlab to Github and renamed the project from jpeg-xl to libjxl:

https://gitlab.com/wg1/jpeg-xl/-/issues/245

@nh2 nh2 changed the title jpeg-xl: init at 2020-10-29-8f2e0857 libjxl: init at 2021-06-22-409efe02 (jpeg-xl reference implementation) Jun 22, 2021
@nh2
Copy link
Contributor Author

nh2 commented Jun 22, 2021

ofborg says

@ofborg ofborg-eval — Complete, with errors

But it doesn't seem to post where I can read those errors.

@nh2
Copy link
Contributor Author

nh2 commented Jun 22, 2021

@ofborg ofborg-eval — Complete, with errors

But it doesn't seem to post where I can read those errors.

Apparently I had to look at the sibling github check ofborg-eval-package-list-no-aliases, which was failed, and contained:

warning: ignoring the user-specified setting 'restrict-eval', because it is a restricted setting and you are not a trusted user
error: while evaluating 'callPackageWith' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-2/lib/customisation.nix:117:35, called from /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-2/pkgs/top-level/all-packages.nix:16622:12:
while evaluating 'makeOverridable' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-2/lib/customisation.nix:67:24, called from /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-2/lib/customisation.nix:121:8:
anonymous function at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-2/pkgs/development/libraries/libjxl/default.nix:1:1 called without required argument 'pkgconfig', at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/ofborg-evaluator-2/lib/customisation.nix:69:16

According to @sternenseemann this means:

it doesn't evaluate with aliases turned off because pkgconfig is not the proper package name anymore, but an alias. you should use pkg-config with a dash instead

@nh2
Copy link
Contributor Author

nh2 commented Jun 22, 2021

aarch64-linux fails with:

In file included from /build/source/third_party/skcms/skcms.cc:2071:
/build/source/third_party/skcms/src/Transform_inl.h:619:25: internal compiler error: in instantiate_decl, at cp/pt.c:24602
  619 |     return cast<F>(lo|hi) * (1/65535.0f);
      |                         ^
Please submit a full bug report,

Reported at: libjxl/libjxl#213

@nh2
Copy link
Contributor Author

nh2 commented Jun 22, 2021

Ready to merge from my side.

For the internal compiler error failure on aarch64-linux failure in #103160 (comment), should I disable that arch, or leave it on so we can see if a future compiler upgrade will auto-fix it?

@SuperSandro2000
Copy link
Member

For the internal compiler error failure on aarch64-linux failure in #103160 (comment), should I disable that arch, or leave it on so we can see if a future compiler upgrade will auto-fix it?

Marking it broken saves hydra resources.

@nh2
Copy link
Contributor Author

nh2 commented Jun 23, 2021

Marking it broken saves hydra resources.

@SuperSandro2000 Thanks! Done.

@SuperSandro2000 SuperSandro2000 merged commit 85ff485 into NixOS:master Jun 26, 2021
nh2 added a commit to nh2/nixpkgs that referenced this pull request Nov 18, 2021
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

4 participants