Bug 278525 - emulators/wine: /usr/local/share/wine/pkg32.sh error updating repositories
Summary: emulators/wine: /usr/local/share/wine/pkg32.sh error updating repositories
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
: 280085 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-22 09:35 UTC by Eduardo C.
Modified: 2024-09-04 15:22 UTC (History)
9 users (show)

See Also:
gerald: maintainer-feedback-


Attachments
0001-emulators-wine-Fix-pkg32.sh.patch (1.10 KB, patch)
2024-04-23 17:37 UTC, Alexander Vereeken
no flags Details | Diff
0001-emulators-wine-Fix-pkg32.sh.patch (5.17 KB, patch)
2024-05-04 16:04 UTC, Alexander Vereeken
no flags Details | Diff
0001-emulators-wine-Fix-pkg32.sh.patch (5.21 KB, patch)
2024-05-04 17:00 UTC, Alexander Vereeken
Alexander88207: maintainer-approval? (gerald)
Alexander88207: maintainer-approval? (iwtcex)
Details | Diff
patch-dlls_ntdll_unix_loader.c fixed (821 bytes, patch)
2024-05-06 04:36 UTC, Alex S
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo C. 2024-04-22 09:35:01 UTC
After upgrading my packages using the pkg program I went to /usr/local/share/wine to update my 32bit wine packages and after running ./pkg32.sh upgrade I've got this error:

$ ./pkg32.sh upgrade                    
pkg -o ABI=FreeBSD:14:i386 -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir /home/idude/.i386-wine-pkg upgrade
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    178 B   0.2kB/s    00:01    
Fetching data.pkg: 100%    7 MiB   1.2MB/s    00:06    
Processing entries:   0%
pkg: Newer FreeBSD version for package zziplib:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1400097
- running kernel: 0

pkg: repository FreeBSD contains packages for wrong OS version: FreeBSD:14:i386
Processing entries:   0%
Unable to update repository FreeBSD
Error updating repositories!
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2024-04-22 20:34:34 UTC
I have never used this 32-/64-bit contraption though included it for
the sake of those submitting and using it.

Alexander, Sean, Dwayne, Alistair, do you have any thoughts for Eduardo?
Comment 2 Dwayne MacKinnon 2024-04-22 21:20:34 UTC
(In reply to Eduardo C. from comment #0)
Hi Eduardo,

The error message suggests a mismatch between the version of FreeBSD that you're running and the version that built the packages. Can you report the output of

sysctl kern.osreldate

please?

If it returns 1400097 I would suggest removing everything from your .i386-wine-pkg directory and trying a fresh install with `pkg32.sh install` .
Comment 3 Eduardo C. 2024-04-22 22:10:15 UTC
(In reply to Dwayne MacKinnon from comment #2)

Hello Dwayne,

I ran that command and returns 1400097.  I deleted .i386-wine-pkg directory and ran 'pkg32.sh install wine mesa-dri', I got exactly the same error!
Comment 4 Eduardo C. 2024-04-22 22:15:51 UTC
(In reply to Dwayne MacKinnon from comment #2)
I forgot to mention that I use pkg install to install all my packages, I'm not building the ports locally.
Comment 5 Dwayne MacKinnon 2024-04-23 00:29:35 UTC
(In reply to Eduardo C. from comment #4)

Ok. Could you post the contents of /etc/pkg/FreeBSD.conf ?
Comment 6 Sean Farley freebsd_committer freebsd_triage 2024-04-23 04:02:42 UTC
I build locally and also see the same message:

To ignore this error set IGNORE_OSVERSION=yes
- package: 1400510
- running kernel: 0

$ sysctl kern.osreldate
kern.osreldate: 1400510

My system is stable/14-n267222-89dd0612d933.

Could it be the latest pkg (v1.21.2)?
Comment 7 Dwayne MacKinnon 2024-04-23 04:19:01 UTC
(In reply to Sean Farley from comment #6)
I'm running into the same thing updating my local i386 repository. I agree, this is looking like a problem with pkg.
Comment 8 Eduardo C. 2024-04-23 14:07:51 UTC
(In reply to Dwayne MacKinnon from comment #5)

My /etc/pkg/FreeBSD.conf:

FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}

My /usr/local/etc/pkg/repos/FreeBSD.conf:

FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
Comment 9 Alexander Vereeken freebsd_triage 2024-04-23 17:37:53 UTC
Created attachment 250187 [details]
0001-emulators-wine-Fix-pkg32.sh.patch

Hello,

this patch should fix the issue.

Regards.
Comment 10 Eduardo C. 2024-04-24 00:17:28 UTC
(In reply to Alexander Vereeken from comment #9)

The ones using pkg command we still have to wait for the new wine to be packaged with this patch, correct?
Comment 11 Eduardo C. 2024-04-24 00:29:47 UTC
(In reply to Alexander Vereeken from comment #9)
I tried with other versions of wine including wine8 and I still get the same error.
Comment 12 Alexander Vereeken freebsd_triage 2024-04-24 04:27:45 UTC
(In reply to Eduardo C. from comment #10)

You can just edit this script by hand with an editor.
Comment 13 Eduardo C. 2024-04-24 10:56:08 UTC
(In reply to Alexander Vereeken from comment #12)
I can't script, I wouldn't know what to expect if I did any editing!
Comment 14 Eduardo C. 2024-04-24 11:19:21 UTC
(In reply to Alexander Vereeken from comment #12)
After playing with it a bit I decided to edit /usr/local/share/wine/pkg32.sh and added those lines that you have in the script to look like this:

ABI=$(pkg config ABI | sed s/amd64/i386/)
OSVERSION=$(pkg config OSVERSION)
PKG_DBDIR=$I386_ROOT/var/db/pkg
# Show what we're going to do, then do it.
echo pkg -o ABI="$ABI" -o OSVERSION="$OSVERSION" -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@"
exec pkg -o ABI="$ABI" -o OSVERSION="$OSVERSION" -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@"

and it worked and it upgrade just fine but now when I run winefile I get this error:

$ winefile
0024:fixme:ntdll:create_logical_proc_info stub
0024:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
002c:fixme:ntdll:create_logical_proc_info stub
002c:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
wine: failed to load L"\\??\\C:\\windows\\system32\\ntdll.dll" error c0000135
0024:err:environ:run_wineboot failed to start wineboot c00000e5
0034:fixme:ntdll:create_logical_proc_info stub
0034:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
wine: failed to load L"\\??\\C:\\windows\\system32\\ntdll.dll" error c0000135
003c:fixme:ntdll:create_logical_proc_info stub
003c:fixme:ntdll:init_cpu_info Failed to get logical processor information, status 0xc0000002.
003c:err:module:import_dll Library coml2.dll (which is needed by L"C:\\windows\\syswow64\\ole32.dll") not found
003c:err:module:import_dll Library ole32.dll (which is needed by L"C:\\windows\\syswow64\\winefile.exe") not found
003c:err:module:loader_init Importing dlls for L"C:\\windows\\syswow64\\winefile.exe" failed, status c0000135
Comment 15 Alexander Vereeken freebsd_triage 2024-04-24 13:53:39 UTC
(In reply to Eduardo C. from comment #14)

Which wine version?
Comment 16 Eduardo C. 2024-04-24 13:56:37 UTC
(In reply to Alexander Vereeken from comment #15)
The new error is on version 9.0,1
Comment 17 Alexander Vereeken freebsd_triage 2024-04-24 14:21:49 UTC
(In reply to Eduardo C. from comment #16)

You need to use wine8 for now, the newest version isn't patched for wow64 functionality.
Comment 18 Mark Linimon freebsd_committer freebsd_triage 2024-04-25 05:33:46 UTC
^Triage: canonicalize assignment.
Comment 19 Alexander Vereeken freebsd_triage 2024-05-04 16:04:50 UTC
Created attachment 250371 [details]
0001-emulators-wine-Fix-pkg32.sh.patch

Hello,

i have discussed (via Discord) this change with Alex S and this patch is now the final result.

Regards.
Comment 20 Alex S 2024-05-04 16:30:56 UTC
Can we change `env ABI_FILE=/usr/lib32/libc.so.7` to `-o ABI_FILE=/usr/lib32/libc.so.7` parameter for pkg? Looks a bit nicer that way.
Comment 21 Alexander Vereeken freebsd_triage 2024-05-04 17:00:26 UTC
Created attachment 250372 [details]
0001-emulators-wine-Fix-pkg32.sh.patch

Sure.
Comment 22 Alex S 2024-05-04 17:05:52 UTC
(In reply to Alexander Vereeken from comment #21)

LGTM
Comment 23 commit-hook freebsd_committer freebsd_triage 2024-05-05 19:13:27 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3b0b9249b5c1a920c53f828ed51e73a0a638c24e

commit 3b0b9249b5c1a920c53f828ed51e73a0a638c24e
Author:     Alexander Vereeken <Alexander88207@protonmail.com>
AuthorDate: 2024-05-05 19:11:39 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-05-05 19:12:25 +0000

    emulators/wine-proton: Refine WoW64 32-bit ABI determination

    PR:             278525
    Reported by:    Eduardo C. <idude0407@gmail.com>
    Approved by:    Alex S <iwtcex@gmail.com> (maintainer)

 emulators/wine-proton/Makefile       | 2 +-
 emulators/wine-proton/files/pkg32.sh | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
Comment 24 Gerald Pfeifer freebsd_committer freebsd_triage 2024-05-05 20:45:15 UTC
Thank you Alex and Alexander!

Alex, you have been working in that area in the past: the patch in
  files/patch-dlls__ntdll__unix__loader.c
doesn't apply to current head as well as Wine 9 (emulators/wine).
Any suggestions?
Comment 25 Alex S 2024-05-06 04:36:27 UTC
Created attachment 250484 [details]
patch-dlls_ntdll_unix_loader.c fixed

(In reply to Gerald Pfeifer from comment #24)

I only tested the compilation, fwiw.
Comment 26 commit-hook freebsd_committer freebsd_triage 2024-05-06 09:21:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8d60603b7558af3635f2b9b96e61e7a613b77e64

commit 8d60603b7558af3635f2b9b96e61e7a613b77e64
Author:     Alexander Vereeken <Alexander88207@protonmail.com>
AuthorDate: 2024-05-05 19:15:19 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-05-06 09:20:58 +0000

    emulators/wine8: Refine WoW64 32-bit ABI determination

    PR:             278525
    Reported by:    Eduardo C. <idude0407@gmail.com>

 emulators/wine8/Makefile       | 2 +-
 emulators/wine8/files/pkg32.sh | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
Comment 27 commit-hook freebsd_committer freebsd_triage 2024-05-07 05:52:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=78a29f61b9f34f96a7138c42440cc060098f9dbf

commit 78a29f61b9f34f96a7138c42440cc060098f9dbf
Author:     Alexander Vereeken <Alexander88207@protonmail.com>
AuthorDate: 2024-05-07 05:50:47 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-05-07 05:50:48 +0000

    emulators/wine: Refine WoW64 32-bit ABI determination

    PR:             278525
    Reported by:    Eduardo C. <idude0407@gmail.com>
    Reviewed by:    Alex S <iwtcex@gmail.com>

 emulators/wine/Makefile       | 1 +
 emulators/wine/files/pkg32.sh | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
Comment 28 commit-hook freebsd_committer freebsd_triage 2024-05-09 06:45:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=789fe3db9a6066d0759a492cb59d303a3fdc04f7

commit 789fe3db9a6066d0759a492cb59d303a3fdc04f7
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-05-09 06:44:59 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-05-09 06:44:59 +0000

    emulators/wine-devel: Update to Wine 9.7

    This includes the following changes:
     - Some restructuration of the Vulkan driver interface.
     - Some ARM work (which we aren't using yet).
     - Various bug fixes.

    Also refine 32-bit ABI determination for WoW64. [1]

    PR:             278525 [1]
    Submitted by:   Alexander Vereeken <Alexander88207@protonmail.com> [1]
    Reviewed by:    Alex S <iwtcex@gmail.com> [1]

 emulators/wine-devel/Makefile       | 2 +-
 emulators/wine-devel/distinfo       | 6 +++---
 emulators/wine-devel/files/pkg32.sh | 5 ++---
 emulators/wine-devel/pkg-plist      | 1 +
 4 files changed, 7 insertions(+), 7 deletions(-)
Comment 29 Gerald Pfeifer freebsd_committer freebsd_triage 2024-05-09 06:51:11 UTC
(In reply to Alex S from comment #25)
> patch-dlls_ntdll_unix_loader.c fixed
>
> I only tested the compilation, fwiw.

Thank you, Alex! I'll point some people towards it.
Comment 30 Gerald Pfeifer freebsd_committer freebsd_triage 2024-05-09 06:51:41 UTC
I have updated all four affected ports.
Comment 31 Gerald Pfeifer freebsd_committer freebsd_triage 2024-07-03 20:05:19 UTC
*** Bug 280085 has been marked as a duplicate of this bug. ***
Comment 32 Anton Shepelev 2024-07-09 23:09:15 UTC
(In reply to Alex S from comment #20)

On a freshly installed FreeBSD 14.1 on an x86-64 machine, the path:
  /usr/lib32/libc.so.7
does not exist, and consequently pkg32.sh fails with:
  Unable to determine ABI
Comment 33 Alex S 2024-07-09 23:17:33 UTC
I couldn't care less. Complain to portmgr@.
Comment 34 Gerald Pfeifer freebsd_committer freebsd_triage 2024-07-31 07:59:35 UTC
(In reply to Alex S from comment #33)
> I couldn't care less. Complain to portmgr@.

What did they do (they shouldn't have or should have done differently)?

How *do* we best address this for our users?

pkg -o IGNORE_OSVERSION=yes... as per bug 280085?
Comment 35 Anton Shepelev 2024-07-31 09:48:27 UTC
Whereas in a /correcty installed/ FreeBSD/ lib32 may not be
present, Wine should handle its absence in a graceful
manner, i.e. print a descriptive error message explaning the
situation, e.g:

  Wine-32 requires that lib32 be installed under /usr/lib32/ .

Furhermore, if lib32 may be installed in a non-standard
location, Wine should consult ldconfig rather than proble a
hard-coded path.
Comment 36 alt2600 2024-07-31 23:10:19 UTC
(In reply to Anton Shepelev from comment #35)

you would have to work really hard to get 32bit compat libraries installed anywhere but /usr/lib32, you would have to override paths and manually unpackaged yourself with tar. or manually override a lot of things in a source build install.

maybe put a message informing folks to re-run bsdconfig and ensure the 32bit library distribution packages have been installed, and install if not. Or ensure they haven't disabled in src.conf and re-build/install the os if they are doing from source directly. source builds/updates install 32bit libraries in the expected location by default, at least I never did anything fancy to get them, and its been years since I did a fresh install, but pretty sure you have to select the 32bit libraries for compat, they are not a default package when installing fresh from distribution packages IIRC. they are considered as being continually considered deprecated in newer relengs. at some point I would expect a change in src.conf will be needed to even get them, but not before 15 or later I would think.

also maybe advise them of how to create 64bit only prefixes, if this was meant to be what they wanted.
Comment 37 Anton Shepelev 2024-08-02 10:37:13 UTC
(In reply to alt2600 from comment #36)

> you would have to work really hard to get 32bit compat
> libraries installed anywhere but /usr/lib32, you would
> have to override paths and manually unpackaged yourself
> with tar. or manually override a lot of things in a source
> build install.

My suggestion as promted by:
<https://unix.stackexchange.com/a/563156>
If installing lib32 at a non-standard location is as
difficult and unlikely as you say, then I agree it need not
be handled, and the script can safely probe the hard-coded
path.

> maybe put a message informing folks to re-run bsdconfig
> and ensure the 32bit library distribution packages have
> been installed, and install if not.

Yes, it would have saved my and other users' time.

> also maybe advise them of how to create 64bit only
> prefixes, if this was meant to be what they wanted.

I for one needed a pure 32-bit prefix.  WINE's own
documentation explains prefixes very well, including advice
to avoid mixed ones.  The FreeBSD package, however, lacks an
OS- or package- specific message with information overriding
or supplementing the official WINE docs.