Thread

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix sign-compare warnings in pg_iovec.h.

  1. Fix port/pg_iovec.h building extensions on x86_64-darwin

    Wolfgang Walther <walther@technowledgy.de> — 2024-11-08T19:08:06Z

    When building pg_cron [1] or pg_hll [2] for PG 17 on x86_64-darwin, we 
    encounter the following build failure in nixpkgs:
    
    
    /nix/store/2clw9wg933c40f871d8iqbl909lg2yis-postgresql-17.0-dev/include/server/port/pg_iovec.h:71:12: 
    error: comparison of integers of different signs: 'ssize_t' (aka 'long') 
    and 'const size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]
                     if (part < iov[i].iov_len)
                         ~~~~ ^ ~~~~~~~~~~~~~~
    /nix/store/2clw9wg933c40f871d8iqbl909lg2yis-postgresql-17.0-dev/include/server/port/pg_iovec.h:110:12: 
    error: comparison of integers of different signs: 'ssize_t' (aka 'long') 
    and 'const size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]
                     if (part < iov[i].iov_len)
                         ~~~~ ^ ~~~~~~~~~~~~~~
    2 errors generated.
    
    
    The attached patch fixes those.
    
    Hopefully this can make it into the minor release next week.
    
    Best,
    
    Wolfgang
    
    [1]: https://hydra.nixos.org/build/276421287/nixlog/1
    [2]: https://hydra.nixos.org/build/276419879/nixlog/1
  2. Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

    Nathan Bossart <nathandbossart@gmail.com> — 2024-11-08T20:00:36Z

    On Fri, Nov 08, 2024 at 08:08:06PM +0100, Wolfgang Walther wrote:
    > @@ -68,7 +68,7 @@ pg_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
    >  		}
    >  		sum += part;
    >  		offset += part;
    > -		if (part < iov[i].iov_len)
    > +		if ((size_t) part < iov[i].iov_len)
    >  			return sum;
    >  	}
    >  	return sum;
    > @@ -107,7 +107,7 @@ pg_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
    >  		}
    >  		sum += part;
    >  		offset += part;
    > -		if (part < iov[i].iov_len)
    > +		if ((size_t) part < iov[i].iov_len)
    >  			return sum;
    >  	}
    >  	return sum;
    
    This looks correct to me.  At this point in the code, we know that part >=
    0, so casting it to an unsigned long ought to be okay.
    
    -- 
    nathan
    
    
    
    
  3. Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

    Nathan Bossart <nathandbossart@gmail.com> — 2024-11-08T21:20:00Z

    Here is a new version of the patch with an updated commit message.  The
    cfbot results [0] look good, so I plan to commit this one shortly unless
    someone objects.
    
    [0] https://cirrus-ci.com/build/6599760059039744
    
    -- 
    nathan
    
  4. Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

    Nathan Bossart <nathandbossart@gmail.com> — 2024-11-08T22:15:47Z

    On Fri, Nov 08, 2024 at 03:20:00PM -0600, Nathan Bossart wrote:
    > Here is a new version of the patch with an updated commit message.  The
    > cfbot results [0] look good, so I plan to commit this one shortly unless
    > someone objects.
    
    Committed.
    
    -- 
    nathan
    
    
    
    
  5. Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

    Thomas Munro <thomas.munro@gmail.com> — 2024-11-08T22:26:44Z

    On Sat, Nov 9, 2024 at 8:08 AM Wolfgang Walther <walther@technowledgy.de> wrote:
    > When building pg_cron [1] or pg_hll [2] for PG 17 on x86_64-darwin, we
    > encounter the following build failure in nixpkgs:
    
    Out of curiosity, is nixos deliberately using an old macOS deployment
    target or SDK, 10.something?  I'm just wondering if our feature
    detection is working correctly on macOS/x86, because I'd expect real
    preadv/pwritev to be there from 11 onwards, and 11 is already out of
    support by Apple.
    
    
    
    
  6. Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

    Nathan Bossart <nathandbossart@gmail.com> — 2024-11-08T22:36:18Z

    On Sat, Nov 09, 2024 at 11:26:44AM +1300, Thomas Munro wrote:
    > Out of curiosity, is nixos deliberately using an old macOS deployment
    > target or SDK, 10.something?  I'm just wondering if our feature
    > detection is working correctly on macOS/x86, because I'd expect real
    > preadv/pwritev to be there from 11 onwards, and 11 is already out of
    > support by Apple.
    
    It appears to be working for longfin [0].
    
    [0] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=longfin&dt=2024-11-08%2021%3A36%3A02&stg=configure
    
    -- 
    nathan
    
    
    
    
  7. Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

    Wolfgang Walther <walther@technowledgy.de> — 2024-11-09T11:06:07Z

    Thomas Munro:
    > Out of curiosity, is nixos deliberately using an old macOS deployment
    > target or SDK, 10.something?  I'm just wondering if our feature
    > detection is working correctly on macOS/x86, because I'd expect real
    > preadv/pwritev to be there from 11 onwards, and 11 is already out of
    > support by Apple.
    
    There has been a lot of work on the macOS SDK in nixpkgs lately, but it 
    seems that the default for x86-64 is still v10 [1], yes:
    
     > x86_64-darwin uses the 10.12 SDK by default, but some software is not
     > compatible with that version of the SDK. In that case, the 11.0 SDK
     > used by aarch64-darwin is available for use on x86_64-darwin. [...]
    
    It seems like the goal is to bump x86-64 to v11 in the next release 
    cycle [2].
    
    Best,
    
    Wolfgang
    
    [1]: https://nixos.org/manual/nixpkgs/unstable/#sec-darwin
    [2]: 
    https://discourse.nixos.org/t/on-the-future-of-darwin-sdks-or-how-you-can-stop-worrying-and-put-the-sdk-in-build-inputs/50574/11