Skip to content

Commit

Permalink
Implicitly support the /dev/fd symlink and friends
Browse files Browse the repository at this point in the history
Bash has a very convenient feature that is called process substitution
(e.g. `diff -u <(seq 0 10) <(seq 1 11)`). To make this work, Bash
requires the `/dev/fd` symlink to exist, and MSYS2 and Cygwin therefore
create this symlink (together with the `stdin`, `stdout` and `stderr`
ones) upon start-up.

This strategy is a bit incompatible with Git for Windows, which wants to
install the pseudo root into a write-protected area, concretely in
`C:\Program Files\Git`.

This strategy is _also_ incompatible with the idea of providing MinGit
as a `.zip` file (because there is no standard way to represent symlinks
in `.zip` files, and besides, older Windows versions would potentially
lack support for them anyway).

Let's side-step this completely by creating those symlinks implicitly,
similar to the way `/dev/` is populated with special devices.

The diff is misleadlingly large due to the re-generated `devices.cc`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed May 3, 2022
1 parent 6f77ef6 commit 420ac7d
Show file tree
Hide file tree
Showing 7 changed files with 879 additions and 707 deletions.
1 change: 1 addition & 0 deletions winsup/cygwin/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ DLL_FILES= \
fhandler_console.cc \
fhandler_cygdrive.cc \
fhandler_dev.cc \
fhandler_dev_fd.cc \
fhandler_disk_file.cc \
fhandler_dsp.cc \
fhandler_fifo.cc \
Expand Down
Loading

0 comments on commit 420ac7d

Please sign in to comment.