-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[2.23.0] bash: /dev/fd/62: No such file or directory #2291
Comments
In a dumb, just copy the commands, mode, I was able to repeat the exercise. I then tried:
(the fd number is one higher, 63 rather than 62.) I suspect that this because of the Cygwin update in the release notes. However, as someone who is not a happy scripter, I wasn't sure what the command hoped to do anyway. Perhaps you could describe your expectation and decompose what you hoped it would do? |
Can you open Git Bash as administrator, call |
@dscho On my machine (git opened as admin):
Just a data point... |
of course the command with "cat" is just an example, I use "< <(..)" usually to insert elements in an array, but "cat" is a simple and short example. yes, this breaks all my scripts, where I use "< <(..)"
whether admin or not, it is in read-only mode I tried:
but the answer is always the same:
|
Okay, this is what I did, inspired by https://sourceware.org/ml/cygwin/2009-02/msg00389.html:
After that, things seemed to work for me. Note: it is important to create the directory outside of Git Bash, as the MSYS2 runtime pretends that that directory exists even if it doesn't. And the Can you try that? If that fixes the problems, maybe you would be interested in working on a patch to |
This has broken many of my scripts as well. Seems there should be a bash postinstall script like this that should run to automatically pre-create these device links. What changed between 2.22 and 2.23? |
Thanks mate, now works perfectly!
I don't know very well how git-bash could run as an administrator on inno setup during installation to run a postinstall as stepro says |
Also worked for me [my data point]. I.e.
Earlier, in a regular (non-admin) bash shell (V2.23.0) I'd seen, (by chance, I'd forgotten to cd back to my repo)
which at least confirms the underlying Cygwin aspect of the virtual file system at that point. |
Clearly some part of the 2.22 installation used to do this. I reverted back and my /dev directory looks like this:
In the new installation, there are no symbolic links. Workarounds are great, but this needs to be addressed at the source. Fundamental aspects of Bash assume the existence of these links, as pointed out here, e.g.:
|
The solution will be to have the InnoSetup-based installer create this directory before the post-install script runs (I already pointed out why that shell script cannot create it). I trust you folks to make this happen, in a PR to the build-extra repository, changing |
This doesn't fix the root cause, since |
The latest installs of cygwin and msys2 seem fine, |
@stepro go to town, then! For starters, you might want to unpack portable versions of the working vs non-working Git for Windows, then investigate the differences in the You will want to unpack the portable Git's via 7-Zip, though, and then prevent the |
Thanks @dscho, these links are very helpful. I'll take a look. |
Ok, the root cause comes from this change, which alters the behavior of Previously,
Because this script has no error handling, the Git for Windows installer thinks that Why is this not failing in MSYS2 itself? Because the current installer is from May 24 and the patch wasn't committed to Cygwin until June 5. Why is this not failing in Cygwin installs? Same deal - the latest Cygwin installer puts down a cygwin1.dll (where the compiled code that was patched lives) from April 30. So, this problem is likely to start showing up in MSYS2 and Cygwin if they don't do something about it. Who can be contacted about ensuring those projects don't break? Git for Windows seems ahead of the game by shipping a newer version of Cygwin than Cygwin itself that already manifests the issue. If folks from Cygwin agree that the right fix for this is for a given installer to manually create the directory beforehand, then that's what should be done. Otherwise, it could be added to the Git for Windows installer as a temporary workaround until a new version of Cygwin is picked up that properly accounts for it. |
@stepro excellent analysis, I am impressed!
For Cygwin, I would suggest following https://cygwin.com/problems.html, for MSYS2 I would suggest opening a ticket in https://github.com/msys2/MSYS2-packages.
I actually think that it might make most sense for the installers/archives to already include that directory. Originally, I thought |
Would it be prudent to have a patch revert that change for this project in the meantime (while following up or waiting on upstream projects)? |
The commit message of that patch suggests that it fixes a real problem, though... So I'd vote for not reverting it ;-) |
Yeah that's fair. I'm uncertain what was actually happening when we were allowed to clobber-create it before and how exactly it avoided this:
|
Is the following a valid work-around? Changing this line in the cited 01-devices.post shell script:
to be:
That presumes that "sed" and "cygpath" are available, and that using the dev dir's real-filesystem path would avoid the new /dev interference. (I don't have a broken version of cygwin to try that out.) If you decide to use something like that, be sure to add a sanity-check of the resulting value, since you don't want the upcoming |
Ok, I've confirmed with Cygwin folks that they will not have the problem, because their setup explicitly creates the directory prior to running post-install scripts. Their recommendation is for the Git for Windows setup to create the directory. @dscho, I can try to figure this out, but it will take some time and probably isn't going to be the most efficient use of time. If someone else knows exactly where in the InnoSetup stuff directories are defined to be created, and is already knowledgeable on how to test setup, it would go much faster. |
I bet you can just add it to the For the portable Git, I think you will want to create it just like For MinGit, it would probably be here: https://github.com/git-for-windows/build-extra/blob/b53ba0e5f0d60143a57e9b28ba434c66208901d5/mingit/release.sh#L64-L65 For the NuGet package, I think you'd need to add <file src="$buildextra$\nuget\empty\" target="tools\dev" /> Funnily enough, the To test, you can download and install Git for Windows' SDK (caveat: will take a while), then call Of course, for good measure I would actually create not only the And maybe, just maybe, it would be possible to create the
It should be not a problem at all to write this file at the beginning of the post-install actions, via function GetFileAttributes(lpFileName: PAnsiChar): DWORD;
external '[email protected] stdcall';
function SetFileAttributes(lpFileName: PAnsiChar;
dwFileAttributes: DWORD): BOOL;
external '[email protected] stdcall';
procedure SetSystemBit(FileName : String);
var
Attr : DWord;
begin
Attr := GetFileAttributes(FileName);
if not (Attr and 4) = 4 then
begin
Attr := Attr or 4;
SetFileAttributes(FileName,Attr);
end;
end; @stepro please do help. I already cut into my relax time just researching these pointers. I know you can get it done. |
@dscho thanks for all the detailed information. I had no idea there were so many places to change! I can take a look. Cygwin creates /dev, /dev/shm and /dev/mqueue but not the fd files - they leave that to post-install. Even /dev/shm and /dev/mqueue don't need to be created prior to post-install, so for the sake of keeping things simple I'll probably make the smallest change I can to get things working, at least at first, to minimize possible regression elsewhere. |
I submitted a PR (git-for-windows/build-extra#255). |
I think... that the PR's message (git-for-windows/build-extra#255) should include a |
- choco install python3 will install the latest version of python on the 3.x line, so since 3.8 came out, this breaks. - git-for-windows/git#2291 broke codecov reporting, so there's a workaround until git-for-windows cuts a new release. Test plan: watch Windows travis build
- choco install python3 will install the latest version of python on the 3.x line, so since 3.8 came out, this breaks. - git-for-windows/git#2291 broke codecov reporting, so there's a workaround until git-for-windows cuts a new release. Test plan: watch Windows travis build
- choco install python3 will install the latest version of python on the 3.x line, so since 3.8 came out, this breaks. - git-for-windows/git#2291 broke codecov reporting, so there's a workaround until git-for-windows cuts a new release. Test plan: watch Windows travis build
I've just installed version |
This indeed looks like it is the same issue as described in #2388. Please do consider using the next pre-release cycles to test for things like this, before they hit a full release. Thanks. |
Setup
defaults?
to the issue you're seeing?
Details
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Note: on '2.22.0' works fine
The text was updated successfully, but these errors were encountered: