Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#56581 closed defect (fixed)

GitHub Livecheck Fails on iperf3-devel Subport

Reported by: aque (Allan Que) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: base Version: 2.5.0
Keywords: haspatch Cc: ryandesign (Ryan Carsten Schmidt)
Port: iperf3

Description

The iperf3-devel subport currently has livecheck disabled as a workaround. When enabled, I get the following error:

Line 
1DEBUG: Starting logging for iperf3-devel
2DEBUG: macOS 10.13 (darwin/17.5.0) arch i386
3DEBUG: MacPorts 2.5.0
4DEBUG: Xcode 9.4
5DEBUG: SDK 10.13
6DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.13
7DEBUG: Executing org.macports.main (iperf3-devel)
8DEBUG: livecheck phase started at Sat Jun  2 10:41:36 CDT 2018
9DEBUG: Executing org.macports.livecheck (iperf3-devel)
10DEBUG: Port (livecheck) version is 3e58489a5823126fd1d51fcfb74994f9e8fe4e86
11DEBUG: Fetching https://github.com/esnet/iperf/tags
12DEBUG: The regex is "<id>tag:github.com,2008:Grit::Commit/([0-9a-f]{40})[0-9a-f]*</id>"
13Error: cannot check if iperf3-devel was updated (regex didn't match)

I suspect the livecheck.url in github-1.0.tcl was previously set by the main (iperf3) port and not updated. I made the following change to confirm:

  • _resources/port1.0/group/github-1.0.tcl

    diff --git a/_resources/port1.0/group/github-1.0.tcl b/_resources/port1.0/group/github-1.0.tcl
    index 5324573aa2..f7ba5f231f 100644
    a b proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""} {gh_tag_su 
    107107        [regexp "^\[0-9a-f\]{7,}\$" ${github.version}] && \
    108108        ![regexp "^\[0-9\]{8}\$" ${github.version}]} {
    109109        livecheck.type      regexm
    110         default livecheck.url   {${github.homepage}/commits/${github.livecheck.branch}.atom}
     110        livecheck.url       ${github.homepage}/commits/${github.livecheck.branch}.atom
    111111        livecheck.regex     <id>tag:github.com,2008:Grit::Commit/(\[0-9a-f\]{[string length ${github.version}]})\[0-9a-f\]*</id>
    112112    } else {
    113113        livecheck.type      regex

This fixed the issue in this case. I did not test with other ports to see if this change breaks their livechecks.

Line 
1DEBUG: Starting logging for iperf3-devel
2DEBUG: macOS 10.13 (darwin/17.5.0) arch i386
3DEBUG: MacPorts 2.5.0
4DEBUG: Xcode 9.4
5DEBUG: SDK 10.13
6DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.13
7DEBUG: Executing org.macports.main (iperf3-devel)
8DEBUG: livecheck phase started at Sat Jun  2 10:53:55 CDT 2018
9DEBUG: Executing org.macports.livecheck (iperf3-devel)
10DEBUG: Port (livecheck) version is 3e58489a5823126fd1d51fcfb74994f9e8fe4e86
11DEBUG: Fetching https://github.com/esnet/iperf/commits/master.atom
12DEBUG: The regex is "<id>tag:github.com,2008:Grit::Commit/([0-9a-f]{40})[0-9a-f]*</id>"
13DEBUG: The regex matched "<id>tag:github.com,2008:Grit::Commit/7f883016bb77a39f11f6c62094c990a1dfef986e</id>", extracted "7f883016bb77a39f11f6c62094c990a1dfef986e"
14iperf3-devel seems to have been updated (port version: 3e58489a5823126fd1d51fcfb74994f9e8fe4e86, new version: 7f883016bb77a39f11f6c62094c990a1dfef986e)

Change History (5)

comment:1 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added
Keywords: haspatch added
Port: iperf3 added

I was actually trying to move the github portgroup toward using default for all livecheck.* options, not away from it.

I'd prefer restructuring the iperf3 port to accommodate this, as in https://github.com/macports/macports-ports/pull/1935.

comment:2 in reply to:  description Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to aque:

  • _resources/port1.0/group/github-1.0.tcl

    diff --git a/_resources/port1.0/group/github-1.0.tcl b/_resources/port1.0/group/github-1.0.tcl
    index 5324573aa2..f7ba5f231f 100644
    a b proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""} {gh_tag_su 
    107107        [regexp "^\[0-9a-f\]{7,}\$" ${github.version}] && \
    108108        ![regexp "^\[0-9\]{8}\$" ${github.version}]} {
    109109        livecheck.type      regexm
    110         default livecheck.url   {${github.homepage}/commits/${github.livecheck.branch}.atom}
     110        livecheck.url       ${github.homepage}/commits/${github.livecheck.branch}.atom
    111111        livecheck.regex     <id>tag:github.com,2008:Grit::Commit/(\[0-9a-f\]{[string length ${github.version}]})\[0-9a-f\]*</id>
    112112    } else {
    113113        livecheck.type      regex

Your proposed change would break the ability of a port to override github.livecheck.branch, a feature introduced in [8c8cfbced424311973717d48f0193ad4e53820a3/macports-ports].

comment:3 Changed 6 years ago by aque (Allan Que)

Thanks Ryan. I didn't know that restructuring the port that way would fix it; it reads the same to me. Also, the change I made wasn't a proposal to modify github-1.0.tcl. I just wanted to show the steps I took to troubleshoot.

comment:4 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In b6e0c922ce6bad93b3eef8e363c27f198896606d/macports-ports (master):

iperf3: Enable livecheck for iperf3-devel

Restructure the port so that directives that only apply to the main port
are enclosed in an "if {${subport} eq ${name}}" block.

Closes: #56581

comment:5 in reply to:  3 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to aque:

I didn't know that restructuring the port that way would fix it; it reads the same to me.

Before my change, github.setup was invoked once if the subport was iperf3, and twice if the subport was iperf3-devel (the first invocation set some livecheck parameters appropriately for the main port, and the second one overrode some but not all of them (not the ones specified with default) for the devel subport). Now, github.setup is invoked only once regardless of the subport, and so the livecheck parameters are set correctly.

When I designed the github portgroup I didn't envision the situation where a developer would want to invoke github.setup differently in different subports. Some day I will try to make a new github 2.0 portgroup that avoids this and other mistakes I made in github 1.0.

Note: See TracTickets for help on using tickets.