git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] test: make SYMLINKS prerequisite more robust

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2023, 18:07 UTC
Message-ID
<xmqq7cwlcucg.fsf@gitster.g>
In-Reply-To
<ef19e164-b0ba-531d-95e6-75ef61c4fc9d@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 17 quoted lines
>> Whatever magic you used to fix these failing tests, thanks.
>
> The magic was to pester the maintainers of the dependency of the
> `setup-git-for-windows-sdk` GitHub Action that broke said action.
>
> Background (you can skip this unless you're interested in details):
>
> Since Git's test suite relies so heavily on Unix shell
> scripting, which is really foreign on Windows, we have to use the MSYS2
> Bash to run it. And when I say "MSYS2 Bash", it is short-hand for "a Bash
> that uses the POSIX emulation layer provided by the MSYS2 runtime".
>
> The MSYS2 runtime _does_ have support for actual symbolic links, it just
> depends on certain Windows features (and then it still is not quite the
> same as Unix symbolic links because on Windows, the symbolic links are
> either pointing to files or to directories and you have to specify that
> when creating them).

OK, so bash runtime accidentally enabled symbolic links. But of course "git" thinks that Windows never do symbolic links by having {ENOSYS; return -1;} in compat/mingw.h for readlink and symlink, running any git operation that depends on SYMLINKS prerequisite would not work and that is where it fails. We do not even have to hit a test that points a symbolic link at any special file.

Thanks for fixing the environment. The patch in the thread only meant to ensure that the test suite does not get fooled by only bash supporting symbolic links without updating "git" supporting any by being more careful. Now "test -h" and "ln -s" behave without contradiction with readlink(2)/symlink(2) emulation "git" uses, we can safely drop it.

Previous: Johannes Schindelin
Message 9 of 9 in “test: make SYMLINKS prerequisite more robust”
  1. test: make SYMLINKS prerequisite more robustJunio C Hamano, Feb 8, 2023
  2. Ævar Arnfjörð BjarmasonFeb 8, 2023
  3. Junio C HamanoFeb 9, 2023
  4. Ævar Arnfjörð BjarmasonFeb 9, 2023
  5. Junio C HamanoFeb 9, 2023
  6. Junio C HamanoFeb 10, 2023
  7. Ævar Arnfjörð BjarmasonFeb 10, 2023
  8. Johannes SchindelinFeb 13, 2023
  9. Junio C HamanoFeb 13, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.