public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Fun with cp -R error when both foo and foo.exe exist
@ 2018-10-08 21:25 Dan Kegel
  2018-10-09  6:22 ` Marco Atzeri
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Kegel @ 2018-10-08 21:25 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-09 17:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08 21:25 Fun with cp -R error when both foo and foo.exe exist Dan Kegel
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

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).