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

github-cli: update to 2.4.0. #34157

Merged
merged 1 commit into from
Jan 19, 2022
Merged

github-cli: update to 2.4.0. #34157

merged 1 commit into from
Jan 19, 2022

Conversation

shizonic
Copy link
Contributor

Testing the changes

  • I tested the changes in this PR: YES

revision=1
wrksrc="cli-${version}"
build_style=go
build_helper=qemu
go_import_path="github.com/cli/cli/cmd/gh"
go_ldflags="-X github.com/cli/cli/internal/build.Version=v${version}"
go_mod_mode="off"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using Go modules is definitely a regression. Can you show where it fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH: I don't know where execatly the problem is, but I get this error during building:

=> github-cli-2.2.0_1: building [go] [qemu] for x86_64...
   [host] go-1.17.2_1: found (https://alpha.de.repo.voidlinux.org/current)
=> github-cli-2.2.0_1: installing host dependencies: go-1.17.2_1 ...
=> github-cli-2.2.0_1: running pre-build hook: 02-script-wrapper ...
=> github-cli-2.2.0_1: running pre_build ...
=> github-cli-2.2.0_1: running do_build ...
no required module provides package github.com/cli/cli/cmd/gh; to add it:
	go get github.com/cli/cli/cmd/gh
=> ERROR: github-cli-2.2.0_1: do_build: 'go install -p "$XBPS_MAKEJOBS" -mod="${go_mod_mode}" -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}' exited with 1
=> ERROR:   in do_build() at common/build-style/go.sh:36

After I added go_mod_mode=off it worked, so I pushed it.

@NyaaaWhatsUpDoc
Copy link

NyaaaWhatsUpDoc commented Dec 30, 2021

Might we want to build this using the repository makefile? Also the version info we're pulling in for the ldflags looks to be not using the v2 major version. See the build process in: https://github.com/cli/cli/blob/trunk/script/build.go

That might be the issue causing the above too.

@NyaaaWhatsUpDoc
Copy link

Making the following change fixed things in my experience:

diff --git a/srcpkgs/github-cli/template b/srcpkgs/github-cli/template
index 3044ccc38b..4b1251b900 100644
--- a/srcpkgs/github-cli/template
+++ b/srcpkgs/github-cli/template
@@ -5,9 +5,8 @@ revision=1
 wrksrc="cli-${version}"
 build_style=go
 build_helper=qemu
-go_import_path="github.com/cli/cli/cmd/gh"
-go_ldflags="-X github.com/cli/cli/internal/build.Version=v${version}"
-go_mod_mode="off"
+go_import_path="github.com/cli/cli/v2/cmd/gh"
+go_ldflags="-X github.com/cli/cli/v2/internal/build.Version=v${version}"
 short_desc="GitHub CLI tool"
 maintainer="shizonic <realtiaz@gmail.com>"
 license="MIT"
@@ -20,7 +19,7 @@ pre_build() {
        local _date
        if [ "$SOURCE_DATE_EPOCH" ]; then
                _date="$(date --utc --date "@$SOURCE_DATE_EPOCH" "+%Y-%m-%d")"
-               go_ldflags="$go_ldflags -X github.com/cli/cli/internal/build.Date=${_date}"
+               go_ldflags="$go_ldflags -X github.com/cli/cli/v2/internal/build.Date=${_date}"
        fi
 }

@shizonic shizonic changed the title github-cli: update to 2.2.0. github-cli: update to 2.4.0. Jan 4, 2022
@shizonic
Copy link
Contributor Author

shizonic commented Jan 4, 2022

Thanks. Fixed it and bumped it to 1.4.0.

@paper42
Copy link
Member

paper42 commented Jan 13, 2022

@shizonic could you also fix update-check?

site="https://github.com/cli/cli/releases"
pattern='/tags/v\K[\d.]+(?=.tar.gz)'

@shizonic
Copy link
Contributor Author

Done.

@paper42 paper42 merged commit 9163cd9 into void-linux:master Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants