Bug 206292 - emulators/qemu-devel: pkg-plist should use %%NO_X86_TARGETS%%, not %%X86_TARGETS%%
Summary: emulators/qemu-devel: pkg-plist should use %%NO_X86_TARGETS%%, not %%X86_TARG...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-15 14:29 UTC by Ting-Wei Lan
Modified: 2016-04-20 07:03 UTC (History)
5 users (show)

See Also:
bofh: maintainer-feedback+


Attachments
Replace %%X86_TARGETS%% with %%NO_X86_TARGETS%% (2.36 KB, patch)
2016-01-15 14:38 UTC, Ting-Wei Lan
no flags Details | Diff
Replace %%X86_TARGETS%% with %%NO_X86_TARGETS%% (2.37 KB, patch)
2016-03-05 20:53 UTC, Ting-Wei Lan
bofh: maintainer-approval+
Details | Diff
Replace X86_TARGETS with ALL_TARGETS (3.81 KB, patch)
2016-04-19 19:46 UTC, Ed Maste
bofh: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2016-01-15 14:29:39 UTC
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.
Comment 1 Ting-Wei Lan 2016-01-15 14:38:01 UTC
Created attachment 165632 [details]
Replace %%X86_TARGETS%% with %%NO_X86_TARGETS%%
Comment 2 vaibhav.gavane 2016-01-24 19:44:05 UTC
This bug also exists in the emulators/qemu port.
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2016-02-05 23:08:25 UTC
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
Comment 4 Ting-Wei Lan 2016-03-05 20:53:37 UTC
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.
Comment 5 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2016-03-06 03:00:57 UTC
(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.
Comment 6 Ting-Wei Lan 2016-03-08 18:20:08 UTC
(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?
Comment 7 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2016-03-08 18:33:06 UTC
(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.
Comment 8 Ting-Wei Lan 2016-03-08 19:11:11 UTC
(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.
Comment 9 Ting-Wei Lan 2016-04-01 15:18:47 UTC
(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?
Comment 10 Ed Maste freebsd_committer freebsd_triage 2016-04-02 00:03:14 UTC
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%%?
Comment 11 Ed Maste freebsd_committer freebsd_triage 2016-04-02 00:05:52 UTC
> 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%%?
Comment 12 Ed Maste freebsd_committer freebsd_triage 2016-04-02 00:16:59 UTC
Sorry I missed the patch from Ting-Wei Lan originally. It looks correct to me.
Comment 13 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2016-04-02 19:46:56 UTC
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.
Comment 14 John Baldwin freebsd_committer freebsd_triage 2016-04-19 19:19:22 UTC
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".
Comment 15 Ed Maste freebsd_committer freebsd_triage 2016-04-19 19:20:41 UTC
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.
Comment 16 Ed Maste freebsd_committer freebsd_triage 2016-04-19 19:22:00 UTC
> 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.
Comment 17 Ed Maste freebsd_committer freebsd_triage 2016-04-19 19:46:26 UTC
Created attachment 169479 [details]
Replace X86_TARGETS with ALL_TARGETS
Comment 18 Ed Maste freebsd_committer freebsd_triage 2016-04-19 19:47:14 UTC
We could also avoid the double negative by just changing the description to

X86_TARGETS_DESC=      Build only x86 system targets
Comment 19 commit-hook freebsd_committer freebsd_triage 2016-04-20 07:02:00 UTC
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
Comment 20 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2016-04-20 07:03:08 UTC
Committed. I will check the qemu port too.