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

QEMU in release assets requires capstone for amd64 #17490

Closed
Tracked by #1798
cpolizzi opened this issue Feb 13, 2023 · 7 comments · Fixed by #17648
Closed
Tracked by #1798

QEMU in release assets requires capstone for amd64 #17490

cpolizzi opened this issue Feb 13, 2023 · 7 comments · Fixed by #17648
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine

Comments

@cpolizzi
Copy link

cpolizzi commented Feb 13, 2023

Issue Description

This is against the Podman 4.4.1 release.

The macOS installable package includes QEMU and the QEMU build since v7.1.0 requires libcapstone as a dynamic library to be present on the system. Capstone is not and should not be required to use QEMU.

This applies only to the AMD64 release and not the ARM64 release which does not have a dependency on libcapstone.

Steps to reproduce the issue

On a Mac without Homebrew installed and without libcapstone.

  1. curl -OL# https://github.com/containers/podman/releases/download/v4.4.1/podman-installer-macos-amd64.pkg
  2. curl -OL# https://github.com/containers/podman/releases/download/v4.4.1/podman-installer-macos-arm64.pkg
  3. mkdir -p {amd64,arm64}/stage
  4. xar -C amd64 -xf podman-installer-macos-amd64.pkg
  5. xar -C arm64 -xf podman-installer-macos-arm64.pkg
  6. ( cd amd64/stage && cpio -id --quiet < ../podman.pkg/Payload )
  7. ( cd arm64/stage && cpio -id --quiet < ../podman.pkg/Payload )
  8. otool -L amd64/stage/podman/qemu/bin/qemu-system-x86_64 | grep -c capstone
    1
  9. otool -L arm64/stage/podman/qemu/bin/qemu-system-aarch64 | grep -c capstone
    0

On either an Intel or M1:
10. sudo mv amd64/stage/podman /opt
11. /opt/podman/qemu/bin/qemu-system-x86_64 --version

dyld[58463]: Library not loaded: '/usr/local/opt/capstone/lib/libcapstone.4.dylib'
  Referenced from: '/opt/podman/qemu/bin/qemu-system-x86_64'
  Reason: tried: '/usr/local/opt/capstone/lib/libcapstone.4.dylib' (no such file), '/usr/lib/libcapstone.4.dylib' (no such file)
zsh: abort      /opt/podman/qemu/bin/qemu-system-x86_64 --version
  1. sudo rm -rf /opt/podman

On an M1 only:
13. sudo mv arm64/stage/podman /opt
14. /opt/podman/qemu/bin/qemu-system-aarch64 --version

QEMU emulator version 7.1.0
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
  1. sudo rm -rf /opt/podman

Describe the results you received

AMD64 QEMU cannot locate libcapstone because it was built to have a dependency on it whereas this is not the case for ARM64. libcapstone is not provided by Apple.

Describe the results you expected

Both AMD64 and ARM64 podman releases not requiring libcapstone for the bundled QEMU respectivly.

podman info output

N/A

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Homebrew not installed and is not desired to be installed just to get libcapstone for AMD64 only.

Additional information

Only occurs with AMD64.

Since the podman project is pulling the pre-built QEMU from:

For completeness, the ARM64 pre-built QEMU is at:

This is where the problem lies since this GitHub project handles the build of QEMU and the podman build for the macOS installable package merely bundles the result.

Looks like all that is needed in that proiect is to update build-qemu.sh to include --disable-capstone flag when invoking configure for the QEMU build.

Podman 4.3.1 did not have this problem and thus QEMU 7.0.0.

@cpolizzi cpolizzi added the kind/bug Categorizes issue or PR as related to a bug. label Feb 13, 2023
@Luap99
Copy link
Member

Luap99 commented Feb 15, 2023

I guess it is best to report this directly against https://github.com/containers/podman-machine-qemu
cc @anjannath @gbraad

@Luap99 Luap99 added the machine label Feb 15, 2023
@cpolizzi
Copy link
Author

I'll link this issue in that project then.

@anjannath
Copy link
Member

new release has been published with the fix: https://github.com/containers/podman-machine-qemu/releases/tag/v7.2.0-1 will need to also update the qemu version for the pkg

@FedeHAL
Copy link

FedeHAL commented Mar 17, 2023

Is this issue fixed? I have desktop 0.12.0 and podman 4.4.2 and still getting the libcapstone lib error.

@cpolizzi
Copy link
Author

@FedeHAL It's been fixed in the podman-machine-qemu repo for about a month now but the podman has yet to provide a release for it that includes that. This is why I'm still staying on Podman 4.3.1 until the project addresses that.

@jgresham
Copy link

+1

@jgresham
Copy link

@ashley-cui could we get a 4.4.3 release for this? :)

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Aug 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants