Summary: | ports-mgmt/poudriere: builds wrong flavor when default isn't 1st | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Anton Saietskii <vsasjason> |
Component: | Individual Port(s) | Assignee: | Bryan Drewery <bdrewery> |
Status: | New --- | ||
Severity: | Affects Only Me | CC: | nimaje+fbz |
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(bdrewery) |
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any | ||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277867 |
Description
Anton Saietskii
2024-03-21 14:53:43 UTC
The port is wrong here, the line has to be FLAVOR?= ${FLAVORS:[1]} "The first flavor in FLAVORS is the default flavor." [0]. It is a bit unfortunate that poudriere has some troubles in cases were that is violated. [0]: https://docs.freebsd.org/en/books/porters-handbook/flavors/#flavors-using (In reply to Benjamin Takacs from comment #1) > The port is wrong here No it's not. FLAVORS -- just a list of whitespace-separated values, basically an array. ${FLAVORS:[N]} does nothing more than selecting Nth element from that array. That's actually what I demonstrated by running 'env FLAVOR=X make -V PKGNAME'. BTW, why would we event define default flavor if statement "default can be 1st only" would be true? Actually, there's even a bug #225659 with pretty similar issue, but commit 9823f56764e6cf0b39a6485c3b95a58102b5f2f7 in ports doesn't help for some reason (though I didn't dig into this deeply). you define FLAVOR yourself, because Mk/bsd.port.mk setting it for you (line 1524) does so to late (I'm suprised that there don't seem to be a <flavor>_USES helper). 9823f56764e6cf0b39a6485c3b95a58102b5f2f7 doesn't help, as it only helps when the port doesn't set FLAVOR, as that makes Mk/bsd.port.mk set _FLAVOR to a non-empty value (line 1043), so the condition is false (not sure how and when it can help, maybe with stuff like python ports) (In reply to Benjamin Takacs from comment #3) The commit message says _reorder_ flavors, not "set default if no default is set", isn't it? And again: ports tree itself handles this correctly. It's just poudriere can't build 1st flavor _at all_ (take a closer look at the 'bulk' arguments) when default is 2nd. (In reply to Anton Saietskii from comment #4) that .if of commit 9823f56764e6cf0b39a6485c3b95a58102b5f2f7 only applies, if FLAVOR isn't set before Mk/bsd.port.mk is included. If it is, then bsd.port.mk will save the requested FLAVOR in _FLAVOR in line 1043, in line 1523 it will skip setting FLAVOR, as FLAVOR is already set, in line 1528 it will skip reordering FLAVORS, as _FLAVOR is set to a non-empty value (and later in 3919 it can't detect that it wasn't the user that requested that FLAVOR, making the clean code a bit incorrect in case FLAVOR was set by the port and not by the user) |