Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow native symlinks to non-existing targets in 'nativestrict' mode #10

Merged
merged 1 commit into from
May 21, 2015

Conversation

kblees
Copy link

@kblees kblees commented May 20, 2015

Prerequisite for issue git-for-windows/git#117

Required to run the test suite with prereq SYMLINKS (with export MSYS=winsymlinks:nativestrict).

Windows native symlinks must match the type of their target (file or
directory), otherwise native Windows tools will fail. Creating symlinks in
'nativestrict' mode currently requires the target to exist in order to
check its type.

However, the target of a symlink can change at any time after the symlink
has been created. Thus users of native symlinks must be prepared to deal
with type mismatches anyway. Checking the target type at symlink creation
time is not a good reason to violate the symlink() API specification.

In 'nativestrict' mode, always create native symlinks. Choose the symlink
type according to the target if it exists. Otherwise check the target path
for a trailing '/' as hint to create a directory symlink.

This allows callers to explicitly specify the expected target type, e.g.:

  $ ln -s test/ link-to-test
  $ mkdir test

Signed-off-by: Karsten Blees <blees@dcon.de>
dscho added a commit that referenced this pull request May 21, 2015
Allow native symlinks to non-existing targets in 'nativestrict' mode
@dscho dscho merged commit 869b4cf into git-for-windows:develop May 21, 2015
@dscho
Copy link
Member

dscho commented May 21, 2015

Thank you very much!

dscho added a commit that referenced this pull request May 24, 2015
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Jun 28, 2015
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Aug 28, 2015
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Sep 16, 2015
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Nov 25, 2015
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Nov 27, 2015
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Jan 7, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Jan 15, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Jan 18, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Mar 14, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Mar 20, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Apr 5, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Apr 5, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Sep 9, 2016
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Jan 6, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Feb 14, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Mar 21, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Apr 2, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request May 19, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Jul 3, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Jul 12, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Sep 7, 2017
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Feb 12, 2018
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Nov 9, 2018
Allow native symlinks to non-existing targets in 'nativestrict' mode
git-for-windows-ci pushed a commit that referenced this pull request Mar 31, 2019
Allow native symlinks to non-existing targets in 'nativestrict' mode
git-for-windows-ci pushed a commit that referenced this pull request Apr 6, 2019
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Apr 15, 2019
Allow native symlinks to non-existing targets in 'nativestrict' mode
git-for-windows-ci pushed a commit that referenced this pull request Apr 30, 2019
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Dec 17, 2019
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Apr 27, 2020
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Jun 4, 2020
Allow native symlinks to non-existing targets in 'nativestrict' mode
git-for-windows-ci pushed a commit that referenced this pull request Jul 9, 2020
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Aug 14, 2020
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request Aug 24, 2020
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Mar 30, 2021
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Apr 8, 2021
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Nov 11, 2021
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Dec 3, 2021
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Feb 1, 2022
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request May 3, 2022
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request May 6, 2022
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request May 8, 2022
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit that referenced this pull request May 8, 2022
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request May 13, 2022
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Sep 5, 2022
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request May 12, 2023
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Jun 16, 2023
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Jun 19, 2023
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Sep 6, 2023
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Nov 29, 2023
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho pushed a commit to dscho/msys2-runtime that referenced this pull request Feb 25, 2024
gcc-14 will default to c99 and as a result a fair amount of old code in newlib
(particularly libgloss) is failing to build.  I don't offhand know how many
patches will be necessary to fix the various failures. I'll just pick them off
one by one from my tree.

This particular patch works around the return-mismatch problem syscalls.c for
fr30.

That file is a bit odd in that most functions are declared as returning an
integer, but the implementations look like:

> int
> _read (file, ptr, len)
>      int    file;
>      char * ptr;
>      int    len;
> {
>   asm ("ldi:8 %0, r0" :: "i" (SYS_read) : "r0");
>   asm ("int   git-for-windows#10");
>
>   return;
> }

Note the lack of a value on the "return" statement.  The assumption is that the
interrupt handler implementing syscalls will put the return value into the
proper register, so falling off the end of the C function or returning with no
value works in the expected way.  It's not good code, but it probably works.

Working from that assumption I decided to just use a pragma to disable the
upgraded diagnostic from GCC -- essentially preserving existing behavior.

This is the only fr30 specific issue that needs to be resolved and the only
issue (so far) I've seen of this specific nature.
dscho added a commit to dscho/msys2-runtime that referenced this pull request Aug 30, 2024
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Sep 5, 2024
Allow native symlinks to non-existing targets in 'nativestrict' mode
dscho added a commit to dscho/msys2-runtime that referenced this pull request Sep 18, 2024
Allow native symlinks to non-existing targets in 'nativestrict' mode
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.

2 participants