public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Dan Kegel <dank@kegel.com>
To: cygwin@cygwin.com
Subject: Fun with cp -R error when both foo and foo.exe exist
Date: Mon, 08 Oct 2018 21:25:00 -0000	[thread overview]
Message-ID: <CAPF-yObTngOGu_+TSfSQo4bpi_tJ3572r_26cfidLZ5QpcPGYQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2018-10-08 21:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 21:25 Dan Kegel [this message]
2018-10-09  6:22 ` Marco Atzeri
2018-10-09 12:03   ` Eric Blake
2018-10-09 16:22     ` Dan Kegel
2018-10-09 16:52       ` Eric Blake
2018-10-09 17:19         ` Dan Kegel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPF-yObTngOGu_+TSfSQo4bpi_tJ3572r_26cfidLZ5QpcPGYQ@mail.gmail.com \
    --to=dank@kegel.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).