Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

totp-cli: Update dependencies #25466

Merged
merged 1 commit into from
Aug 26, 2024
Merged

totp-cli: Update dependencies #25466

merged 1 commit into from
Aug 26, 2024

Conversation

RobK88
Copy link
Contributor

@RobK88 RobK88 commented Aug 25, 2024

totp-cli: Update dependencies

  • Bump revision number
  • Update go dependencies to latest versions

Description

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.13.6 17G14042 x86_64
Xcode 10.1 10B61

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

* Bump revision number
* Update go dependencies to latest versions
@macportsbot
Copy link

Notifying maintainers:
@herbygillot for port totp-cli.
@manojkarthick for port totp-cli.

@RobK88
Copy link
Contributor Author

RobK88 commented Aug 25, 2024

P.S. I am curious. Why is this new line needed in the Portfile:

build.args-append   \
    -ldflags \"-X ${go.package}/internal/info.Version=${github.tag_prefix}${version}\"

@herbygillot
Copy link
Member

P.S. I am curious. Why is this new line needed in the Portfile:

build.args-append   \
    -ldflags \"-X ${go.package}/internal/info.Version=${github.tag_prefix}${version}\"

It's meant to set the version in code. That's what gets displayed when you do <command> -v or <command> version.

@RobK88
Copy link
Contributor Author

RobK88 commented Aug 25, 2024

Thanks for the explanation.

I see that without that line in the Portfile, totp-cli --version displays totp-cli version dev.

But with the line in the Portfile, totp-cli --version displays totp-cli version v1.8.7

@herbygillot
Copy link
Member

herbygillot commented Aug 25, 2024

Thanks for the explanation.

I see that without that line in the Portfile, totp-cli --version displays totp-cli version dev.

But with the line in the Portfile, totp-cli --version displays totp-cli version v1.8.7

Yes. The -X build ldflag allows you to set a specific value for a given variable at build time.

The default value for the Version variable in the ./internal/info package is dev, but we set it to the current version via -ldflags " -X ...Version=${version} ", where ${version} is interpolated to the version set in the Portfile.

@RobK88
Copy link
Contributor Author

RobK88 commented Aug 26, 2024

Thanks! I learned something new today!

@herbygillot
Copy link
Member

herbygillot commented Aug 26, 2024

Np.

So I think for this PR, this change counts as a fix for stealth updates:

https://trac.macports.org/wiki/PortfileRecipes#stealth-updates

Even if we increase the revision, MacPorts users and mirrors who have already downloaded these distfiles will now see a checksum mismatch.

The revision update applies only to the distfile for the main project itself (totp-cli), but not for the dependency Go module archives whose checksums have now changed.

So we'll have to try setting dist_subdir as per the linked stealth update section above. This will tell users and mirrors to download the distfiles to a different destination subdirectory, causing these distfiles to not have the same local path as the originals, and as a result, the new checksums should apply cleanly for everyone.

@herbygillot herbygillot merged commit 8e0bccf into macports:master Aug 26, 2024
3 checks passed
@herbygillot
Copy link
Member

Actually I was mistaken - since the version numbers are changing on the Go module archives, this is not a stealth update situation, and this PR looks fine to merge.

Thank you @RobK88

@RobK88 RobK88 deleted the totp-cli branch August 26, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants