Enabling X86_TARGETS option means disabling the installation of non-x86 targets of qemu executables, but the current pkg-plist does the opposite thing: It only installs non-x86 targets binaries when X86_TARGETS is enabled.
Created attachment 165632 [details] Replace %%X86_TARGETS%% with %%NO_X86_TARGETS%%
This bug also exists in the emulators/qemu port.
Current plist failure can be seen at http://package21.nyi.freebsd.org/data/102amd64-default-qat/408119/logs/errors/qemu-devel-2.5.0_1.log
Created attachment 167745 [details] Replace %%X86_TARGETS%% with %%NO_X86_TARGETS%% Fix conflict after r410148. Unfortuneately, the maintainer didn't provide any feedback and I have kept this kind of local patch for more than one month.
(In reply to Ting-Wei Lan from comment #4) Actually this is not the solution. Someone else removed the conditional X86_TARGETS block in a previous commit. I am still working on figuring out what effect does it have.
(In reply to Muhammad Moinur Rahman from comment #5) Does the removal of X86_TARGETS conditional block cause any difference in pkg-plist, or is there a better way to fix pkg-plist?
(In reply to Ting-Wei Lan from comment #6) If you see there is an option called X86_TARGETS but is there anything else? Does it have any effect on enabling or disabling? There is no conditional block about what to do whether if it is enabled or disabled except in plist. So far I believe that QEMU is an emulator which runs on an x86 based hardware where it can emulate other architectures. And if X86_TARGETS is enabled that means it can emulate these platforms. Let's say I am building QEMU in and arm processor. I am not sure whether if it can emulate an x86/x86_64/sparc processor. But then again I might be wrong. Correct me if I am wrong. Here is the snippet which was removed : https://svnweb.freebsd.org/ports/head/emulators/qemu-devel/Makefile?r1=405406&r2=406121&pathrev=407228 So far I believe the pkg-plist is in a perfect condition; we just need to figure out what changes we need in Makefile. Comments appreciated.
(In reply to Muhammad Moinur Rahman from comment #7) X86_TARGETS option does have effect because pkg-plist controls which files should be installed. If we prepend '%%X86_TARGETS%%' before the filename, it is installed only when X86_TARGETS option is enabled. X86_TARGETS option means 'Don't build non-x86 system targets' (X86_TARGETS_DESC), but the removal of conditional block causes all targets to be built regardless of this option. Although it cannot control CONFIGURE_ARGS now, it still controls whether qemu executables targeting non-x86 systems are installed. As it says 'Don't build', it is expected for users to think enabling this option can reduce the size of the package and avoid install unused binaries if they only want to emulate x86. However, the current pkg-plist does the opposite thing, it installs non-x86 targets only when X86_TARGETS is enabled. This means enabling X86_TARGETS option doesn't reduce the size but increase it, and packages provided on pkg.freebsd.org only include x86 targets.
(In reply to Muhammad Moinur Rahman from comment #7) Do you have some time to read the patch and the Makefile again? Do you really want to reverse the meaning of X86_TARGETS option?
In my opinion negative options are confusing anyway. Can we rename the option to ALL_TARGETS, default it to on, and change the plist to %%ALL_TARGETS%%?
> Can we rename the option to ALL_TARGETS Or if not, just restore in the Makefile .if ${PORT_OPTIONS:MX86_TARGETS} PLIST_SUB+= NONX86="@comment " .else PLIST_SUB+= NONX86="" .endif and switch the plist back to %%NONX86%%?
Sorry I missed the patch from Ting-Wei Lan originally. It looks correct to me.
I am going with Maste's idea of using ALL_TARGETS else it will create confusion on negating options. Will incorporate the changes in the upcoming version 2.5.1 on which I am right now working.
Can you fix the port to use ALL_TARGETS soon (rather than waiting for the next upgrade)? I just tripped over this on the qemu-devel port. I don't really care if it takes longer to build or not, I just care that I don't have a qemu-system-ppc64 binary to test powerpc64 changes with unless I set the checkbox that says "don't build non-x86 targets".
Can we please commit Ting-Wei Lan's patch in the interim, until the 2.5.1 update goes in? This has been broken for over 3 months, and the qemu (non-devel) port is in even worse shape as the extra binaries aren't even built when X86_TARGETS is enabled so the workaround of setting the option backwards is not available.
> Can you fix the port to use ALL_TARGETS soon Our comments crossed each other in bugzilla -- that sounds like a good approach to me too.
Created attachment 169479 [details] Replace X86_TARGETS with ALL_TARGETS
We could also avoid the double negative by just changing the description to X86_TARGETS_DESC= Build only x86 system targets
A commit references this bug: Author: bofh Date: Wed Apr 20 07:01:15 UTC 2016 New revision: 413673 URL: https://svnweb.freebsd.org/changeset/ports/413673 Log: emulators/qemu-devel: Fix pkg-plist with NO_X86_TARGETS PR: 206292 Submitted by: lantw44@gmail.com Changes: head/emulators/qemu-devel/Makefile head/emulators/qemu-devel/pkg-plist
Committed. I will check the qemu port too.