-
Notifications
You must be signed in to change notification settings - Fork 38
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 #192
Merged
dscho
merged 2 commits into
msys2:msys2-3.4.10
from
dscho:prevent-different-msys2-runtime-versions-from-sharing-cygheaps
Jul 8, 2024
Merged
Prevent different MSYS2 runtime versions from sharing cygheaps #192
dscho
merged 2 commits into
msys2:msys2-3.4.10
from
dscho:prevent-different-msys2-runtime-versions-from-sharing-cygheaps
Jul 8, 2024
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
It frequently leads to problems when trying, say, to call from MSYS2's Bash into Cygwin's or Git for Windows', merely because sharing that data is pretty finicky. For example, using the MSYS2' Bash using the MSYS2 runtime version that is current at time of writing, trying to call Cygwin's programs fails in manners like this: $ /c/cygwin64/bin/uname -r 0 [main] uname (9540) child_copy: cygheap read copy failed, 0x800000000..0x800010BE0, done 0, windows pid 9540, Win32 error 6 680 [main] uname 880 C:\cygwin64\bin\uname.exe: *** fatal error - couldn't create signal pipe, Win32 error 5 with the rather misleading exit code 127 (a code which is reserved to indicate that a command was not found). Let's just treat the MSYS2 runtime and the Cygwin runtime as completely incompatible with one another, by virtue of using a different magic constant than merely `CHILD_INFO_MAGIC`. By using the msys2-runtime commit to modify that magic constant, we can even spawn programs using a different MSYS2 runtime (such as Git for Windows') because the commit serves 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. 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 to encode brackets in `configure.ac` files otherwise. Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
@lazka @Biswa96 @jeremyd2019 any thoughts whether to merge this now, or hold off until after switching to MSYS2 runtime v3.5.0? |
@Biswa96 was that a 👍 for merging now, or a 👍 for holding off until v3.5.0? |
I'd prefer to wait a bit |
I can not see any potential issue with this change. So, 👍 for merging it. |
I'm fine with merging this, still ok? |
dscho
deleted the
prevent-different-msys2-runtime-versions-from-sharing-cygheaps
branch
July 8, 2024 07:42
dscho
added a commit
to dscho/MSYS2-packages
that referenced
this pull request
Jul 8, 2024
Looks like we haven't updated `MSYS2-packages`' `msys2-runtime-3.4` directory in quite a while. This roll-up integrates: - msys2/msys2-runtime#205 - msys2/msys2-runtime#209 - msys2/msys2-runtime#210 - msys2/msys2-runtime#192 Signed-off-by: Johannes Schindelin <[email protected]>
dscho
added a commit
to dscho/MSYS2-packages
that referenced
this pull request
Jul 9, 2024
Looks like we haven't updated `MSYS2-packages`' `msys2-runtime-3.4` directory in quite a while. This roll-up integrates: - msys2/msys2-runtime#192 - msys2/msys2-runtime#205 - msys2/msys2-runtime#209 - msys2/msys2-runtime#210 - msys2/msys2-runtime#220 Signed-off-by: Johannes Schindelin <[email protected]>
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 allows users to run Cygwin programs from an MSYS2 Bash even when the MSYS2 runtime version corresponds to the Cygwin runtime version used by those Cygwin programs.
Incidentally, it also allows calling Git for Windows' Bash from the MSYS2 Bash.