Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSKHN-0003Jf-Sm for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Nov 2018 11:14:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gSKHL-00016d-LX for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Nov 2018 11:14:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSKHL-00016V-7r for pgsql-bugs@lists.postgresql.org; Thu, 29 Nov 2018 11:14:43 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSKHH-0007XY-Ij for pgsql-bugs@lists.postgresql.org; Thu, 29 Nov 2018 11:14:41 +0000 Received: by mail-pl1-x62d.google.com with SMTP id b5so875575plr.4 for ; Thu, 29 Nov 2018 03:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jackkelly-name.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=UvW9EEst9niw2PcaMY+n4BLVakSdGw/HoAJrvey8e8k=; b=AiDi6E5eqfESjqZT+4KB1k9sqdcxQ4qW1ecN5GqT2Sg2Iu13WuecUAixGV6u/+lxuz FUfTJ/ZN5kB9oxzy9ATzrhGebe5lMVH9bWJxDW5JDSvYqkbYjfFFe8/fiz5TF4Y/MHVv XrH6UrCZ9fLMmUpGnGxU4wu3yQaG1xwXu0t3+jmmu1nag6FtGy0y8xMiO1yVocMNZ4+s OY5UiaTejCXXPCQBsVUR7pJP9hXkU/pVXQg79AvnTg2GEpvj+h1cK5L0Nzyluy/NGyQ8 hOSRryJ1B7WHFQEAgfAOYfXHaqzLVaJbuDjdkoaaowJy42uPdMpcfpzjzOlmz2tI684F LfNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=UvW9EEst9niw2PcaMY+n4BLVakSdGw/HoAJrvey8e8k=; b=qozw80HKvNupTGeRhQY5/nnkLDjXpQH4in6qz0zp86EGeytjEX31zzYJFTboL90fB4 23Sj/S8HfSEpKeM4PTCynk7B1Za0iePTYPJPfCh/Nt7f6emwMlc9T55NPIFfir0Gb6n7 DHQuPmiEdQ4vVr7wXPImusS+zXcCFEpUftDKlfeLkaCdJIOBLndDOI/q7OOUWEiw783l B1VgX2ads4H+hNEVZpkf/S4D5OarWG/bMjjR2r453AsKOXFRijzzVn+NWBSadOxC8aDQ nhqqacCgOqWGqDw4rpZuhZc6s8l+dnS730bPVrvLCcq3CT4zyI/5M8aUCZQzsnB/CAQe gwqg== X-Gm-Message-State: AA+aEWb0AapnhE2di8i3rAJ+7Rbtg0MsAxbdI5FDz8gMuk1t7Kr8h1nl PE3JpmZU8bhF2l7/iswteVH2Tp6JHHU= X-Google-Smtp-Source: AFSGD/WQifpL7pTAG8SyXbh9qn6r4Plq/Z+1A2OjfawkrRw46EsbG+d+JaluNP5tV+tH7lZ8Xwk2tw== X-Received: by 2002:a17:902:a70b:: with SMTP id w11mr1051647plq.84.1543490077777; Thu, 29 Nov 2018 03:14:37 -0800 (PST) Received: from cyberdwarf ([104.238.51.140]) by smtp.gmail.com with ESMTPSA id l69sm466822pfb.75.2018.11.29.03.14.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Nov 2018 03:14:36 -0800 (PST) From: Jack Kelly To: Thomas Munro Cc: Tom Lane , PostgreSQL mailing lists Subject: Re: BUG #15525: Build failures when compiling Postgres with Make parallelization References: <15525-a30da084f17a1faa@postgresql.org> <31602.1543363896@sss.pgh.pa.us> <87k1kwlvad.fsf@jackkelly.name> <28417.1543458718@sss.pgh.pa.us> <31059.1543461919@sss.pgh.pa.us> Date: Thu, 29 Nov 2018 22:14:31 +1100 In-Reply-To: (Thomas Munro's message of "Thu, 29 Nov 2018 19:25:50 +1300") Message-ID: <87r2f4jfu0.fsf@jackkelly.name> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thanks Thomas and Tom for your detective work. Thomas Munro writes: > As for what could be done about it, it seems like we (or the Nix > project, in a local patch) could declare individual targets to have > .LOW_RESOLUTION_TIME: > > https://www.gnu.org/software/make/manual/html_node/Special-Targets.html > > That doesn't seem any better than using "touch" to make a better mtime > though. I'm kinda surprised that the Nix project doesn't have this > problem on other projects, though, if they're always using a modern > GNU make. What are they doing differently? I think this is slightly better than using "touch", because it's a Makefile-level fix instead of kludging around with the file system, and its designed purpose is to deal with broken tools. IMHO, The Nth-degree "correct" thing for the postgresql build system would be check if the most recent versions are vulnerable, and if so update the configure script to detect a high-resolution filesystem and a truncating ranlib, and if that is true for that build, then set a variable so the Makefiles can conditionally add static libraries to `.LOW_RESOLUTION_TIME` targets. This seems like a lot of work for marginal payoff, particularly if releases newer than 9.x are not brittle in this way. On the Nix question: I'm an itinerant nixpkgs contributor, so I can't speak definitively, but I think there are at least a couple of things going on: 1. Nix on macOS is still a bit of a second-class citizen. (I recently had to fix code that assumed shared objects always ended in ".so", instead of substituting a variable that expanded to ".dylib" on macOS). 2. If Nix successfully builds postgres and adds it to a binary cache, most people will not run the build themselves. 3. This bug seems to be tickled because two different Makefiles use attempt to build the same target at the same time, using a tool (macOS libtool/ranlib, albeit through a recursive $(MAKE) invocation) that doesn't support subsecond timestamps, on a filesystem that does (APFS). That's a bit of a corner case. I speculate that building a static library with a nonrecursive Makefile would only kick off one build of the `.a` file, because make will only invoke the command once as it walks the DAG of dependencies. #1 and #2 mean the actual amount of building done is relatively low, and #3 means that it is actually somewhat hard to trip over. I have filed https://github.com/NixOS/nixpkgs/issues/51221 with nixpkgs, and now @dalroth is talking about patching cctools' ranlib. Thanks again for all your help. I probably won't have time to dig into this further but if you need more information I'll see what I can do. -- Jack