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

Cross-platform build of Grafana #11557

Closed
xlson opened this issue Apr 11, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@xlson
Copy link
Contributor

commented Apr 11, 2018

  • re-work the crossplatform build poc into the Grafana build pipeline
    • Convert the build container into one with all the necessary dependencies for crossplatform builds
    • Modify build.go to be able to build binaries for the platforms we want to support (armv7, arm64, darwin, windows, amd64)
    • Update build.go to create archives for each platform
    • Update circleci to build archives for each platform
    • Figure out what needs to be done before we can marge the current version (would what we have currently work with master without breaking anything?)
    • Update build.go to create platform-specific packages for linux (deb, rpm)
    • Update the packaging to add the correct binary for phantomjs (amd64, windows, darwin)
  • publish packages for all platforms to grafana.net and s3
  • Make sure Grafana fails nicely when phanomjs is missing
  • test all packages on all platforms
  • make sure the changes hasn't broken the enterprise build

Implements parts of #9633

@Zuckonit

This comment has been minimized.

Copy link

commented Mar 26, 2019

still get error when build linux package on my mac os

➜  grafana git:(3f4c2e795) ✗ go run build.go -goos linux -pkg-arch amd64 build
Version: 6.0.2, Linux Version: 6.0.2, Package Iteration: 1553583659
rm -r ./bin/linux-amd64/grafana-server
rm -r ./bin/linux-amd64/grafana-server.md5
go version
go version go1.11.4 darwin/amd64
Targeting linux/amd64
go build -ldflags -w -X main.version=6.0.2 -X main.commit=3f4c2e795 -X main.buildstamp=1553000766 -X main.buildBranch=HEAD -o ./bin/linux-amd64/grafana-server ./pkg/cmd/grafana-server
# github.com/grafana/grafana/pkg/services/sqlstore/migrator
pkg/services/sqlstore/migrator/sqlite_dialect.go:89:27: undefined: sqlite3.Error
pkg/services/sqlstore/migrator/sqlite_dialect.go:90:32: undefined: sqlite3.ErrConstraintUnique
exit status 2
exit status 1
@xlson

This comment has been minimized.

Copy link
Contributor Author

commented Apr 1, 2019

@Zuckonit You need a compiler that can build sqlite for linux/amd64. This comment explains what you need to do: #13727 (comment)

@Zuckonit

This comment has been minimized.

Copy link

commented Apr 2, 2019

thanks, I have tried x86_64-linux-musl-gcc, build is ok, but cannot execute on linux amd64. well, its ok, I quit the cross-platform build, and make it at a linux machine.

@xlson

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2019

@anjingbin

This comment has been minimized.

Copy link

commented May 28, 2019

thanks, I have tried x86_64-linux-musl-gcc, build is ok, but cannot execute on linux amd64. well, its ok, I quit the cross-platform build, and make it at a linux machine.

Then, how about your buiding on linux machine without cross-platform? Zuckonit. I just build on linux for x86-64-linux, but it give the same errors:

`Version: 6.3.0-pre, Linux Version: 6.3.0, Package Iteration: 1559006085pre
rm -r ./bin/linux-amd64/grafana-server
rm -r ./bin/linux-amd64/grafana-server.md5
go version
go version go1.12.2 linux/amd64
Targeting linux/amd64
go build -ldflags -w -X main.version=6.3.0-pre -X main.commit=4965e10 -X main.buildstamp=1558955793 -X main.buildBranch=master -o ./bin/linux-amd64/grafana-server ./pkg/cmd/grafana-server

github.com/grafana/grafana/pkg/services/sqlstore/migrator

pkg/services/sqlstore/migrator/sqlite_dialect.go:89:27: undefined: sqlite3.Error
pkg/services/sqlstore/migrator/sqlite_dialect.go:90:32: undefined: sqlite3.ErrConstraintUnique
exit status 2
exit status 1`

@Zuckonit

This comment has been minimized.

Copy link

commented May 28, 2019

my building is ok, what's your command used for building

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.