!UNVBThoJtlIiVwiDjU:nixos.org

Staging

384 Members
Staging merges | Find currently open staging-next PRs: https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+sort%3Aupdated-desc+head%3Astaging-next+head%3Astaging-next-21.05+is%3Aopen125 Servers

Load older messages


SenderMessageTime
26 Oct 2021
@janne.hess:helsinki-systems.dedas_jyou could `substituteInPlace src/copy.c --replace SEEK_HOLE 0?22:06:21
@janne.hess:helsinki-systems.dedas_j * you could substituteInPlace src/copy.c --replace SEEK_HOLE 0 22:06:24
@janne.hess:helsinki-systems.dedas_jah wait its ifdef22:06:40
@janne.hess:helsinki-systems.dedas_j --replace "ifdef SEEK_HOLE" "if 0" is probably safer 22:06:57
@r-burns:matrix.orgRyan Burnsmaybe just #undef it at the top22:07:06
@r-burns:matrix.orgRyan Burnswell after the relevant includes22:07:16
@moritz.hedtke:matrix.orgmoritz.hedtketo be more idiot safe I just removed the whole sections (so played compiler a bit)22:09:12
@janne.hess:helsinki-systems.dedas_jlooking at the SEEK_DATA macro we can probably just build without it until this is fixed22:13:26
@janne.hess:helsinki-systems.dedas_jit also disables SEEK_DATA when it cannot find Python22:13:53
@moritz.hedtke:matrix.orgmoritz.hedtkewhat is SEEK_DATA in relation to SEEK_HOLE?22:14:25
@janne.hess:helsinki-systems.dedas_j
   Seeking file data and holes
       Since version 3.1, Linux supports the following additional values
       for whence:

       SEEK_DATA
              Adjust the file offset to the next location in the file
              greater than or equal to offset containing data.  If
              offset points to data, then the file offset is set to
              offset.

       SEEK_HOLE
              Adjust the file offset to the next hole in the file
              greater than or equal to offset.  If offset points into
              the middle of a hole, then the file offset is set to
              offset.  If there is no hole past offset, then the file
              offset is adjusted to the end of the file (i.e., there is
              an implicit hole at the end of any file).
22:14:50
@janne.hess:helsinki-systems.dedas_j the entire functionality in cp seems to be governed by the SEEK_DATA macro? 22:16:02
@janne.hess:helsinki-systems.dedas_j * the entire functionality in cp seems to be governed by the SEEK_HOLE macro 22:16:12
@moritz.hedtke:matrix.orgmoritz.hedtkeThanks! was mostly irritated by the word "macro" but now I understand how that works22:16:16
@janne.hess:helsinki-systems.dedas_j

This is probably what's needed to disable lseek:

diff --git a/src/copy.c b/src/copy.c
index cb9018f93..2a4ccc061 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -502,7 +502,7 @@ write_zeros (int fd, off_t n_bytes)
   return true;
 }

-#ifdef SEEK_HOLE
+#if 0
 /* Perform an efficient extent copy, if possible.  This avoids
    the overhead of detecting holes in hole-introducing/preserving
    copy, and thus makes copying sparse files much more efficient.
@@ -1095,7 +1095,7 @@ infer_scantype (int fd, struct stat const *sb,
          && ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE))
     return PLAIN_SCANTYPE;

-#ifdef SEEK_HOLE
+#if 0
   scan_inference->ext_start = lseek (fd, 0, SEEK_DATA);
   if (0 <= scan_inference->ext_start)
     return LSEEK_SCANTYPE;
@@ -1377,7 +1377,7 @@ copy_reg (char const *src_name, char const *dst_name,
       off_t n_read;
       bool wrote_hole_at_eof = false;
       if (! (
-#ifdef SEEK_HOLE
+#if 0
              scantype == LSEEK_SCANTYPE
              ? lseek_copy (source_desc, dest_desc, buf, buf_size, hole_size,
                            scan_inference.ext_start, src_open_sb.st_size,
diff --git a/tests/seek-data-capable b/tests/seek-data-capable
index cc6372214..6e7a9ec1e 100644
--- a/tests/seek-data-capable
+++ b/tests/seek-data-capable
@@ -1,5 +1,7 @@
 import sys, os, errno, platform

+sys.exit(1)
+
 # Pass an _empty_ file
 if len(sys.argv) != 2:
     sys.exit(1)
22:27:45
@janne.hess:helsinki-systems.dedas_jI saved the mail draft and I'm going to open the bug report tomorrow at 12:00 (roughly, don't count on my timekeeping skills). The current version also mentions that the other two changes might not be related. If anyone can prove that one of the breakages I cannot reproduce is actually related to the same commit, I'll happily add it to the report :) Good night for now22:30:11
@moritz.hedtke:matrix.orgmoritz.hedtkeGood night22:30:49
@moritz.hedtke:matrix.orgmoritz.hedtke I finished building with the SEEK_HOLE parts removed and peertube also built. /nix/store/8gbnwiv94i9ydrc0gxw7hz6wwcsk1gab-peertube-3.4.1. Whether that commit was the culprit or a nondeterministig bug in the compiler that is now hidden by a new random-seed I don't know. 23:10:09
@moritz.hedtke:matrix.orgmoritz.hedtkeFor reference https://gist.github.com/mohe2015/15ab065023116b5770d66a6daa5c8a4a is the diff and I applied das_j's patch from above to coreutils to build from local. On top of v9.023:13:55
@moritz.hedtke:matrix.orgmoritz.hedtke * I finished building with the SEEK_HOLE parts removed and peertube also built. /nix/store/8gbnwiv94i9ydrc0gxw7hz6wwcsk1gab-peertube-3.4.1. Whether that commit was the culprit or a non-deterministic bug in the compiler that is now hidden by a new random-seed I don't know. 23:15:55
27 Oct 2021
@vcunat:matrix.orgVladimír Čunát
In reply to @janne.hess:helsinki-systems.de

This is probably what's needed to disable lseek:

diff --git a/src/copy.c b/src/copy.c
index cb9018f93..2a4ccc061 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -502,7 +502,7 @@ write_zeros (int fd, off_t n_bytes)
   return true;
 }

-#ifdef SEEK_HOLE
+#if 0
 /* Perform an efficient extent copy, if possible.  This avoids
    the overhead of detecting holes in hole-introducing/preserving
    copy, and thus makes copying sparse files much more efficient.
@@ -1095,7 +1095,7 @@ infer_scantype (int fd, struct stat const *sb,
          && ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE))
     return PLAIN_SCANTYPE;

-#ifdef SEEK_HOLE
+#if 0
   scan_inference->ext_start = lseek (fd, 0, SEEK_DATA);
   if (0 <= scan_inference->ext_start)
     return LSEEK_SCANTYPE;
@@ -1377,7 +1377,7 @@ copy_reg (char const *src_name, char const *dst_name,
       off_t n_read;
       bool wrote_hole_at_eof = false;
       if (! (
-#ifdef SEEK_HOLE
+#if 0
              scantype == LSEEK_SCANTYPE
              ? lseek_copy (source_desc, dest_desc, buf, buf_size, hole_size,
                            scan_inference.ext_start, src_open_sb.st_size,
diff --git a/tests/seek-data-capable b/tests/seek-data-capable
index cc6372214..6e7a9ec1e 100644
--- a/tests/seek-data-capable
+++ b/tests/seek-data-capable
@@ -1,5 +1,7 @@
 import sys, os, errno, platform

+sys.exit(1)
+
 # Pass an _empty_ file
 if len(sys.argv) != 2:
     sys.exit(1)
I also confirm that this patch fixes peertube build, atop staging-next. (same machine: all ext4 on LVM, x86_64-linux)
07:46:30
@janne.hess:helsinki-systems.dedas_j
In reply to @vcunat:matrix.org
I also confirm that this patch fixes peertube build, atop staging-next. (same machine: all ext4 on LVM, x86_64-linux)
Awesome! Thank you. The build fails because presumably a file is broken, right? It's not because cp fails in the build process?
07:47:43
@janne.hess:helsinki-systems.dedas_jAlso, is your /tmp on tmpfs? 07:47:52
@vcunat:matrix.orgVladimír Čunát
In reply to @janne.hess:helsinki-systems.de
Also, is your /tmp on tmpfs?
No, it's all ext4 on LVM.
07:49:53
@vcunat:matrix.orgVladimír Čunát
In reply to @janne.hess:helsinki-systems.de
Awesome! Thank you. The build fails because presumably a file is broken, right? It's not because cp fails in the build process?

I haven't poked into details of the error. It looks like it attempts some tests after build and those all end with

Error: The service is no longer running
07:50:38
@janne.hess:helsinki-systems.dedas_j
In reply to @vcunat:matrix.org
No, it's all ext4 on LVM.
Umm, do you have time to check whether that also happens with boot.tmpOnTmpfs?
08:08:35
@janne.hess:helsinki-systems.dedas_jBecause that's one big difference between us. For you, it's the same filesystem, for me it's not08:08:56
@janne.hess:helsinki-systems.dedas_jIf you don't have the time, this is the current draft:08:18:29
@janne.hess:helsinki-systems.dedas_jRedacted or Malformed Event08:18:32
@vcunat:matrix.orgVladimír Čunát
In reply to @janne.hess:helsinki-systems.de
Because that's one big difference between us. For you, it's the same filesystem, for me it's not
Build on progress. (plain staging-next, all same except for tmpfs on /tmp)
08:20:14

Show newer messages


Back to Room ListRoom Version: 6