Bug 2274708

Summary: virt-customize fails with "no bytecode file specified" on s390x
Product: [Fedora] Fedora Reporter: Ilya Leoshkevich <iii>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: loganjerry, rjones
Target Milestone: ---Keywords: Regression, Reopened
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-28 03:16:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to use -output-complete-exe instead of -custom none

Description Ilya Leoshkevich 2024-04-12 11:06:06 UTC
This command used to work on Fedora 37, but after upgrading to Fedora 39 I get:

$ virt-customize
no bytecode file specified

Reproducible: Always

Steps to Reproduce:
$ docker run -it --platform=linux/s390x fedora:39
# dnf install -y guestfs-tools
# virt-customize

Actual Results:  
no bytecode file specified

Expected Results:  
Help text.

Probably related to https://docs.fedoraproject.org/en-US/packaging-guidelines/OCaml/#_stripping_binaries, but I haven't looked deeply into that.
Surprisingly, this works on x86_64.

Comment 1 Richard W.M. Jones 2024-04-12 11:16:47 UTC
I think what's happened here is this is F39 is the first version which introduced
OCaml 5.0, and initial versions of OCaml 5 dropped native support for s390x.  It's
to be added back in OCaml 5.1 (Fedora 40+).

Anyway in F39 we're distributing the bytecode version of virt-customize, but
somehow it got stripped and that deleted the bytecode from the binary, a known
bug in the 'strip' command:
https://discuss.ocaml.org/t/stripping-binaries/2308/13

We could probably rebuild this but you might just want to try the Fedora 40
version which should be native code again.

Comment 2 Ilya Leoshkevich 2024-04-12 11:52:05 UTC
I can confirm that it works again on Fedora 40. I would still appreciate if the Fedora 39 package was fixed, but I have a couple workarounds now (qemu-nbd, or modifying the image on a different Fedora). Thanks!

Comment 3 Jerry James 2024-04-12 17:13:25 UTC
Created attachment 2026653 [details]
Patch to use -output-complete-exe instead of -custom

Even on F40, the package will be broken on ppc64le, which is still a bytecode architecture.  It is linked with -custom, which simply appends the bytecode payload to the bytecode interpreter.  Code that reads ELF structures doesn't even know the payload is there.  If -custom were replaced with -output-complete-exe, that would no longer be an issue.  LINK_CUSTOM_OCAMLC_ONLY in subdir-rules.mk would have to be changed, along with @HAVE_OCAMLOPT_FALSE@LINK_CUSTOM_OCAMLC_ONLY in each Makefile.in file, as in the attached patch.  With that change, and setting patches_touch_autotools to 1, we get a successful build that should be immune to the effects of stripping: https://koji.fedoraproject.org/koji/taskinfo?taskID=116269760

Comment 4 Richard W.M. Jones 2024-04-12 19:55:55 UTC
Thanks, I added that patch upstream in guestfs-tools & virt-v2v:
https://github.com/libguestfs/guestfs-tools/commit/c249fd5caca8f1eed439f83e2bb1af46c8a28a27
https://github.com/libguestfs/virt-v2v/commit/5eeae696b2c56230d5d5fed5c86b7bf2b3942d4e

I'll add this to Fedora soon, just sorting out an unrelated problem.

Comment 5 Fedora Update System 2024-04-12 21:35:48 UTC
FEDORA-2024-e712f67642 (virt-v2v-2.5.3-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-e712f67642

Comment 6 Fedora Update System 2024-04-12 21:39:24 UTC
FEDORA-2024-e712f67642 (virt-v2v-2.5.3-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2024-04-12 22:40:51 UTC
FEDORA-2024-10de0e9e58 (guestfs-tools-1.52.0-5.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-10de0e9e58

Comment 8 Fedora Update System 2024-04-12 22:57:45 UTC
FEDORA-2024-f1e1f497c9 (guestfs-tools-1.52.0-3.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f1e1f497c9

Comment 9 Fedora Update System 2024-04-12 22:59:47 UTC
FEDORA-2024-fc33832505 (guestfs-tools-1.52.0-5.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-fc33832505

Comment 10 Fedora Update System 2024-04-13 00:06:27 UTC
FEDORA-2024-10de0e9e58 (guestfs-tools-1.52.0-5.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2024-04-13 01:41:33 UTC
FEDORA-2024-f1e1f497c9 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f1e1f497c9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f1e1f497c9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-04-13 01:55:32 UTC
FEDORA-2024-fc33832505 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-fc33832505`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-fc33832505

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Ilya Leoshkevich 2024-04-15 11:21:37 UTC
I can confirm that with `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f1e1f497c9` the issue is gone. Thanks!

Comment 14 Fedora Update System 2024-04-28 03:16:04 UTC
FEDORA-2024-fc33832505 (guestfs-tools-1.52.0-5.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2024-04-28 03:29:00 UTC
FEDORA-2024-f1e1f497c9 (guestfs-tools-1.52.0-3.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.