#66727 closed defect (fixed)

totp-cli builds But does not Update Properly -- Missing Symbol - _clock_gettime

Reported by: RobK88 Owned by: manojkarthick (Manoj Karthick)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: lion Cc:
Port: totp-cli

Description

I was able to install totp-cli on my Mac running Lion using Macporst without any issue.

I was also able to successfully run sudo totp-cli update as recommended on the developer's Github website. But after the update, totp-cli no longer runs. See below:

bash-3.2$ sudo port clean totp-cli
--->  Cleaning totp-cli
bash-3.2$ 
bash-3.2$ sudo port install totp-cli
--->  Computing dependencies for totp-cli
--->  Fetching distfiles for totp-cli
--->  Verifying checksums for totp-cli
--->  Extracting totp-cli
--->  Configuring totp-cli
--->  Building totp-cli
--->  Staging totp-cli into destroot                     
--->  Installing totp-cli @1.1.17_0
--->  Activating totp-cli @1.1.17_0
--->  Cleaning totp-cli
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.
bash-3.2$ 
bash-3.2$ totp-cli version
totp-cli v1.1.17 (darwin/amd64)
bash-3.2$ 
bash-3.2$ sudo totp-cli update
Check...
 -> Download...
 -> Extract...
Now you have a fresh new totp-cli \o/
bash-3.2$ 
bash-3.2$ totp-cli version
dyld: Symbol not found: _clock_gettime
  Referenced from: /opt/local/bin/totp-cli
  Expected in: flat namespace

Trace/BPT trap: 5
bash-3.2$

Lion only runs an old vesion of Go. Perhaps that is the issue.

bash-3.2$ go version
go version go1.17.13 darwin/amd64
bash-3.2$

The port is also old. (The latest version is 1.2.4) Perhaps an updated port will fix the issue.

Attachments (2)

Portfile (5.0 KB) - added by RobK88 22 months ago.
Working Portfile for totp-cli v1.2.5
Portfile-totp-cli.diff (5.8 KB) - added by RobK88 22 months ago.
Diff Portfile Between 1.1.17 and 1.2.5

Download all attachments as: .zip

Change History (14)

comment:1 Changed 22 months ago by RobK88

I just updated the Portfile for totp-cli so it will try to build the latest version 1.2.5. (See attached)

But the build fails. It looks like there is a missing dependency -- golang.org/x/term. See the end of main.log reproduced below:

:info:build internal/terminal/terminal.go:10:2: cannot find package "golang.org/x/term" in any of:
:info:build     /opt/local/lib/go/src/golang.org/x/term (from $GOROOT)
:info:build     /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/gopath/src/golang.org/x/term (from $GOPATH)
:info:build Command failed:  cd "/opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/gopath/src/github.com/yitsushi/totp-cli" && /opt/local/bin/go build 
:info:build Exit code: 1
:error:build Failed to build totp-cli: command execution failed
:debug:build Error code: CHILDSTATUS 4245 1
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/main.log for details.

Does anyone know how to add the missing dependency to the Portfile?

comment:2 Changed 22 months ago by jmroot (Joshua Root)

Cc: smanojkarthick@… removed
Owner: set to manojkarthick
Status: newassigned

comment:3 Changed 22 months ago by RobK88

I was able to finally add the missing dependency --golang/x/term.

Now totp-cli version 1.2.5 builds just fine and it even runs on my old Mac running Lion.

Grinchs-Mac-Pro:~ grinch$ totp-cli version
totp-cli v1.2.5 (darwin/amd64)

Please see the attached working Portfile.

Just one question, when I run port lint --nitpick, I see the following warnings:

Grinchs-Mac-Pro:~ grinch$ port lint --nitpick totp-cli
--->  Verifying Portfile for totp-cli
Warning: go-yaml-yaml-9f266ea9e77c.tar.gz - missing recommended checksum type: sha256
Warning: go-yaml-yaml-9f266ea9e77c.tar.gz - missing recommended checksum type: size
Warning: go-yaml-yaml-9f266ea9e77c.tar.gz - missing recommended checksum type: rmd160
Warning: go-yaml-yaml-9f266ea9e77c.tar.gz - missing recommended checksum type: size
Warning: go-yaml-yaml-9f266ea9e77c.tar.gz - missing recommended checksum type: rmd160
Warning: go-yaml-yaml-9f266ea9e77c.tar.gz - missing recommended checksum type: sha256
Warning: go-yaml-yaml-v2.2.2.tar.gz - missing recommended checksum type: sha256
Warning: go-yaml-yaml-v2.2.2.tar.gz - missing recommended checksum type: size
Warning: go-yaml-yaml-v2.2.2.tar.gz - missing recommended checksum type: rmd160
Warning: go-yaml-yaml-v2.2.2.tar.gz - missing recommended checksum type: size
Warning: go-yaml-yaml-v2.2.2.tar.gz - missing recommended checksum type: rmd160
Warning: go-yaml-yaml-v2.2.2.tar.gz - missing recommended checksum type: sha256
Warning: golang-term-v0.4.0.tar.gz - missing recommended checksum type: sha256
Warning: golang-term-v0.4.0.tar.gz - missing recommended checksum type: size
Warning: golang-term-v0.4.0.tar.gz - missing recommended checksum type: rmd160
Warning: golang-term-v0.4.0.tar.gz - missing recommended checksum type: size
Warning: golang-term-v0.4.0.tar.gz - missing recommended checksum type: rmd160
Warning: golang-term-v0.4.0.tar.gz - missing recommended checksum type: sha256
Warning: golang-sys-97732733099d.tar.gz - missing recommended checksum type: sha256
Warning: golang-sys-97732733099d.tar.gz - missing recommended checksum type: size
Warning: golang-sys-97732733099d.tar.gz - missing recommended checksum type: rmd160
Warning: golang-sys-97732733099d.tar.gz - missing recommended checksum type: size
Warning: golang-sys-97732733099d.tar.gz - missing recommended checksum type: rmd160
Warning: golang-sys-97732733099d.tar.gz - missing recommended checksum type: sha256
Warning: golang-crypto-70a84ac30bf9.tar.gz - missing recommended checksum type: sha256
Warning: golang-crypto-70a84ac30bf9.tar.gz - missing recommended checksum type: size
Warning: golang-crypto-70a84ac30bf9.tar.gz - missing recommended checksum type: rmd160
Warning: golang-crypto-70a84ac30bf9.tar.gz - missing recommended checksum type: size
Warning: golang-crypto-70a84ac30bf9.tar.gz - missing recommended checksum type: rmd160
Warning: golang-crypto-70a84ac30bf9.tar.gz - missing recommended checksum type: sha256
Warning: yitsushi-go-commander-v1.1.0.tar.gz - missing recommended checksum type: sha256
Warning: yitsushi-go-commander-v1.1.0.tar.gz - missing recommended checksum type: size
Warning: yitsushi-go-commander-v1.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: yitsushi-go-commander-v1.1.0.tar.gz - missing recommended checksum type: size
Warning: yitsushi-go-commander-v1.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: yitsushi-go-commander-v1.1.0.tar.gz - missing recommended checksum type: sha256
Warning: yitsushi-github-release-check-v1.0.1.tar.gz - missing recommended checksum type: sha256
Warning: yitsushi-github-release-check-v1.0.1.tar.gz - missing recommended checksum type: size
Warning: yitsushi-github-release-check-v1.0.1.tar.gz - missing recommended checksum type: rmd160
Warning: yitsushi-github-release-check-v1.0.1.tar.gz - missing recommended checksum type: size
Warning: yitsushi-github-release-check-v1.0.1.tar.gz - missing recommended checksum type: rmd160
Warning: yitsushi-github-release-check-v1.0.1.tar.gz - missing recommended checksum type: sha256
Warning: stretchr-testify-v1.6.1.tar.gz - missing recommended checksum type: sha256
Warning: stretchr-testify-v1.6.1.tar.gz - missing recommended checksum type: size
Warning: stretchr-testify-v1.6.1.tar.gz - missing recommended checksum type: rmd160
Warning: stretchr-testify-v1.6.1.tar.gz - missing recommended checksum type: size
Warning: stretchr-testify-v1.6.1.tar.gz - missing recommended checksum type: rmd160
Warning: stretchr-testify-v1.6.1.tar.gz - missing recommended checksum type: sha256
Warning: stretchr-objx-v0.1.0.tar.gz - missing recommended checksum type: sha256
Warning: stretchr-objx-v0.1.0.tar.gz - missing recommended checksum type: size
Warning: stretchr-objx-v0.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: stretchr-objx-v0.1.0.tar.gz - missing recommended checksum type: size
Warning: stretchr-objx-v0.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: stretchr-objx-v0.1.0.tar.gz - missing recommended checksum type: sha256
Warning: pmezard-go-difflib-v1.0.0.tar.gz - missing recommended checksum type: sha256
Warning: pmezard-go-difflib-v1.0.0.tar.gz - missing recommended checksum type: size
Warning: pmezard-go-difflib-v1.0.0.tar.gz - missing recommended checksum type: rmd160
Warning: pmezard-go-difflib-v1.0.0.tar.gz - missing recommended checksum type: size
Warning: pmezard-go-difflib-v1.0.0.tar.gz - missing recommended checksum type: rmd160
Warning: pmezard-go-difflib-v1.0.0.tar.gz - missing recommended checksum type: sha256
Warning: mitchellh-go-homedir-v1.1.0.tar.gz - missing recommended checksum type: sha256
Warning: mitchellh-go-homedir-v1.1.0.tar.gz - missing recommended checksum type: size
Warning: mitchellh-go-homedir-v1.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: mitchellh-go-homedir-v1.1.0.tar.gz - missing recommended checksum type: size
Warning: mitchellh-go-homedir-v1.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: mitchellh-go-homedir-v1.1.0.tar.gz - missing recommended checksum type: sha256
Warning: kardianos-osext-2bc1f35cddc0.tar.gz - missing recommended checksum type: sha256
Warning: kardianos-osext-2bc1f35cddc0.tar.gz - missing recommended checksum type: size
Warning: kardianos-osext-2bc1f35cddc0.tar.gz - missing recommended checksum type: rmd160
Warning: kardianos-osext-2bc1f35cddc0.tar.gz - missing recommended checksum type: size
Warning: kardianos-osext-2bc1f35cddc0.tar.gz - missing recommended checksum type: rmd160
Warning: kardianos-osext-2bc1f35cddc0.tar.gz - missing recommended checksum type: sha256
Warning: davecgh-go-spew-v1.1.0.tar.gz - missing recommended checksum type: sha256
Warning: davecgh-go-spew-v1.1.0.tar.gz - missing recommended checksum type: size
Warning: davecgh-go-spew-v1.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: davecgh-go-spew-v1.1.0.tar.gz - missing recommended checksum type: size
Warning: davecgh-go-spew-v1.1.0.tar.gz - missing recommended checksum type: rmd160
Warning: davecgh-go-spew-v1.1.0.tar.gz - missing recommended checksum type: sha256
--->  0 errors and 78 warnings found.
Grinchs-Mac-Pro:~ grinch$

Why? The required checksums are in the Portfile. Is this a bug in Macports?

comment:4 Changed 22 months ago by RobK88

comment:5 Changed 22 months ago by RobK88

After I submitted the PR, the Macports build system tried to build totp-cli v1.2.5 on macOS 11 (Big Sur) but failed. But totp-cli version 1.2.5 does build on Lion using this Portfile.

Any ideas for a fix for Big Sur?

comment:6 Changed 22 months ago by RobK88

I was able to fix the Portfile so totp-cli will build and run on newer versions of macOS.

The Portfile for totp-cli v1.2.5 will now build and run totp-cli not only on my old Mac running Lion but also on Big Sur and Monterey. I needed to add a missing dependency (golang/x/term) and change one of the dependencies (golang.org/x/sys) to the latest version!

See https://github.com/macports/macports-ports/pull/17418

I will also upload the Portfile and diff here for your convenience.

I am no sure whether any of the other dependencies will need to be changed to a newer version for bug or security reasons. I ahve asked the developer for input. See https://github.com/yitsushi/totp-cli/issues/62

comment:7 Changed 22 months ago by RobK88

P.S. I just noticed that the existing port for totp-cli v1.1.17 is broken on High Sierra and presumably on all the newer macOS releases due the dependency issues. The updated Portfile fixes all that!

comment:8 Changed 22 months ago by RobK88

I have updated all of the dependencies in the Portfile for totp-cli v1.2.5. (see Attached updated Portfile and Diff file) and have pushed the changes to the Pull Request on Macports.

There is only one dependency that I am not sure of. It is a dependency written by the developer of totp-cli -- github.com/yitsushi/github-release-check. The Portfile for totp-cli has this dependency set (or locked) at v1.0.1. I do not even see that tag on GitHub. But Macports is still able to pull the code when the port is being installed. I have asked the developer whether this dependency needs to be updated in the Portfile.

Last edited 22 months ago by RobK88 (previous) (diff)

Changed 22 months ago by RobK88

Attachment: Portfile added

Working Portfile for totp-cli v1.2.5

Changed 22 months ago by RobK88

Attachment: Portfile-totp-cli.diff added

Diff Portfile Between 1.1.17 and 1.2.5

comment:9 Changed 22 months ago by RobK88

The developer for totp-cli and github-release-check has confirmed that Release 1.0.1 is the latest release for the dependency github-release-check needed for totp-cli.

So the Pull Request for totp-cli v1.2.5 is all good and ready to be merged into the Macports repo.

Last edited 22 months ago by RobK88 (previous) (diff)

comment:10 Changed 22 months ago by RobK88

Since I have upgraded Macports from 2.8.0 to 2.8.1, the port no longer builds on lion and Mtn lion. Why??

One now sees:

Error: Failed to extract totp-cli: extract.rename: multiple directories exist in /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work: /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/davecgh-go-spew-152484f /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/go-yaml-yaml-7649d45 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/go-yaml-yaml-f6f7691 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/golang-crypto-3d872d0 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/golang-sys-b60007c /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/golang-term-1efcd90 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/kardianos-osext-2bc1f35 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/mitchellh-go-homedir-af06845 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/pmezard-go-difflib-c0b812d /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/stretchr-objx-50a2c06 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/stretchr-testify-acba37e /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/yitsushi-github-release-check-1621f7c /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/yitsushi-go-commander-124e4e1 /opt/local/var/macports/build/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/work/yitsushi-totp-cli-97ae6cc
Error: See /opt/local/var/macports/logs/_Users_grinch_Macports_ports_security_totp-cli/totp-cli/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port totp-cli failed

comment:11 Changed 22 months ago by RobK88

Joshua Root fixed the bug with MacPorts 2.8.1. totp-cli now builds again without any issues on Lion and Mtn Lion.

P.S. In case you are curious, here is the description of the bug: "the github portgroup behaves differently when the extract.rename option exists, and the golang portgroup interacted badly with that."

I am glad the bug is fixed. Thanks Joshua!

Last edited 21 months ago by RobK88 (previous) (diff)

comment:12 Changed 21 months ago by RobK88

Resolution: fixed
Status: assignedclosed

In 589ffc2e8d7a9f5e88d600fbd22eac928486ca05/macports-ports (master):

totp-cli: Update to version 1.2.5

  • Fix build issues on recent versions of macOS
  • Add missing dependency - golang.org/x/term
  • Update existing dependencies to latest versions
  • Add myself as a maintainer of the port

CLOSES: #66727

Note: See TracTickets for help on using tickets.