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

Support linux armhf/arm64 #10

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Support linux armhf/arm64 #10

wants to merge 10 commits into from

Conversation

linrol
Copy link

@linrol linrol commented Mar 26, 2024

build box86/box64 to run wine
install wine 7.0.2

@linrol
Copy link
Author

linrol commented Mar 26, 2024

@huan I have fix the CI action error, please help me re-run it.

@linrol
Copy link
Author

linrol commented Mar 26, 2024

image

@huan When I tried to run it again, an error occurred because the docker password was not configured. I used secrets.DOCKER_PERSONAL_ACCESS_TOKEN in the yml ci file. Can you add the secrets.DOCKER_PERSONAL_ACCESS_TOKEN of the zixia account in this repository?

@huan
Copy link
Owner

huan commented May 10, 2024

It's great to have ARM support; thanks, @linrol and @tobiasdiez, for your contribution!

However, this PR looks like it needs some time to investigate and learn; I will do it when I have time.

Please feel free to add more documentation in the README and comments here.

@huan huan self-assigned this May 10, 2024
@tobiasdiez
Copy link

@huan Do you have any update on when this could be merged? Would be awesome to have arm support.

@huan
Copy link
Owner

huan commented Aug 3, 2024

We need more contributors to test it and make sure this pr works as expected.

Please let me know if you have personal tested it and it works, so that I’ll have more confident to merge it.

scripts/install-box.sh Outdated Show resolved Hide resolved
scripts/install-box.sh Outdated Show resolved Hide resolved
# - Wine download links from WineHQ: https://dl.winehq.org/wine-builds/

branch="stable" #example: devel, staging, or stable (wine-staging 4.5+ requires libfaudio0:i386)
version="7.0.2" #example: "7.1"

Choose a reason for hiding this comment

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

Maybe update to v8?

&& echo 'Wine Initialized'

ENTRYPOINT ["bash", "-c"]
CMD ["bash"]

Choose a reason for hiding this comment

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

Maybe add something like

LABEL \
    org.opencontainers.image.authors="Huan (李卓桓) <[email protected]>" \
    org.opencontainers.image.description="Docker Base Image for Wine" \
    org.opencontainers.image.documentation="https://github.com/huan/docker-wine/#readme" \
    org.opencontainers.image.licenses="Apache-2.0" \
    org.opencontainers.image.source="[email protected]:huan/docker-wine.git" \
    org.opencontainers.image.title="Docker Base Image for Wine" \
    org.opencontainers.image.url="https://github.com/huan/docker-wine" \
    org.opencontainers.image.vendor="Huan LI (李卓桓)"

as in the main repo.

@tobiasdiez
Copy link

tobiasdiez commented Aug 7, 2024

@huan @linrol I gave it a try and sudo docker build --build-arg TARGETPLATFORM=linux/arm64 -t my-docker-image -f Dockerfile.arm . succeeded after some minimal changes (see code review comments above).

@tobiasdiez
Copy link

I played around with this a bit more and found that the shortcuts wine and wine64 are not working:

root@53c2107b87ff:/# wine
Error: file is not found (check BOX86_PATH)
root@53c2107b87ff:/# wine64
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Neoverse-N1 with 2 Cores
Will use Hardware counter measured at 25.0 MHz emulating 3.2 GHz
Params database has 87 entries
Box64 with Dynarec v0.3.1 875a2ef3 built on Aug 28 2024 06:26:30
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Detected 48bits at least of address space
WINE prereserve of 0x10000:0x8000 done
WINE prereserve of 0x110000:0x30000000 done
WINE prereserve of 0x7f000000:0x3000000 done
Counted 13 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
Looking for /root/wine/bin/wine64
Apply RC params for wine64
Applying BOX64_MAXCPU=64
Error: File is not found. (check BOX64_PATH)

However, box64 /home/user/wine/bin/wine64 (and box86 /home/user/wine/bin/wine) works like a charm.

@linrol could you have a look please? I guess it's a problem with the wrappers

@tobiasdiez
Copy link

I also got

user@c44fc0303ced:~/matrix-wechat-agent$ box64 wine cmd /k /home/user/matrix-wechat-agent/matrix-wechat-agent.exe
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Neoverse-N1 with 2 Cores
Will use Hardware counter measured at 25.0 MHz emulating 3.2 GHz
Params database has 87 entries
Box64 with Dynarec v0.3.1 875a2ef3 built on Aug 28 2024 06:26:30
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Detected 48bits at least of address space
WINE prereserve of 0x10000:0x8000 done
WINE prereserve of 0x110000:0x30000000 done
WINE prereserve of 0x7f000000:0x3000000 done
Counted 16 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
Looking for wine
Apply RC params for wine
Applying BOX64_MAXCPU=64
argv[1]="cmd"
argv[2]="/k"
argv[3]="/home/user/matrix-wechat-agent/matrix-wechat-agent.exe"
Not an ELF file (sign=#!/b)
Error: Reading elf header of /usr/local/bin/wine, Try to launch natively instead
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Neoverse-N1 with 2 Cores
Will use Hardware counter measured at 25.0 MHz emulating 3.2 GHz
Params database has 87 entries
Box64 with Dynarec v0.3.1 875a2ef3 built on Aug 28 2024 06:26:30
BOX64: Detected 48bits at least of address space
Counted 19 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
Looking for /home/user/wine/bin/wineserver
Rename process to "wineserver"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Error: Symbol res_query not found, cannot apply R_386_JMP_SLOT 0x60b04020 (0x10b6) in /home/user/wine/lib/wine/i386-unix/dnsapi.so
Error: relocating Plt symbols in elf dnsapi.so
̀ ``
Do you have any idea where this is coming from? (Btw `i386` in `/home/user/wine/lib/wine/i386-unix` looks strange - should this not be arm?)

@tobiasdiez
Copy link

And another (potential) issue:

$ box64 /home/user/wine/bin/wine64 "echo"
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Neoverse-N1 with 2 Cores
Will use Hardware counter measured at 25.0 MHz emulating 3.2 GHz
Params database has 87 entries
Box64 with Dynarec v0.3.1 875a2ef3 built on Aug 28 2024 06:26:30
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Detected 48bits at least of address space
WINE prereserve of 0x10000:0x8000 done
WINE prereserve of 0x110000:0x30000000 done
WINE prereserve of 0x7f000000:0x3000000 done
Counted 16 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
Looking for /home/user/wine/bin/wine64
Apply RC params for wine64
Applying BOX64_MAXCPU=64
argv[1]="echo"
Rename process to "wine64"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated /home/user/wine/bin/../lib64/wine/x86_64-unix/ntdll.so
Using emulated /lib/x86_64-linux-gnu/libunwind.so.8
Using native(wrapped) liblzma.so.5
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Neoverse-N1 with 2 Cores
Will use Hardware counter measured at 25.0 MHz emulating 3.2 GHz
Params database has 87 entries
Box64 with Dynarec v0.3.1 875a2ef3 built on Aug 28 2024 06:26:30
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Detected 48bits at least of address space
WINE prereserve of 0x10000:0x8000 done
WINE prereserve of 0x110000:0x30000000 done
WINE prereserve of 0x7f000000:0x3000000 done
Counted 17 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
Looking for /home/user/wine/bin/wine64
Apply RC params for wine64
Applying BOX64_MAXCPU=64
argv[1]="echo"
Rename process to "wine64"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated /home/user/wine/bin/../lib64/wine/x86_64-unix/ntdll.so
Using emulated /lib/x86_64-linux-gnu/libunwind.so.8
Using native(wrapped) liblzma.so.5
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Neoverse-N1 with 2 Cores
Will use Hardware counter measured at 25.0 MHz emulating 3.2 GHz
Params database has 87 entries
Box64 with Dynarec v0.3.1 875a2ef3 built on Aug 28 2024 06:26:30
BOX64: Detected 48bits at least of address space
Counted 17 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
Looking for /home/user/wine/bin/wineserver
Rename process to "wineserver"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
wine: '/home/user/.wine' is a 32-bit installation, it cannot support 64-bit applications.

@tobiasdiez
Copy link

I've fixed the issues above in linrol#1 @linrol please have a look if you are okay with these changes! Thanks

@tobiasdiez
Copy link

Thanks @linrol!

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.

3 participants