-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Fix architecture detection mechanism for wrapper scripts #2189
Conversation
a5a9a02
to
2e606b3
Compare
2e606b3
to
187d7c0
Compare
Please check also |
187d7c0
to
8c1811c
Compare
I'm not familiar with all requirements for handling new and classic wow64 mode. If your solution is sufficient I'd be happy to see my PR be rejected (except the output to stderr commit). |
I would suggest to send output to stderr commit in a separate PR. As I see, it is arch independent issue. |
This is especially needed if called inside redirected code to assign variables. Currently there's an issue where in case of an error winetricks_get_file_arch erroneously assigns the error message of w_die to the variable instead of showing it in the terminal. w_die calls w_warn, so we need to fix w_warn. The missing error message on the terminal goes unnoticed unless it is also shown in the GUI. Since the general start-the-gui logic is after winetricks_get_file_arch, this only happens here if "--gui" was specified explicitly. Still in both cases the error message erroneously gets assigned to the variable. w_warn already had this until f34f34b winetricks: introduce $WINETRICKS_SUPER_QUIET to silence some output that breaks winetricks-test Although I see no current issues I also changed w_askpermission, w_info, w_try, and w_read_key for consistency. Except w_try they all output the same message also to the GUI. w_warn_cancel and w_question already output on stderr.
c36accf
to
afe3fcf
Compare
I updated this PR again to only warn but not exit in case of failure, as it doesn't solve all script related issues (e.g. protontricks #2183). However now Winetricks correctly and explicitly warns that it couldn't detect the wow64 type, instead of randomly choosing either classic or new wow64 type as current official Winetricks does. To simplify the code I changed winetricks_get_file_arch to just silently return nothing in case of failure (instead of returning "try-script" as in my previous implementation, and instead of warning about this as current Winetricks does). So the calling function (winetricks_set_wineprefix) is free to try workarounds without annoying the user with warnings. I'll make a separate PR for the stderr if you object this PR here. However I see no potential for regressions even if it doesn't solve all issues. So as long as you don't replace the whole logic with something else please accept this PR. Finally this PR is still set to "Changes requested". No idea how to get rid of this, please review @austin987 (hope you find the time for it, greets!) |
afe3fcf
to
9fcca49
Compare
Minor update: I moved my new warning about an unknown WoW64 type next to the existing warning about the new mode WoW64 type. So it will be only shown once per session. |
Hi @jre-wine, This doesn't work for me with a Debian Wine package:
I've attached a log with |
Hi @austin987 , great to see you back! That problem is because of the missing /usr/bin/wine64 in Debian and is fixed by #2035. |
Thanks, I tested this in several configurations (32/64bit, old/new wow, a few different versions) and saw no regressions. I appreciate your patience and making it non-Debian specific :). |
There are 2 general issues related to this fix, each handled in a separate commit:
winetricks: display messages for users to stderr
winetricks_get_file_arch: try workaround for wrapper scripts
winetricks_set_wineprefix: warn if binary arch is unknown
Please have a look at the detailed commit messages. E.g. not all of the stderr stuff is needed.
Feedback welcome!
3 open questions:
"readlink -f" is not working on MacOS < 12.3
(https://apple.stackexchange.com/questions/464136/which-macos-version-introduced-readlink-f)
Alternatives are:
(See https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac)
For now I just use the perl alternative on MacOS. I think that's sufficient, but if wanted and with the help of some MacOS users I might add some changes:
Whatever we do, even if the implemented readlink alternative fails, there still shouldn't be a regression, because if "readlink -f" or the alternative is non-functional all error messages (as long as they are on stderr) go to /dev/null and the output should be empty. Then the binaries would be tested directly in "/" (where they really shouldn't exist), and the same "Unknown file arch" would result as without this code.
Should I factor the readlink logic out? [EDIT: Done]
Since this PR uses the same readlink logic as in Workaround missing /usr/bin/wine64. #2035 I might combine both PRs and factor this out to deduplicate code. Please tell me if I should do so.
Should I warn, exit or completely ignore if the binary arch is unknown? [EDIT: Done: exit/w_die]
For now I only warn, but continue.
Depending on whether the user has an old or new style WoW64 setup, this still might give the correct outcome accidentally. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1063466
Once we're satisfied that my fix works I suggest to use w_die instead.