I did some more digging on this, no real solution but perhaps its' worth

- our problem can be tracked down to src/io/fileops.c in moarvm, where
  MVM_file_is_writable tries to work out whether the file can be written
  to, which it decides that it can't because th call into libuv returns
  uid 1234 on my box rather than 0 as expected
- libuv 1.30.1 relative to 1.24 changes src/unix/fs.c and switches to
  callgin statx() rather than stat() 
- putting some more debug into libuv shows that indeed statx() returns
  uid 1234, a call to stat() directly afterwards does correctly return 0
- even outside libuv and moar, the simple code below shows the two different
  uid values when executed against
  /build/rakudo-2019.07.1/debian/rakudo/usr/lib/perl6/core, 1234 from
  statx() and 0 from stat()
- doing a pbuilder login, followed by mkdir and then calling the code
  below does however *not* cause the problem, we get 0 in both cases
- calling the code below during build on a file in the build directory 
  shows the same problem as the .../core
- calling the code below on during build / does not show the problem
- calling against /build/ and anything below does exhibit the problem
- I would therefore assume that git-pbuilder does something when
  creating/mouinting /build/ that throws statx() off track, but not
  stat(), which gets exposed by a newer libuv1. 
- this concludes my digging for today, if anyone knows where that
  /build/ directory gets created when running gbp buildpackage --git-pbuilder
  then please let me know!!

regards  robert

    #include <sys/types.h>
    #include <sys/stat.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <stdio.h>

    int main(int argc, char **argv) {
        printf("statx test against %s...\n", argv[1]);

        struct statx sbuf;
        int ret = statx(AT_FDCWD, argv[1], AT_STATX_SYNC_AS_STAT, 0xFFF, &sbuf);
        printf("returned %i\n", ret);
        printf("uid is %i\n", sbuf.stx_uid);

        struct stat sbuf2;
        ret = stat(argv[1], &sbuf2);
        printf("stat returned %i\n", ret);
        printf("stat uid is %i\n", sbuf2.st_uid);

        return 0;


Robert Lemmen                               http://www.semistable.com 

Attachment: signature.asc
Description: PGP signature

Reply via email to