From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51722 invoked by alias); 8 Oct 2018 21:25:23 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 51507 invoked by uid 89); 8 Oct 2018 21:25:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=dan, H*r:sk:l17-v6s, scenario, Dan X-HELO: mail-pf1-f172.google.com Received: from mail-pf1-f172.google.com (HELO mail-pf1-f172.google.com) (209.85.210.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Oct 2018 21:25:05 +0000 Received: by mail-pf1-f172.google.com with SMTP id l17-v6so4571800pff.2 for ; Mon, 08 Oct 2018 14:24:48 -0700 (PDT) MIME-Version: 1.0 From: Dan Kegel Date: Mon, 08 Oct 2018 21:25:00 -0000 Message-ID: Subject: Fun with cp -R error when both foo and foo.exe exist To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00067.txt.bz2 Everybody who uses cygwin knows that if foo and foo.exe exist, you can do cp foo bar cp foo.exe bar.exe but not cp foo.exe bar.exe cp foo bar because of the unavoidable magic in cygwin that lets you execute foo when you really mean foo.exe. Well, it just bit me again during a buildbot try build of electron. Here's the scenario: argv: ['git', '--version'] argv: ['rm', '-rf', '/home/buildbot/slave-state/electron-oblong-1-7-x-try-win10/build'] argv: ['git', 'fetch', '-t', 'git@gitlab.foo.com:platform/electron.git'] argv: ['git', 'fetch', '-t', 'git@gitlab.foo.com:jisorce/electron.git', 'window_infos'] argv: ['git', 'reset', '--hard', 'FETCH_HEAD', '--'] argv: ['git', 'checkout', '-B', 'window_infos'] argv: ['git', 'submodule', 'sync'] argv: ['git', 'submodule', 'update', '--init', '--recursive', '--force', '--checkout'] argv: ['cp', '-R', '-P', '-p', '-v', '/home/buildbot/slave-state/electron-oblong-1-7-x-try-win10/source', '/home/buildbot/slave-state/electron-oblong-1-7-x-try-win10/build'] cp: cannot create regular file '/home/buildbot/slave-state/electron-oblong-1-7-x-try-win10/build/vendor/libchromiumcontent/vendor/depot_tools/ninja': File exists Maybe the order of files reported via the system call cp uses to expand a directory was unfortunate after that git operation. The workaround was to nuke the source directory, thus forcing a clean checkout. (And alas that means I don't have the directory to inspect anymore.) A nice workaround might be for the cygwin version of cp could arrange to wait to create .exe files until after any potential non-suffixed file has been processed... not sure how easy that would be. Apologies if this has already been discussed. - Dan -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple