Bug 253621 - Arch-specific OPTIONS not handled by OPTIONS_SUB
Summary: Arch-specific OPTIONS not handled by OPTIONS_SUB
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-18 14:26 UTC by Mikhail Teterin
Modified: 2021-03-31 09:55 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Teterin freebsd_committer freebsd_triage 2021-02-18 14:26:12 UTC
The latest lang/siod port has an i386-only option: SQL_ORACLE. It also sets OPTIONS_SUB to have all of the options added to PLIST_SUB, as documented.

Unfortunately, the SQL_ORACLE="@comment " is NOT added to PLIST_SUB on non-i386 platforms -- and the port has to do it itself as a work-around.

The work-around should not be necessary...

To reproduce the problem, comment out the PLIST_SUB-amending line in the port's makefile and try "make clean check-plist" on any architecture except i386.
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2021-03-31 08:45:35 UTC
The problem is that the ports tree can know which architectures is currently running, but it has no idea of what architectures are currently not running.

So if the current architecture is, say, arm64, it has no way of knowing that i386 also exists.
Comment 2 dewayne 2021-03-31 09:06:19 UTC
(In reply to Mathieu Arnold from comment #1)
Mathieu, would this be a reasonable workaround.  Setting these in make.conf and passing a variable to select (as in this case prescott for i386):

CPUTYPE?= prescott
TARGET=i386
TARGET_ARCH=i386
TARGET_CPUTYPE=${CPUTYPE}

CFLAGS+= -march=${CPUTYPE}
COPTFLAGS+= -march=${CPUTYPE} -O2
CXXFLAGS+= -march=${CPUTYPE}
COPTFLAGS+= -march=${CPUTYPE}

I do this for c3-2, prescott; core2 and haswell. Would this help Mikhail?  Or is qemu the better path across arch'es?

Aside: I only use i386 & amd64
Comment 3 Tobias Kortkamp freebsd_committer freebsd_triage 2021-03-31 09:43:30 UTC
(In reply to Mathieu Arnold from comment #1)
> The problem is that the ports tree can know which architectures is
> currently running, but it has no idea of what architectures are
> currently not running.

I do not see how this is a real problem though. FreeBSD does not support
that many archs. The available archs can just be enumerated once and
then you have a way of determining which archs you are not running.

Here is the list of archs I have hardcoded in portfmt:
aarch64
amd64
arm
armv6
armv7
i386
mips
mips64
mips64el
mips64elhf
mips64hf
mipsel
mipselhf
mipshf
mipsn32
powerpc
powerpc64
powerpc64le
powerpcspe
riscv64
riscv64sf
sparc64
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2021-03-31 09:53:51 UTC
Something a bit like this:

https://reviews.freebsd.org/D29507
Comment 5 Mathieu Arnold freebsd_committer freebsd_triage 2021-03-31 09:55:06 UTC
(In reply to Tobias Kortkamp from comment #3)
> I do not see how this is a real problem though. FreeBSD does not support
> that many archs. The available archs can just be enumerated once and
> then you have a way of determining which archs you are not running.

I never said it was a real problem, I simply stated what the problem was, in case I did not have enough time to figure out a solution today, so that I did not have to figure out what the problem was again.