Opened 4 years ago

Last modified 5 months ago

#60545 assigned defect

opensubdiv depends on py stub ports

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jasonliu-- (Jason Liu)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: cooljeanius (Eric Gallager)
Port: opensubdiv

Description

opensubdiv depends on port:py-docutils and port:py-pygments. This isn't correct because these are stub ports. They don't actually install anything. They merely declare a dependency on one of their subports that do provide those files for a specific version of python.

You should instead depend on those specific python version subports and ensure that the build system uses the matching version of python. For example, depend on port:py38-docutils and port:py38-pygments and ensure that wherever the build system needs to use those modules, it invokes python as ${prefix}/bin/python3.8 and not as python or python3 or /usr/bin/env python3 or whatever it's currently doing.

I believe this block in the portfile also relates to the above:

    # Make it so that OpenSubdiv is able to find MacPorts' Docutils.
    if {![file exists ${prefix}/bin/rst2html.py]} {
        set files [glob -directory ${prefix}/bin "rst2html-*.py"]
        foreach f $files {
            if {[regexp {rst2html-.*\.py} $f result]} {
                reinplace "s|rst2html.py|${result}|g" \
                    ${worksrcpath}/cmake/FindDocutils.cmake
            }
        }
    }

What I think this is doing is building with ${prefix}/bin/rst2html.py if it exists (but I know of no circumstance in which it would exist unless the user created it manually), and otherwise pick some python version of rst2html.py that happens to be installed. You don't know which python version. It could be the one you declared a dependency on, or it could be some other one the user already had installed.

This is not how ports should behave. Builds should be reproducible and should not vary based on the ports that the user might happen to have installed. Nonreproducible builds are harder to debug.

Change History (2)

comment:1 Changed 17 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:2 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to jasonliu--
Status: newassigned
Note: See TracTickets for help on using tickets.