Bug 269982 - Mk/Scripts/depends-list.sh: Default flavour for dependencies are overriden
Summary: Mk/Scripts/depends-list.sh: Default flavour for dependencies are overriden
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Luca Pizzamiglio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-05 19:25 UTC by Jan Martin Mikkelsen
Modified: 2023-06-14 21:34 UTC (History)
7 users (show)

See Also:


Attachments
Patch solving the problem for me (309 bytes, patch)
2023-03-05 19:25 UTC, Jan Martin Mikkelsen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Martin Mikkelsen 2023-03-05 19:25:34 UTC
Created attachment 240605 [details]
Patch solving the problem for me

When running "make all-depends-list", for some ports dependencies are not listed. For example, "make all-depends-list" on x11-wm/xfce4 includes x11-servers/xorg-server but not x11/libxcvt. For x11-servers/xorg-server, "make all-depends-list" includes x11-libxcvt.

The underlying problem seems to be that Mk/Scripts/depends-list.sh sets FLAVOR, even when it is an empty string. This breaks the default flavour setting in x11-servers/xorg-server.

The bug is that that the flavour shell variable is not enclosed in quotes, making the test for a non-empty string always succeed. Patch attached.
Comment 1 Andrew "RhodiumToad" Gierth 2023-04-17 23:48:17 UTC
I just discovered this independently when tracking down why fetch-recursive was not fetching all dependencies; I can confirm both the diagnosis and that the fix works.
Comment 2 Andrew "RhodiumToad" Gierth 2023-04-18 16:40:08 UTC
Relatedly, fetch-recursive and so on also don't handle the case where a port depends (possibly indirectly) on both foo@x and foo@y; the de-duplication logic checks only the port dir and not the flavor. Using $port_display in place of $d in the $checked variable fixes this.
Comment 3 Andrew "RhodiumToad" Gierth 2023-06-11 18:21:50 UTC
I put up my version of the fix at:

https://reviews.freebsd.org/D40491
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-06-13 20:14:20 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=873d4f6f9905bae3fe580e86aaebbbe994adba97

commit 873d4f6f9905bae3fe580e86aaebbbe994adba97
Author:     Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
AuthorDate: 2023-06-13 20:09:59 +0000
Commit:     Luca Pizzamiglio <pizzamig@FreeBSD.org>
CommitDate: 2023-06-13 20:09:59 +0000

    Mk/Scripts: Fix ports depends-list.sh

    depends-list.sh fails in two ways: one is a simple quoting bug which
    causes empty FLAVOR variables to be propagated; the other is that
    de-duplication is being done without regard for flavors.

    The upshot of these is that where a port depends on a specific flavor
    (first bug) or on multiple flavors (second bug, usually caused by build
    dependencies) of another port, the constructed dependency list is
    incomplete, and so -recursive targets do not do all the required work.
    (This is especially annoying for fetch-recursive.)

    Reviewed by: portmgr@FreeBSD.org
    PR:             269982
    Differential Revision: https://reviews.freebsd.org/D40491

 Mk/Scripts/depends-list.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Comment 5 Andrew "RhodiumToad" Gierth 2023-06-14 20:27:31 UTC
Thanks!
Comment 6 Jan Martin Mikkelsen 2023-06-14 21:14:54 UTC
And thank you too!
Comment 7 Luca Pizzamiglio freebsd_committer freebsd_triage 2023-06-14 21:34:39 UTC
Thanks for your contributions and sorry if it took so long!