Skip to content
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

Workaround missing /usr/bin/wine64. #2035

Merged

Conversation

jre-wine
Copy link
Contributor

@jre-wine jre-wine commented Feb 25, 2023

Workaround case where wine and related binaries are in /usr/bin, but wine64 is only in Wine's bindir (as in Debian wine 8.0~repack-4). Use /usr/bin/wineboot (which is a symlink in Debian packaging) to figure out the bindir, because /usr/bin/wine is a wrapper script in Debian.

See discussion in https://bugs.debian.org/1031649.

I'm not sure if this already should be added in Winetricks, probably this depends on the next set of Debian Wine packages. For now I applied this patch in Debian.

Tested with the deb packages from Debian wine 8.0~repack-2 and 8.0~repack-4, and Winehq winehq-staging 8.2~bookworm-1.

@jre-wine jre-wine force-pushed the Workaround_missing_/usr/bin/wine64 branch 3 times, most recently from f9418a4 to 872c944 Compare February 26, 2023 20:43
@austin987
Copy link
Contributor

I appreciate the patch, but not everyone has wine installed in /usr/bin ;).

This will need a more general solution (see also #2030).

@Gcenx
Copy link
Contributor

Gcenx commented Mar 7, 2023

Also only the gnu version of readlink supports -f, using that option would effectively break winetricks on platforms that don’t use gnu utility’s.

@austin987
Copy link
Contributor

Also only the gnu version of readlink supports -f, using that option would effectively break winetricks on platforms that don’t use gnu utility’s.

FWIW, the version of readlink that I see on macOS 12.6 (gcc104 from https://cfarm.tetaneutral.net/machines/list/):
macOS 12.6 June 22, 2017 macOS 12.6

supports readlink -f. Do you happen to know if that is recent in OSX/in other versions? The binary there is from /usr/bin, and comes from BSD, so I don't think it's homebrew/etc. thing, but I could definitely be wrong.

@Gcenx
Copy link
Contributor

Gcenx commented Mar 8, 2023

Hum readlink -f does work on macOS Ventura (13.x) but it doesn’t work on macOS Mojave (14.x)

So maybe macOS Monterey (12.x) and macOS Ventura (13.x) have a new enough version of readlink.

Might need to require coreutils package on macOS for greadlink for legacy versions of macOS.

@jre-wine
Copy link
Contributor Author

jre-wine commented Mar 8, 2023

I just want to clarify that Winetricks won't be "broken" if readlink -f is not working. Only this specific workaround wouldn't work.
And of course this workaround is only a fix for a specific setup as in current Debian unstable, but it is no fix for a completely missing wine64 as we might see if wine is compiled the new way (--enable-archs=i386,x86_64).

@austin987
Copy link
Contributor

Does austin987@05c43b5 work for the debian package?

@jre-wine
Copy link
Contributor Author

jre-wine commented Mar 12, 2023

Unfortunately not, even with the -preloader packages installed. Their binaries are also only installed to Wine's bindir (I just had a quick glance at the commit, but I assume that's the issue).

$ wine --version 
wine-8.0 (Debian 8.0~repack-4)
$ ./src/winetricks
------------------------------------------------------
warning: Unknown wine-loader binary type ("cannot open `' (No such file or directory)"). Please open a bug and attach output of "./src/winetricks -v"
------------------------------------------------------
$ ./src/winetricks -v
[...]
+ latest_version=20230212
+ echo 20230212
+ grep -q -E [0-9]{8}
+ [ -z 20230212 ]
+ [ ! 20230212-next = 20230212 ]
+ [ ! 20230212-next = 20230212-next ]
+ W_ISO_MOUNT_ROOT=/mnt/winetricks
+ W_ISO_USER_MOUNT_ROOT=/home/jens/winetricks-iso
+ W_ISO_MOUNT_LETTER=i
+ WINE=wine
+ command -v wine-preloader
+ dirname wine
+ test -x 
+ test -x wine-preloader
+ test -x 
+ test -x ./loader/wine-preloader
+ file 
+ _W_file_output=cannot open `' (No such file or directory)
+ w_die Unknown wine-loader binary type ("cannot open `' (No such file or directory)"). Please open a bug and attach output of "./src/winetricks -v"
+ w_warn Unknown wine-loader binary type ("cannot open `' (No such file or directory)"). Please open a bug and attach output of "./src/winetricks -v"
+ [ -z  ]
+ printf %s\nwarning: %b\n%s\n ------------------------------------------------------ Unknown wine-loader binary type ("cannot open `' (No such file or directory)"). Please open a bug and attach output of "./src/winetricks -v" ------------------------------------------------------
------------------------------------------------------
warning: Unknown wine-loader binary type ("cannot open `' (No such file or directory)"). Please open a bug and attach output of "./src/winetricks -v"
------------------------------------------------------
+ test 
+ unset _W_timeout
+ exit 1
+ winetricks_cleanup
+ test 
+ set +e
+ test -f /tmp/winetricks.lohAWTaw/w.jens.103921/dd-pid
+ test 
+ [  = 1 ]

@Chiitoo Chiitoo mentioned this pull request Nov 5, 2023
@Chiitoo Chiitoo linked an issue Nov 5, 2023 that may be closed by this pull request
@kenorb
Copy link
Contributor

kenorb commented Jan 21, 2024

I've tested on the latest Debian Docker container and PR seems to fix the problems as per #2119 (comment).

@melroy89
Copy link
Contributor

melroy89 commented Feb 18, 2024

I have the same problem with WineGUI, it impact various distros now. And you're indeed correct there is no wine64 binary, but only a wine wrapper script.

I hope a final solution can soon be released for Winetricks, solving this urgent issue once and for all.

@jre-wine jre-wine force-pushed the Workaround_missing_/usr/bin/wine64 branch 2 times, most recently from f1ed0c9 to f77baf6 Compare February 18, 2024 14:23
@jre-wine
Copy link
Contributor Author

jre-wine commented Feb 18, 2024

I updated this PR for both issues mentioned here before:

Instead of hardcoding /usr/bin/wineboot I use WINESERVER_BIN to figure out wineboot's path. If this doesn't work there shouldn't be a regression, just a missed opportunity to figure out where wine64 might be after other attempts also failed.

readlink exists on MacOS, but does not support "-f" on MacOS < 12.3. So I use perl there now.
I use "perl" without checking if it is installed at all. (Even though it is installed on MacOS per default since a certain version that I forgot, it still might've been uninstalled). But perl is already used in other places of Winetricks without special checks, and it looks cleaner that way.

There are further readlink-related optimizations possible which I might implement with the help of some MacOS users if someone thinks it's worth the effort (I don't). See https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac

  • If we know the MacOS version, we might use "readlink -f" on current MacOS.
  • If I know the exact syntax and filepath we might use greadlink (provided by a separate package)
  • As fallback we might use "stat" - but the syntax I found on the web doesn't work on Linux.

Feedback and testing welcome, especially from MacOS users.

EDIT: the new commit b449a07 below just fixes the commit message, no changes.

@jre-wine jre-wine force-pushed the Workaround_missing_/usr/bin/wine64 branch from f77baf6 to b449a07 Compare February 18, 2024 15:22
@jre-wine
Copy link
Contributor Author

Updated to allow for parent dirs containing wineserver in their name (same as in PR 2189)
Now I use dirname for the dir, and basename+sed for the filename (to allow for suffixes in the filename.

@melroy89
Copy link
Contributor

Hopefully @austin987 now agrees with this.

@jre-wine jre-wine force-pushed the Workaround_missing_/usr/bin/wine64 branch from 9b0b98c to 2b71d0e Compare February 23, 2024 02:46
@jre-wine
Copy link
Contributor Author

I moved the basics for determining Wine's bindir (readlink and wineboot) to a place where it can be used both for determining the wineserver and wine arch (#2189), and the wine64-only-in-BINDIR workaround (this PR). These basics are in a seperate commit that is shared by both PRs.

Copy link
Contributor

@austin987 austin987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Chiitoo, and sorry for the delay in reviewing!

@austin987 austin987 merged commit 0dc7677 into Winetricks:master May 9, 2024
5 checks passed
@jre-wine jre-wine deleted the Workaround_missing_/usr/bin/wine64 branch May 9, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wont run in ubuntu 23.04
5 participants