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

Cannot build 32-bit json-glib on machine with large XFS filesystem #68241

Closed
ivan opened this issue Sep 7, 2019 · 10 comments
Closed

Cannot build 32-bit json-glib on machine with large XFS filesystem #68241

ivan opened this issue Sep 7, 2019 · 10 comments
Assignees
Labels
0.kind: bug Something is broken

Comments

@ivan
Copy link
Member

ivan commented Sep 7, 2019

Describe the bug

On a build machine with a 4TB XFS filesystem, I am unable to build steam and appimage-run because the x86_32 build of json-glib fails:

unpacking sources
unpacking source archive /nix/store/0shi8pwxy8wbsdffg6j4kys8sigr221a-json-glib-1.4.4.tar.xz
source root is json-glib-1.4.4
setting SOURCE_DATE_EPOCH to timestamp 1537218756 of file json-glib-1.4.4/po/zh_TW.po
patching sources
configuring
meson flags: --buildtype=plain         --libdir=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4/lib --libexecdir=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4/libexec         --bindir=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4/bin --sbindir=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4/sbin         --includedir=/nix/store/ghjwchh5mpblxlfq16j2r5aw415va49g-json-glib-1.4.4-dev/include         --mandir=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4/share/man --infodir=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4/share/info         --localedir=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4/share/locale         -Dauto_features=enabled         -Dwrap_mode=nodownload         --prefix=/nix/store/i6mxfcmvlyi3cc367zfiv3cacbkqmlkd-json-glib-1.4.4
The Meson build system
Version: 0.51.2
Source dir: /build/json-glib-1.4.4
Build dir: /build/json-glib-1.4.4/build
Build type: native build
DEPRECATION: Duplicated values in array option is deprecated. This will become a hard error in the future.
DEPRECATION: Duplicated values in array option is deprecated. This will become a hard error in the future.
DEPRECATION: Duplicated values in array option is deprecated. This will become a hard error in the future.
Project name: json-glib
Project version: 1.4.4
C compiler for the host machine: /nix/store/5bvkmq6s0inz0by1racif1jpr2gi7win-gcc-wrapper-7.4.0/bin/cc (gcc 7.4.0 "gcc (GCC) 7.4.0")
DEPRECATION: Duplicated values in array option is deprecated. This will become a hard error in the future.
Build machine cpu family: x86
Build machine cpu: i686
Found pkg-config: /nix/store/6qscilmrkibizn5rnvjqs19xa53lkxzr-pkg-config-0.29.2/bin/pkg-config (0.29.2)
Run-time dependency gobject-2.0 found: YES 2.60.6
Run-time dependency gio-2.0 found: YES 2.60.6
Has header "unistd.h" : YES
Compiler for C supports arguments -Wcast-align: YES
Compiler for C supports arguments -Wlogical-op: YES
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wmissing-noreturn: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wunused: YES
Compiler for C supports arguments -Wno-discarded-qualifiers -Wdiscarded-qualifiers: YES
Compiler for C supports arguments -Wno-int-conversion -Wint-conversion: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Compiler for C supports arguments -Wno-uninitialized -Wuninitialized: YES
Compiler for C supports arguments -Werror=address: YES
Compiler for C supports arguments -Werror=array-bounds: YES
Compiler for C supports arguments -Werror=empty-body: YES
Compiler for C supports arguments -Werror=format=2: YES
Compiler for C supports arguments -Werror=implicit: YES
Compiler for C supports arguments -Werror=init-self: YES
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES
Compiler for C supports arguments -Werror=main: YES
Compiler for C supports arguments -Werror=missing-braces: YES
Compiler for C supports arguments -Werror=nested-externs: YES
Compiler for C supports arguments -Werror=nonnull: YES
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=sequence-point: YES
Compiler for C supports arguments -Werror=trigraphs: YES
Compiler for C supports arguments -Werror=undef: YES
Compiler for C supports arguments -Werror=write-strings: YES
Compiler for C supports arguments -fvisibility=hidden: YES
WARNING: -Wl,-Bsymbolic looks like a linker argument, but has_argument and other similar methods only support checking compiler arguments. Using them to check linker arguments are never supported, and results are likely to be wrong regardless of the compiler you are using. has_link_argument or other similar method can be used instead.
Compiler for C supports arguments -Wl,-Bsymbolic: YES
WARNING: -Wl,-z,relro looks like a linker argument, but has_argument and other similar methods only support checking compiler arguments. Using them to check linker arguments are never supported, and results are likely to be wrong regardless of the compiler you are using. has_link_argument or other similar method can be used instead.
Compiler for C supports arguments -Wl,-z,relro: YES
WARNING: -Wl,-z,now looks like a linker argument, but has_argument and other similar methods only support checking compiler arguments. Using them to check linker arguments are never supported, and results are likely to be wrong regardless of the compiler you are using. has_link_argument or other similar method can be used instead.
Compiler for C supports arguments -Wl,-z,now: YES
DEPRECATION: Project targetting '>= 0.40.1' but tried to use feature deprecated since '0.48.0': python3 module
Configuring config.h using configuration
WARNING: Project targetting '>= 0.40.1' but tried to use feature introduced in '0.50.0': install arg in configure_file
Configuring json-version.h using configuration
Program g-ir-scanner found: YES (/nix/store/kdssb3fp08mwrmwx5ywb0xylyk081afr-gobject-introspection-1.60.2-dev/bin/g-ir-scanner)
Found pkg-config: /nix/store/6qscilmrkibizn5rnvjqs19xa53lkxzr-pkg-config-0.29.2/bin/pkg-config (0.29.2)
Configuring gtkdocentities.ent using configuration
Run-time dependency glib-2.0 found: YES 2.60.6
Program xsltproc found: NO
Build targets in project: 38
WARNING: Project specifies a minimum meson_version '>= 0.40.1' but uses features which were added in newer versions:
 * 0.50.0: {'install arg in configure_file'}
WARNING: Deprecated features used:
 * 0.48.0: {'python3 module'}
Option buildtype is: plain [default: debugoptimized]
Found ninja-1.9.0 at /nix/store/jcvllscc3xg69dr7iy7vn35i2kc60jlw-ninja-1.9.0/bin/ninja
ninja: error: loading 'build.ninja': Value too large for defined data type
WARNING: Could not create compilation database.
meson: enabled parallel building
building
build flags: -j8 -l8
ninja: error: loading 'build.ninja': Value too large for defined data type
builder for '/nix/store/pira4wrp4v20qwaphf8gsq5ygy27wy8v-json-glib-1.4.4.drv' failed with exit code 1

I believe this is because of a ninja problem related to 64-bit inodes: ninja-build/ninja#829

On another machine with a 1TB XFS filesystem, the build succeeds.

To Reproduce
Steps to reproduce the behavior:

  1. On a machine with a large XFS filesystem (= 64-bit inodes), run:
    nix-build --builders '' https://github.com/NixOS/nixpkgs/archive/master.tar.gz --argstr system i686-linux -A json-glib
    
  2. Observe:
...
Build targets in project: 38
WARNING: Project specifies a minimum meson_version '>= 0.40.1' but uses features which were added in newer versions:
 * 0.50.0: {'install arg in configure_file'}
WARNING: Deprecated features used:
 * 0.48.0: {'python3 module'}
Option buildtype is: plain [default: debugoptimized]
Found ninja-1.9.0 at /nix/store/jcvllscc3xg69dr7iy7vn35i2kc60jlw-ninja-1.9.0/bin/ninja
ninja: error: loading 'build.ninja': Value too large for defined data type
WARNING: Could not create compilation database.
meson: enabled parallel building
building
build flags: -j8 -l8
ninja: error: loading 'build.ninja': Value too large for defined data type
builder for '/nix/store/pira4wrp4v20qwaphf8gsq5ygy27wy8v-json-glib-1.4.4.drv' failed with exit code 1
error: build of '/nix/store/pira4wrp4v20qwaphf8gsq5ygy27wy8v-json-glib-1.4.4.drv' failed

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.19.65-hardened, NixOS, 19.09.git.4816fb0 (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@ivan ivan added the 0.kind: bug Something is broken label Sep 7, 2019
@jtojnar
Copy link
Member

jtojnar commented Sep 7, 2019

Does the fix suggested in the issue work? Something like the following:

--- a/pkgs/development/tools/build-managers/ninja/default.nix
+++ b/pkgs/development/tools/build-managers/ninja/default.nix
@@ -49,6 +49,13 @@
 
   setupHook = ./setup-hook.sh;
 
+  # fix builds on x86_32 with LFS
+  # https://github.com/NixOS/nixpkgs/issues/68241
+  NIX_CFLAGS_COMPILE = optionals (stdenv.hostPlatform.system == "i686-linux") [
+    "-D_LARGEFILE_SOURCE"
+    "-D_FILE_OFFSET_BITS=64"
+  ];
+
   meta = {
     description = "Small build system with a focus on speed";
     longDescription = ''

@ivan
Copy link
Member Author

ivan commented Sep 7, 2019

I tried both glensc/ninja-build@038593e and your fix, and they both somehow break ninja:

# /nix/store/a02ryg2b2ap4x6i17hjs8plfgzri2whl-ninja-1.9.0/bin/ninja
/nix/store/a02ryg2b2ap4x6i17hjs8plfgzri2whl-ninja-1.9.0/bin/ninja: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@YellowOnion
Copy link
Contributor

Any updates on fixing this?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 18, 2021
@stale
Copy link

stale bot commented Nov 16, 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 Nov 16, 2021
@ajs124
Copy link
Member

ajs124 commented Jan 15, 2022

I've recently started running into this issue with a bunch of builds, e.h. systemd and gtk3 and @jtojnar's patch seems to fix it.

I'll open a PR with it in the next days, if nobody here has any problem with that or wants to do that themselves.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 15, 2022
@ajs124
Copy link
Member

ajs124 commented Jan 15, 2022

Nevermind. With this, pkgsi686Linux.wayland fails to build like this:

Option buildtype is: plain [default: debugoptimized]                                                                                                                                  
Found ninja-1.10.2 at /nix/store/zlmwizbfpiv03syam0gii1z62gmlwrbp-ninja-1.10.2/bin/ninja                                                                                              
meson: enabled parallel building                                                           
building                                                                                   
build flags: -j64 -l64                                                                     
[1/107] Generating wayland-architecture.png with a custom command.c.or.c.o output)
FAILED: doc/doxygen/xml/wayland-architecture.png
/nix/store/d6gfwa3s6rlg0niysv0pwcpa77gcaiqq-graphviz-2.49.3/bin/dot -Tpng -odoc/doxygen/xml/wayland-architecture.png ../doc/doxygen/dot/wayland-architecture.gv
Format: "png" not recognized. No formats found.
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?
[2/107] Generating wayland-architecture.map with a custom command
FAILED: doc/doxygen/xml/wayland-architecture.map
/nix/store/d6gfwa3s6rlg0niysv0pwcpa77gcaiqq-graphviz-2.49.3/bin/dot -Tcmapx_np -odoc/doxygen/xml/wayland-architecture.map ../doc/doxygen/dot/wayland-architecture.gv
Format: "cmapx_np" not recognized. No formats found.
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?
[3/107] Generating x-architecture.png with a custom command
FAILED: doc/doxygen/xml/x-architecture.png                                                 
/nix/store/d6gfwa3s6rlg0niysv0pwcpa77gcaiqq-graphviz-2.49.3/bin/dot -Tpng -odoc/doxygen/xml/x-architecture.png ../doc/doxygen/dot/x-architecture.gv
Format: "png" not recognized. No formats found.
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?
[4/107] Generating x-architecture.map with a custom command
FAILED: doc/doxygen/xml/x-architecture.map                                                 
/nix/store/d6gfwa3s6rlg0niysv0pwcpa77gcaiqq-graphviz-2.49.3/bin/dot -Tcmapx_np -odoc/doxygen/xml/x-architecture.map ../doc/doxygen/dot/x-architecture.gv
Format: "cmapx_np" not recognized. No formats found.
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?
[8/107] Generating Architecture.xml with a custom commandand
warning: failed to load external entity "../doc/publican/images/x-architecture.map"
warning: failed to load external entity "../doc/publican/images/wayland-architecture.map"
[14/107] Generating man-pages-3 with a custom commandayland-os.c.o[Kker.c.o
/build/wayland-1.19.0/cursor/wayland-cursor.c:510: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time)
/build/wayland-1.19.0/cursor/wayland-cursor.c:520: warning: The following parameter of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time) is not documented:
  parameter '_cursor'                                                                      
/build/wayland-1.19.0/cursor/wayland-cursor.c:458: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration)
/build/wayland-1.19.0/cursor/wayland-cursor.c:471: warning: The following parameter of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration) is not documented:
  parameter '_cursor'                                                                      
/build/wayland-1.19.0/cursor/wayland-cursor.c:147: warning: argument 'image' of command @param is not found in the argument list of wl_cursor_image_get_buffer(struct wl_cursor_image *_img)
/build/wayland-1.19.0/cursor/wayland-cursor.c:155: warning: The following parameter of wl_cursor_image_get_buffer(struct wl_cursor_image *_img) is not documented:
  parameter '_img'                                                                         
/build/wayland-1.19.0/cursor/wayland-cursor.c:510: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time)
/build/wayland-1.19.0/cursor/wayland-cursor.h:86: warning: The following parameter of wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time) is not documented:
  parameter '_cursor'                                                                      
/build/wayland-1.19.0/cursor/wayland-cursor.c:458: warning: argument 'cursor' of command @param is not found in the argument list of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration)
/build/wayland-1.19.0/cursor/wayland-cursor.h:89: warning: The following parameter of wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time, uint32_t *duration) is not documented:
  parameter '_cursor'                                                                      
/build/wayland-1.19.0/cursor/wayland-cursor.c:147: warning: argument 'image' of command @param is not found in the argument list of wl_cursor_image_get_buffer(struct wl_cursor_image *_img)
/build/wayland-1.19.0/cursor/wayland-cursor.h:83: warning: The following parameter of wl_cursor_image_get_buffer(struct wl_cursor_image *_img) is not documented:
  parameter '_img'                                                                         
[21/107] Compiling C object src/libwayland-private.a.p/connection.c.oo capture output)
ninja: build stopped: subcommand failed.                                                   
builder for '/nix/store/60dlfjzb0nw2wh7ym63n01a7fnh5y50c-wayland-1.19.0.drv' failed with exit code 1

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 31, 2022
@dasJ
Copy link
Member

dasJ commented Sep 6, 2022

Turns out cmake sets that as well (but with a more precise match than matching i686-linux):

# Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20568
++ lib.optionals stdenv.hostPlatform.is32bit [
"CFLAGS=-D_FILE_OFFSET_BITS=64"
"CXXFLAGS=-D_FILE_OFFSET_BITS=64"
]

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 6, 2022
@athre0z
Copy link
Member

athre0z commented Nov 25, 2022

I seem to be running into the same issue while installing Steam via programs.steam.enable = true (pulls in 32-bit nvidia drivers):

ninja: error: stat(/nix/store/bay9lzpz2y16j0gh4im01xf93qs2867c-gst-plugins-bad-1.20.3/lib/libgstcodecparsers-1.0.so): Value too large for defined data type

Running a 2TiB XFS setup here.

Looks like this might have finally been addressed ninja-build/ninja#2203 which has been merged, but isn't yet part of a released version.

@vcunat vcunat self-assigned this Mar 21, 2023
vcunat added a commit that referenced this issue Mar 26, 2023
Fixes #68241
> Value too large for defined data type
https://hydra.nixos.org/build/213266252

(cherry picked from commit 9434136)
@vcunat vcunat closed this as completed in 9434136 Mar 26, 2023
@vcunat
Copy link
Member

vcunat commented Mar 28, 2023

Many various builds are really affected by this, I'm afraid. I'm not putting significant effort into fixing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

7 participants