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

bump(main/grafana): 11.0.0 #20489

Merged
merged 6 commits into from
Jun 11, 2024
Merged

bump(main/grafana): 11.0.0 #20489

merged 6 commits into from
Jun 11, 2024

Conversation

Neo-Oli
Copy link
Member

@Neo-Oli Neo-Oli commented Jun 10, 2024

Hi,
I am trying to update Grafana to version 11.0.0 as the available version 8.5.27 is quite old. There seem to be quite some changes to the build system, so it isn't as easy as I'd hoped. I think I am close to the build succeeding, but I am stumped by the build errors I am getting. Here's the log:

Running container 'termux-package-builder' from image 'ghcr.io/termux/package-builder'...                                                                                                                                                               [0/0]termux - building grafana for arch aarch64...                                                                                 
Building dependency yarn if necessary...
[email protected] built - skipping (rm /data/data/.built-packages/yarn to force rebuild)
➤ YN0000: Downloading https://repo.yarnpkg.com/4.2.2/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.2.2.cjs
➤ YN0000: Done in 0s 292ms
generate go files
go run ./pkg/build/wire/cmd/wire/main.go gen -tags "oss" ./pkg/server
wire: github.com/grafana/grafana/pkg/server: wrote /home/builder/.termux-build/grafana/src/pkg/server/wire_gen.go
build go files
go run build.go -goos=android -goarch=arm64 -cc=aarch64-linux-android-clang   build
Version: 11.0.0, Linux Version: 11.0.0, Package Iteration: 1718045003
building binaries build
building grafana ./pkg/cmd/grafana
rm -r ./bin/android-arm64/grafana
rm -r ./bin/android-arm64/grafana.md5
go build -ldflags -w -X main.version=11.0.0 -X main.commit=277ef258 -X main.buildstamp=1718029427 -X main.buildBranch=HEAD -extldflags "-L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -fno-openmp-implicit-rpath -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now" -o ./bin/android-arm64/grafana ./pkg/cmd/grafana
# github.com/hashicorp/go-sockaddr
../../../go/pkg/mod/github.com/hashicorp/[email protected]/route_info_android.go:8:6: routeInfo redeclared in this block
        ../../../go/pkg/mod/github.com/hashicorp/[email protected]/route_info.go:19:6: other declaration of routeInfo
../../../go/pkg/mod/github.com/hashicorp/[email protected]/route_info_default.go:11:6: NewRouteInfo redeclared in this block
        ../../../go/pkg/mod/github.com/hashicorp/[email protected]/route_info_android.go:14:6: other declaration of NewRouteInfo
../../../go/pkg/mod/github.com/hashicorp/[email protected]/route_info_default.go:17:21: method routeInfo.GetDefaultInterfaceName already declared at ../../../go/pkg/mod/github.com/hashicorp/[email protected]/route_info_android.go:22:21
exit status 1
exit status 1
make: *** [Makefile:134: build-go] Error 1
build finished

The errors point to an issue in go-sockaddr. The android specific code doesn't seem to have been kept up to date possibly.
I am however not a hundred percent sure if these are errors or just warnings, with the exit status 1 being unrelated.

I did try to compile for GOOS=linux instead, but this led to this (possibly related) error:

# net
../../_cache/go1.22.3/src/net/cgo_resnew.go:20:76: cannot use _Ctype_socklen_t(len(b)) (value of type _Ctype_uint) as _Ctype_ulong value in argument to (_C2func_getnameinfo)
exit status 1

This is the first package I am trying to build in a long time now, so any hints would be appreciated.

@Grimler91
Copy link
Member

I believe

type routeInfo struct {
	cmds map[string][]string
}

should be removed from route_info_android.go. Have a look at hashicorp/go-sockaddr@eeae47b which removed it from all the other route_info_* files.

Since this is golang I guess we need to sed it from downloaded dependencies, or open a PR upstream and hope that they are willing to create a new tag somewhat soon (and then patch grafana to use newer go-sockaddr version)

@Neo-Oli Neo-Oli changed the title Update Grafana (help needed) Update Grafana Jun 10, 2024
@Neo-Oli
Copy link
Member Author

Neo-Oli commented Jun 10, 2024

@Grimler91 Thanks for the hint. That was indeed the issue. I opened a Pull Request hashicorp/go-sockaddr#58, but I am not sure it will get merged. They require me to sign some dumb CLA and I haven't yet decided if I should sign that.

In the meantime I added a local patch. Patching a go project on the fly proved to be a bit tricky, let me know if there is a better way to do that.

With this it should now build. At least it does locally. I am still trying to figure out why the cloud builds fail. Something about disk space?

@Neo-Oli
Copy link
Member Author

Neo-Oli commented Jun 11, 2024

@Grimler91 I tried to get rid of as much stuff as possible without getting silly, but the builders still run out of storage. Locally it works fine and only uses about 2 GB of storage, which doesn't seem that big. Is this really an issue with my build or is there some infrastructure issue?

@Neo-Oli Neo-Oli marked this pull request as ready for review June 11, 2024 00:03
@Grimler91
Copy link
Member

Seems to just be for x86_64, maybe that one does something differently. Have tried adding grafana to the list of "big packages" now in any case, let's see if it solves it

@Neo-Oli
Copy link
Member Author

Neo-Oli commented Jun 11, 2024

@Grimler91 It was definitely all of them for most of the builds. I think it was just right at the maximum available size. It is possible that x86_64 is slightly larger. Locally the build env seems to be about 100-200 mb bigger.
Screenshot 2024-06-11 at 07-53-19 Update Grafana · termux_termux-packages@e6a0ae0

Do packages in big-pkgs.list just build without pulling docker and have therefore a bit more space available?

@Neo-Oli Neo-Oli changed the title Update Grafana bump(main/grafana): 11.0.0 Jun 11, 2024
@Grimler91
Copy link
Member

It deletes a bunch of pre-installed packages from github build container: https://github.com/termux/termux-packages/blob/master/.github/workflows/packages.yml#L199-L203. Seems like it did the trick in this case, nice!

Feel free to re-sign the PR if you are satisfied with tests and I can get this in with signatures and everything :)

We currently run out of space when trying to build for x86_64.
@Grimler91 Grimler91 merged commit c5db5fe into termux:master Jun 11, 2024
4 checks passed
@Grimler91
Copy link
Member

Thanks!

@Neo-Oli
Copy link
Member Author

Neo-Oli commented Jun 11, 2024

@Grimler91 Thank you for the help building this. I was a bit rusty.

@Grimler91
Copy link
Member

No problem, my pleasure. Nice work updating grafana! :)

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.

2 participants