Skip to content

macOS: ranlib timestamp resolution bugs break parallel builds? #51221

@endgame

Description

@endgame

Continues #51093 .

Background: on macOS, parallel builds of postgres would try to build libpgtypes.a multiple times, trip over each other and error out.

On the postgres mailing list, Tom Lane figured out that:

  • APFS has sub-second timestamp resolution
  • GNU Make can use sub-second timestamps if the filesystem supports them
  • ranlib truncates timestamps to the nearest second
  • Therefore, the .a file appears to be built before the .o files that comprise it
  • Therefore, multiple builds of libpgtypes.a are kicked off, trip over each other and error out.

GNU Make has a special target, .LOW_RESOLUTION_TIME, that can be used in this situation.

I won't have time to dig much further on this, but thought I'd log the issue for completeness. Ping @delroth , who wasn't thrilled at the blunt hammer of disabling parallel builds.

Metadata

Metadata

Assignees

Labels

6.topic: darwinRunning or building packages on Darwin9.needs: port to stableA PR needs a backport to the stable release.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions