Bug 249537

Summary: Mk/bsd.port.mk: unbreak makesum for lang/python-doc-html
Product: Ports & Packages Reporter: Craig Leres <leres>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Open ---    
Severity: Affects Only Me CC: dbaio, ports-bugs, tobik
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://reviews.freebsd.org/D27226
Bug Depends on:    
Bug Blocks: 249063    
Attachments:
Description Flags
patch leres: maintainer-approval?

Description Craig Leres freebsd_committer 2020-09-22 21:56:23 UTC
@dbaio reported that "make makesum" was not working for lang/python-doc-html. This was something I had fixed last year via r492965.

r513191 does some cleanup of bsd.prog.mk:

    Reduce code duplication by calling fetch target
 
    when converting the do-fetch target to proper scripting we lost
    the ability to overwrite do-fetch when running make makesum.
    as reported here: 
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215530
    
    Let's call again do-fetch directly instead of duplicating its
    content

This was a nice cleanup but broke makesum lang/python-doc-html and also some linux ports resulting in r514097:

    Let "make makesum" pass DISTFILES to "make fetch".  For Linux 
    ports "make makesum" downloads distfiles for all supported
    architectures while "make fetch" only downloads files for the
    build architecture.

This partially fixed lang/python-doc-html but MASTER_SITES also needs to be passed down to the sub-make; here's a patch to do that.
Comment 1 Craig Leres freebsd_committer 2020-09-22 21:56:50 UTC
Created attachment 218195 [details]
patch
Comment 2 Mathieu Arnold freebsd_committer 2020-11-16 10:06:46 UTC
It seems to me that the framework does not really need fixing, the port should be fixed instead.
Nothing prevents the port from having the correct MASTER_SITES value outside of make(makesum).
Comment 3 Danilo G. Baio freebsd_committer 2021-05-12 01:11:10 UTC
ports 5693283b37e182d63579863491412355997533f9
Comment 4 Mathieu Arnold freebsd_committer 2021-05-17 08:03:02 UTC
I don't think the fix is correct at all, you should absolutely never need to use .export.
Comment 5 Tobias Kortkamp freebsd_committer 2021-05-17 17:05:00 UTC
I also needed to manually export MASTER_SITES for makesum.  I don't
understand why the framework does not export MASTER_SITES to the
submake on its own.  It exports DISTFILES for some reason since
ports 50d2c82e016fd176868cdc6e4befa606fa61c50e but not MASTER_SITES?
This looks like an oversight to me.

I know we could generate or set MASTER_SITES statically instead of
conditionally but that isn't exactly free.  It would be pretty
awful to do this in lang/rust-bootstrap which currently has nested
conditional variables for each FLAVOR.  It is already complicated
enough.

Is there any technical reason to not just commit this one line
patch?  If not please approve it.
Comment 6 Craig Leres freebsd_committer 2021-05-17 17:15:06 UTC
(In reply to Tobias Kortkamp from comment #5)
>  It exports DISTFILES for some reason since ports 50d2c82e016fd176868cdc6e4befa606fa61c50e but not MASTER_SITES?

I believe it's the case that DISTFILES and MASTER_SITES are co-dependent and should receive the same treatment.
Comment 7 Danilo G. Baio freebsd_committer 2021-05-17 22:26:57 UTC
here is all context: ports r513191 and ports 50d2c82e016fd176868cdc6e4befa606fa61c50e

I can revert the export, but we will probably need to do that locally as well. Any other idea?

Regards.