forked from Alexpux/Cygwin
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Prevent different msys2 runtime versions from sharing cygheaps, take two #49
Merged
dscho
merged 2 commits into
git-for-windows:main
from
dscho:prevent-different-msys2-runtime-versions-from-sharing-cygheaps-take-two
Feb 22, 2023
Merged
Prevent different msys2 runtime versions from sharing cygheaps, take two #49
dscho
merged 2 commits into
git-for-windows:main
from
dscho:prevent-different-msys2-runtime-versions-from-sharing-cygheaps-take-two
Feb 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dscho
force-pushed
the
prevent-different-msys2-runtime-versions-from-sharing-cygheaps-take-two
branch
from
February 21, 2023 16:15
06a54cb
to
88ca9fd
Compare
Avoid sharing cygheaps across Cygwin versions It frequently leads to problems when trying, say, to call from Git for Windows' Bash into Cygwin's or MSYS2's, merely because sharing that data is pretty finicky. For example, using the Git for Windows that is current at time of writing, trying to call MSYS2's Bash from Git for Windows' Bash fails somewhere in `_cmalloc()`, without any error message, and with the rather misleading exit code 127 (a code which is reserved to indicate that a command was not found). Let's just treat these as completely incompatible with one another, by virtue of using a different `CHILD_INFO_MAGIC` constant. Let's take the msys2-runtime commit as the tell-tale whether two MSYS2 runtime versions are compatible with each other. To support building in the MSYS2-packages repository (where we do not check out the `msys2-runtime` but instead check out Cygwin and apply patches on top), let's accept a hard-coded commit hash as `./configure` option. One consequence is that spawned MSYS processes using a different MSYS2 runtime will not be visible as such to the parent process, i.e. they cannot share any resources such as pseudo terminals. But that's okay, they are simply treated as if they were regular Win32 programs. This should also help the scenario where interactions between two different versions of Git for Windows lead to those infamous `cygheap base mismatch detected` problems mentioned e.g. in git-for-windows/git#4255 Note: We have to use a very rare form of encoding the brackets in the `expr` calls: quadrigraphs (for a thorough explanation, see https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/html_node/Quadrigraphs.html#Quadrigraphs). This is necessary because it is apparently impossible in `configure.ac` files to encode brackets otherwise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Having just Cygwin's version in the output of `uname` is not helpful as both MSYS2 as well as Git for Windows release intermediate versions of the MSYS2 runtime much more often than Cygwin runtime versions are released. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho
force-pushed
the
prevent-different-msys2-runtime-versions-from-sharing-cygheaps-take-two
branch
from
February 21, 2023 16:20
88ca9fd
to
bec3d60
Compare
dscho
added a commit
to dscho/MSYS2-packages
that referenced
this pull request
Feb 21, 2023
With this change, we prepare the `./configure` call to make use of the new feature of the MSYS2 runtime to report the current msys2-runtime commit, and also to use it when determining whether another MSYS2 runtime instance's cygheap is compatible with the current MSYS2 runtime. This requires git-for-windows/msys2-runtime#49 patches to be brought into MSYS2-packages before it has any effect. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho
added a commit
to dscho/MSYS2-packages
that referenced
this pull request
Feb 21, 2023
This brings the patches of git-for-windows/msys2-runtime#49 into MSYS2-packages. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho
added a commit
to dscho/MSYS2-packages
that referenced
this pull request
Feb 21, 2023
With this change, we prepare the `./configure` call to make use of the new feature of the MSYS2 runtime to report the current msys2-runtime commit, and also to use it when determining whether another MSYS2 runtime instance's cygheap is compatible with the current MSYS2 runtime. This requires git-for-windows/msys2-runtime#49 patches to be brought into MSYS2-packages before it has any effect. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho
added a commit
to dscho/MSYS2-packages
that referenced
this pull request
Feb 21, 2023
This brings the patches of git-for-windows/msys2-runtime#49 into MSYS2-packages. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho
deleted the
prevent-different-msys2-runtime-versions-from-sharing-cygheaps-take-two
branch
February 22, 2023 08:14
dscho
added a commit
to dscho/msys2-runtime
that referenced
this pull request
May 12, 2023
…ys2-runtime-versions-from-sharing-cygheaps-take-two Prevent different msys2 runtime versions from sharing cygheaps, take two
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up for #48 designed to address part of git-for-windows/git#4305 by encoding the msys2-runtime commit in the magic constant used to figure out whether we can use "another MSYS2 runtime"'s cygheap or not.
At least in this developer's tests, adding the git-sdk-64's
usr/bin
to thePATH
and fixed the exit code 127 seen when running& 'C:\Program Files\Git\usr\bin\tar.exe' tzvf .\x.tgz
in a PowerShell.