#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 | |
---|---|
1 | DEBUG: Starting logging for iperf3-devel |
2 | DEBUG: macOS 10.13 (darwin/17.5.0) arch i386 |
3 | DEBUG: MacPorts 2.5.0 |
4 | DEBUG: Xcode 9.4 |
5 | DEBUG: SDK 10.13 |
6 | DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.13 |
7 | DEBUG: Executing org.macports.main (iperf3-devel) |
8 | DEBUG: livecheck phase started at Sat Jun 2 10:41:36 CDT 2018 |
9 | DEBUG: Executing org.macports.livecheck (iperf3-devel) |
10 | DEBUG: Port (livecheck) version is 3e58489a5823126fd1d51fcfb74994f9e8fe4e86 |
11 | DEBUG: Fetching https://github.com/esnet/iperf/tags |
12 | DEBUG: The regex is "<id>tag:github.com,2008:Grit::Commit/([0-9a-f]{40})[0-9a-f]*</id>" |
13 | Error: 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 107 107 [regexp "^\[0-9a-f\]{7,}\$" ${github.version}] && \ 108 108 ![regexp "^\[0-9\]{8}\$" ${github.version}]} { 109 109 livecheck.type regexm 110 default livecheck.url {${github.homepage}/commits/${github.livecheck.branch}.atom}110 livecheck.url ${github.homepage}/commits/${github.livecheck.branch}.atom 111 111 livecheck.regex <id>tag:github.com,2008:Grit::Commit/(\[0-9a-f\]{[string length ${github.version}]})\[0-9a-f\]*</id> 112 112 } else { 113 113 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 | |
---|---|
1 | DEBUG: Starting logging for iperf3-devel |
2 | DEBUG: macOS 10.13 (darwin/17.5.0) arch i386 |
3 | DEBUG: MacPorts 2.5.0 |
4 | DEBUG: Xcode 9.4 |
5 | DEBUG: SDK 10.13 |
6 | DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.13 |
7 | DEBUG: Executing org.macports.main (iperf3-devel) |
8 | DEBUG: livecheck phase started at Sat Jun 2 10:53:55 CDT 2018 |
9 | DEBUG: Executing org.macports.livecheck (iperf3-devel) |
10 | DEBUG: Port (livecheck) version is 3e58489a5823126fd1d51fcfb74994f9e8fe4e86 |
11 | DEBUG: Fetching https://github.com/esnet/iperf/commits/master.atom |
12 | DEBUG: The regex is "<id>tag:github.com,2008:Grit::Commit/([0-9a-f]{40})[0-9a-f]*</id>" |
13 | DEBUG: The regex matched "<id>tag:github.com,2008:Grit::Commit/7f883016bb77a39f11f6c62094c990a1dfef986e</id>", extracted "7f883016bb77a39f11f6c62094c990a1dfef986e" |
14 | iperf3-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 |
comment:2 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 107 107 [regexp "^\[0-9a-f\]{7,}\$" ${github.version}] && \ 108 108 ![regexp "^\[0-9\]{8}\$" ${github.version}]} { 109 109 livecheck.type regexm 110 default livecheck.url {${github.homepage}/commits/${github.livecheck.branch}.atom}110 livecheck.url ${github.homepage}/commits/${github.livecheck.branch}.atom 111 111 livecheck.regex <id>tag:github.com,2008:Grit::Commit/(\[0-9a-f\]{[string length ${github.version}]})\[0-9a-f\]*</id> 112 112 } else { 113 113 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 follow-up: 5 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: | new → closed |
comment:5 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.
I was actually trying to move the github portgroup toward using
default
for alllivecheck.*
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.