Skip to content

git-extras: fix build failure when MSYS=winsymlinks:native#6188

Open
lygstate wants to merge 1 commit into
msys2:masterfrom
lygstate:git-extras-same-file-fixes
Open

git-extras: fix build failure when MSYS=winsymlinks:native#6188
lygstate wants to merge 1 commit into
msys2:masterfrom
lygstate:git-extras-same-file-fixes

Conversation

@lygstate

Copy link
Copy Markdown
Contributor

…ile"

@lygstate lygstate force-pushed the git-extras-same-file-fixes branch from 9319ab3 to bc7a3f1 Compare April 16, 2026 18:55
@ognevny

ognevny commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

cc @dscho

@lygstate lygstate force-pushed the git-extras-same-file-fixes branch from bc7a3f1 to 0d6a8de Compare April 16, 2026 19:03
@lygstate

lygstate commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

What's the default MSYS in CI?
I am using

$ echo $MSYS
winsymlinks:native

locally.

@ognevny

ognevny commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

by default winsymlinks set to deep copy option, so all symlinks are actually copies of sources

@lygstate lygstate force-pushed the git-extras-same-file-fixes branch from 0d6a8de to 59a5aca Compare April 16, 2026 19:09
@lygstate

Copy link
Copy Markdown
Contributor Author

OK, I switch it to MSYS=winsymlinks:native and now it's fine for bsdtar

Comment thread git-extras/PKGBUILD Outdated
Comment on lines +20 to +22
bsdtar -zxf "${_realname}-${pkgver}.tar.gz" || true

cd "${srcdir}/${_realname}-${pkgver}"
cp bin/git-scp bin/git-rscp
MSYS=winsymlinks:native \
bsdtar -zxf "${_realname}-${pkgver}.tar.gz"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if many people are lucky enough to run MSYS2 on a recent Windows machine in Developer Mode, not all MSYS2 users are that lucky. And those would no longer be able to use this recipe to build.

Maybe it would be better to go the other way round, using MSYS=winsymlinks:deepcopy and keep most of the original code as-is?

@lygstate lygstate Apr 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between winsymlinks:native and winsymlinks:nativestrict is this: If the filesystem supports native symlinks and Cygwin fails to create a native symlink for some reason, it will fall back to creating Cygwin default symlinks with winsymlinks:native, while with winsymlinks:nativestrict the symlink(2) system call will immediately fail.
So I think winsymlinks:native is a better opton indeed. According to https://cygwin.com/cygwin-ug-net/using-cygwinenv.html

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSYS=winsymlinks:deepcopy have the following error that are hidden.:

git-extras-7.4.0/bin/git-rscp: Can't create 'git-extras-7.4.0/bin/git-rscp': No such file or directory
bsdtar: Error exit delayed from previous errors

@lygstate lygstate force-pushed the git-extras-same-file-fixes branch from 59a5aca to 585d854 Compare April 18, 2026 02:31

@dscho dscho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With substantially improved commit message, I would be totally comfortable with this change for now. https://github.blog/2022-06-30-write-better-commits-build-better-projects/ might be helpful, in particular this part:

  What you’re doing Why you’re doing it
High-level (strategic) Intent (what does this accomplish?) Context (why does the code do what it does now?)
Low-level (tactical) Implementation (what did you do to accomplish your goal?) Justification (why is this change being made?)

@lygstate lygstate force-pushed the git-extras-same-file-fixes branch from 585d854 to 88f8dc3 Compare May 28, 2026 11:40
Set MSYS=winsymlinks:deepcopy before extracting the source tarball so
symlinked bin/git-scp and bin/git-rscp are materialized as separate
files, avoiding "cp: 'bin/git-scp' and 'bin/git-rscp' are the same file".
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
@lygstate lygstate force-pushed the git-extras-same-file-fixes branch from 88f8dc3 to 60f20c8 Compare May 28, 2026 11:46
@lygstate lygstate changed the title git-extras Fixes "cp: 'bin/git-scp' and 'bin/git-rscp' are the same f… git-extras: fix build failure when MSYS=winsymlinks:native May 28, 2026
@lygstate

Copy link
Copy Markdown
Contributor Author

With substantially improved commit message, I would be totally comfortable with this change for now. https://github.blog/2022-06-30-write-better-commits-build-better-projects/ might be helpful, in particular this part:

  What you’re doing Why you’re doing it
High-level (strategic) Intent (what does this accomplish?) Context (why does the code do what it does now?)
Low-level (tactical) Implementation (what did you do to accomplish your goal?) Justification (why is this change being made?)

Updated, don't know if it's OK to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants