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

hspell: Add zlib #369595

Merged
merged 1 commit into from
Dec 31, 2024
Merged

hspell: Add zlib #369595

merged 1 commit into from
Dec 31, 2024

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Dec 31, 2024

As mentioned by the configure script output, hspell will fall back
on using gzip program when not linked against zlib:

No Zlib library, defaulting to using pipes

It has been removed in 67f0a21 for some reason.

Without this patch, Geary is stuck loading messages, even though I can interact
with the rest of its UI. I am also getting the following in the log so broken
piping might be breaking webkitgtk for some reason:

Hspell: can't run gzip -dc '/nix/store/14qk9r9ywvpqn0a24fvw1iwjv302d04j-hspell-1.4/share/hspell/hebrew.wgz.prefixes'.
Could not create GBM EGL display: EGL_NOT_INITIALIZED. Aborting...

And after quitting Geary:

*[wrn] 18:29:13.0226 geary:application-client.vala:464: Forcing shutdown of Geary, 7s passed...
gzip:
gzip: stdout: Broken pipe
stdout: Broken pipe

cc @kampka @uninsane

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@kampka
Copy link
Contributor

kampka commented Dec 31, 2024

I gave up on making nixpkgs work nicely when building cross-platform, feel free to revert 67f0a21

@uninsane
Copy link
Contributor

thanks for catching that. might need some tweaks to keep cross-compilation working though:

$ git fetch upstream pull/369595/head:pr-369595
$ git switch pr-369595
$ nix-build -A pkgsCross.aarch64-multiplatform.hspell
...
/nix/store/xcn9p4xxfbvlkpah7pwchpav4ab9d135-gcc-wrapper-14-20241116/bin/cc -c -g -O2  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_INTPTR_T=1 -DHAVE_ZLIB=1 -DDICTIONARY_BASE=\"/nix/store/lfaqm62r958izwxsh7d52nzl529j7glz-hspell-1.4-aarch64-unknown-linux-gnu/share/hspell/hebrew.wgz\" dict_radix.c
In file included from dict_radix.c:34:
gzbuffered.h:30:10: fatal error: zlib.h: No such file or directory
   30 | #include <zlib.h>
      |          ^~~~~~~~
compilation terminated.
make: *** [Makefile:73: dict_radix.o] Error 1
error: builder for '/nix/store/vydr2z1scvk0vh4hqhp71d4r3sx613p9-hspell-1.4-aarch64-unknown-linux-gnu.drv' failed with exit code 2;

@uninsane
Copy link
Contributor

this fixes cross compilation again.

   patches = [ ./remove-shared-library-checks.patch ];
   postPatch = "patchShebangs .";
   preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
-    make CC=${buildPackages.stdenv.cc}/bin/cc find_sizes
+    make CC='${buildPackages.stdenv.cc}/bin/cc -I${lib.getDev buildPackages.zlib}/include -L${buildPackages.zlib}/lib' find_sizes
     mv find_sizes find_sizes_build
     make clean

i don't know enough about the existing preBuild component to say if this is a good fix, but the result links against zlib so it's probably alright.

@jtojnar
Copy link
Member Author

jtojnar commented Dec 31, 2024

Thanks. Incorporated your fix.

Also confirmed (going back and forth between the version built against this and the one from nixos-unstable) that this appears to fix the Geary’s weird freeze (well, I could interact with the UI, but the messages were stuck loading) and the following is no longer output into the console:

$ geary
Hspell: can't run gzip -dc '/nix/store/rj33i89v9r2kpdhv3783ajf6dk0nxhii-hspell-1.4/share/hspell/hebrew.wgz.prefixes'.
Hspell: can't run gzip -dc '/nix/store/rj33i89v9r2kpdhv3783ajf6dk0nxhii-hspell-1.4/share/hspell/hebrew.wgz.prefixes'.
Could not create GBM EGL display: EGL_NOT_INITIALIZED. Aborting...
*[wrn] 18:29:13.0226 geary:application-client.vala:464: Forcing shutdown of Geary, 7s passed...
$ 
gzip: 
gzip: stdout: Broken pipe
stdout: Broken pipe

Looks like the gzip failure was breaking webkitgtk process.

As mentioned by the configure script output, hspell will fall back
on using `gzip` program when not linked against `zlib`:

    No Zlib library, defaulting to using pipes

It has been removed in 67f0a21 for some reason.

Without this patch, Geary is stuck loading messages, even though I can interact
with the rest of its UI. I am also getting the following in the log so broken
piping might be breaking webkitgtk for some reason:

    Hspell: can't run gzip -dc '/nix/store/14qk9r9ywvpqn0a24fvw1iwjv302d04j-hspell-1.4/share/hspell/hebrew.wgz.prefixes'.
    Could not create GBM EGL display: EGL_NOT_INITIALIZED. Aborting...

And after quitting Geary:

    *[wrn] 18:29:13.0226 geary:application-client.vala:464: Forcing shutdown of Geary, 7s passed...
    gzip:
    gzip: stdout: Broken pipe
    stdout: Broken pipe

Co-authored-by: Colin <[email protected]>
@jtojnar jtojnar merged commit ad3be32 into NixOS:staging Dec 31, 2024
31 of 32 checks passed
@jtojnar jtojnar deleted the hspell-zlib branch December 31, 2024 19:01
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.

3 participants