Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#60566 closed enhancement (fixed)

Setting known_fail yes should prevent the port from being installed

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.8.0
Component: base Version: 2.6.2
Keywords: Cc: ctreleaven (Craig Treleaven)
Port:

Description

Some ports do this (this is from go):

if {${os.platform} eq "darwin" && ${os.major} < 11} {
    known_fail yes
    pre-fetch {
        ui_error "${name} @${version} requires OS X 10.7 or greater."
        return -code error "incompatible Mac OS X version"
    }
}

In other words in addition to setting known_fail yes it prints an error message in a pre-fetch block to prevent the port from being installed.

It would be great if MacPorts base itself would ensure that the port cannot be installed when known_fail yes is set.

Ports still need an opportunity to specify a reason why they would fail. Maybe a new option could be created for that, so that a portfile could then say:

# hypothetical code
if {${os.platform} eq "darwin" && ${os.major} < 11} {
    known_fail yes
    known_fail_reason requires OS X 10.7 or greater
}

Maybe implementing this would make other smaller enhancements to known_fail yes like #60564 and #60565 unnecessary.

Change History (4)

comment:1 Changed 4 years ago by ctreleaven (Craig Treleaven)

Cc: ctreleaven added

comment:2 Changed 4 years ago by ctreleaven (Craig Treleaven)

See also #59640

comment:3 Changed 2 years ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In d863a7e471d1afb4e405f5c5fbae470e26486a84/macports-base (master):

Check for known_fail before installing

Closes: #60566

comment:4 Changed 2 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.8.0
Note: See TracTickets for help on using tickets.