Hi, Thanks for the bug report and nice reproducer! Ricardo Wurmus skribis: > The guix-daemon's libutil/util.cc uses copy_file_range to copy a > downloaded file into the store. copy_file_range fails on files larger > than 4GB with an error like this: > > guix build: error: short write in copy_file_range `15' to `16': No such file or directory > > The man page for copy_file_range says that it could return EFBIG when > the range exceeds the maximum range. The daemon code does not check any > limits and will attempt to copy the whole file. > > I believe our code ought to check the value of st.size and fall back to > a boring copy if it exceeds some "reasonable" value. The goal leading to this error message looks like this: copy_file_range(15, NULL, 16, NULL, 4294967297, 0) = 2147479552 … which is precisely 2 GiB - 4 KiB. Reading the man page, it’s entirely fine: like ‘write’, ‘copy_file_range’ might copy less than asked for, so it’s really a mistake of mine to assume that short writes can’t happen. Presumably there’s an internal limit here we’re reaching that explains why it won’t copy more than 2 GiB at once. With the following change, we get: newfstatat(15, "", {st_mode=S_IFREG|0644, st_size=4294967297, ...}, AT_EMPTY_PATH) = 0 copy_file_range(15, NULL, 16, NULL, 4294967297, 0) = 2147479552 copy_file_range(15, NULL, 16, NULL, 2147487745, 0) = 2147479552 copy_file_range(15, NULL, 16, NULL, 8193, 0) = 8193 fchown(16, 30001, 30000) = 0 Could you confirm that it works for you? Thanks, Ludo’.