go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.28k stars 195 forks source link

Unable to build version from source v0.17.0 #942

Closed zaa76 closed 1 year ago

zaa76 commented 1 year ago

Debian 10 x64 I have glibc -2.28

root@gisapp:[/usr/local/src] ./tegola ./tegola: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by ./tegola) ./tegola: /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.33' not found (required by ./tegola) ./tegola: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./tegola)

Build :

root@gisapp:[/usr/local/src] virtualenv --python=/usr/bin/python3 --prompt="(ENV)" /opt/node root@gisapp:[/usr/local/src] source /opt/node/bin/activate root@gisapp:[/usr/local/src] pip3 install -e git+https://github.com/ekalinin/nodeenv.git#egg=nodeenv root@gisapp:[/usr/local/src] nodeenv --python-virtualenv /opt/node root@gisapp:[/usr/local/src] node -v v20.5.1

root@gisapp:[/usr/local/src] wget https://go.dev/dl/go1.20.5.linux-amd64.tar.gz root@gisapp:[/usr/local/src] tar -xzvf go1.20.5.linux-amd64.tar.gz -C /opt root@gisapp:[/usr/local/src] export PATH=$PATH:/opt/go/bin root@gisapp:[/usr/local/src] export GOBIN=/opt/go/bin root@gisapp:[/usr/local/src] export GOOS=linux root@gisapp:[/usr/local/src] export GOARCH=amd64 root@gisapp:[/usr/local/src] go install golang.org/x/tools/cmd/stringer@latest root@gisapp:[/usr/local/src] go install github.com/mmcloughlin/addchain/cmd/addchain@latest root@gisapp:[/usr/local/src] go install golang.org/x/tools/cmd/bundle@latest root@gisapp:[/usr/local/src] go install golang.org/x/tools/gopls@latest

Maybe error: ... 2023/08/15 13:41:03 open ../../compile/internal/typecheck/builtin/runtime.go: no such file or directory exit status 1 /opt/go/src/cmd/internal/goobj/builtin.go:38: running "go": exit status 1 ... FIX: root@gisapp:[/usr/local/src] cp -r /opt/go/src/cmd/compile/internal/typecheck/_builtin /opt/go/src/cmd/compile/internal/typecheck/builtin

root@gisapp:[/usr/local/src] go version go version go1.20.5 linux/amd64

root@gisapp:[/usr/local/src] git clone --depth 1 --branch v0.17.0 https://github.com/go-spatial/tegola.git tegola-v0.17.0 root@gisapp:[/usr/local/src] cd tegola-v0.17.0 root@gisapp:[/usr/local/src/tegola-v0.17.0] git checkout -b v0.17.0

root@gisapp:[/usr/local/src/tegola-v0.17.0] go generate ... go: not generating in packages in dependency modules === RUN TestScript vcs-test.golang.org rerouted to http://127.0.0.1:35201 https://vcs-test.golang.org rerouted to https://127.0.0.1:38489 go test proxy running at GOPROXY=http://127.0.0.1:38211/mod === RUN TestScript/README scriptreadme_test.go:74: testdata/script/README is up to date. --- PASS: TestScript (0.08s) --- PASS: TestScript/README (0.05s) PASS ok cmd/go 0.132s 2023/08/15 13:44:31 Generating p224.go... 2023/08/15 13:44:31 Generating p256.go... addchain: expr: "28948022302589062190674361737351893382521535853822578548883407827216774463488" addchain: hex: 3fffffffc0000000400000000000000000000000400000000000000000000000 addchain: dec: 28948022302589062190674361737351893382521535853822578548883407827216774463488 addchain: best: opt(dictionary(sliding_window(16),continued_fractions(dichotomic))) addchain: cost: 260 2023/08/15 13:44:32 Generating p384.go... addchain: expr: "9850501549098619803069760025035903451269934817616361666987073351061430442874217582261816522064734500465401743278080" addchain: hex: 3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffc00000000000000040000000 addchain: dec: 9850501549098619803069760025035903451269934817616361666987073351061430442874217582261816522064734500465401743278080 addchain: best: opt(runs(heuristic(use_first(halving,approximation)))) addchain: cost: 395 2023/08/15 13:44:32 Generating p521.go... addchain: expr: "1716199415032652428745475199770348304317358825035826352348615864796385795849414013030639910165363638744324077847870214509280496999929160953143507072778764288" addchain: hex: 8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 addchain: dec: 1716199415032652428745475199770348304317358825035826352348615864796385795849414013030639910165363638744324077847870214509280496999929160953143507072778764288 addchain: best: opt(dictionary(sliding_window(4),heuristic(use_first(halving,delta_largest)))) addchain: cost: 519 checking to see if we can remove build.go no checking to see if we can remove cgo.generated.go yes checking to see if we can remove no_azblob_cache.generated.go yes checking to see if we can remove no_gpkg_provider.generated.go yes checking to see if we can remove no_postgis_provider.generated.go yes checking to see if we can remove no_prometheus_observer.generated.go yes checking to see if we can remove no_redis_cache.generated.go yes checking to see if we can remove no_s3_cache.generated.go yes checking to see if we can remove no_viewer.generated.go yes checking to see if we can remove no_viewer.go no checking to see if we can remove not_cgo.generated.go yes checking to see if we can remove not_no_azblob_cache.generated.go yes checking to see if we can remove not_no_gpkg_provider.generated.go yes checking to see if we can remove not_no_postgis_provider.generated.go yes checking to see if we can remove not_no_prometheus_observer.generated.go yes checking to see if we can remove not_no_redis_cache.generated.go yes checking to see if we can remove not_no_s3_cache.generated.go yes checking to see if we can remove not_no_viewer.generated.go yes checking to see if we can remove not_pprof.generated.go yes checking to see if we can remove pprof.generated.go yes checking to see if we can remove tags no checking to see if we can remove viewer.go no wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_azblob_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_azblob_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_gcs_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_gcs_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_gpkg_provider.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_gpkg_provider.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_hana_provider.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_hana_provider.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_postgis_provider.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_postgis_provider.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_prometheus_observer.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_prometheus_observer.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_redis_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_redis_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_s3_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_s3_cache.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/no_viewer.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_no_viewer.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/cgo.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_cgo.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/pprof.generated.go wrote file: /usr/local/src/tegola-v0.17.0/internal/build/not_pprof.generated.go Changed to directory: /usr/local/src/tegola-v0.17.0/ui Running: npm version Running: npx browserslist@latest --update-db Running: npm install Running: npm run build success cgo: cannot parse race_darwin_arm64.syso as ELF, Mach-O, PE or XCOFF

root@gisapp:[/usr/local/src/tegola-v0.17.0] cd cmd/tegola root@gisapp:[/usr/local/src/tegola-v0.17.0/cmd/tegola] go build -mod vendor

root@gisapp:[/usr/local/src/tegola-v0.17.0/cmd/tegola] ./tegola version version: version not set git: not set @ not set build tags: !noAzblobCache !noGCSCache !noGpkgProvider !noHanaProvider !noPostgisProvider !noPrometheusObserver !noRedisCache !noS3Cache !noViewer !pprof cgo ui viewer: viewer not build

Please HELP!

ARolek commented 1 year ago

@zaa76 can you try building with Go 1.21? There was an issue in Go 1.20.5 when compiling with CGO.

zaa76 commented 1 year ago

I tried The problem is that even with successful builds, the Viewer is missing

ARolek commented 1 year ago

@zaa76 did you run go generate ./... from the repo root? You will need to do that to build the UI. We don't currently version the UI build artifacts. You can look at the CI workflow file as a reference: https://github.com/go-spatial/tegola/blob/v0.18.0/.github/workflows/on_release_publish.yml#L61

ARolek commented 1 year ago

@zaa76 were you able to get the ui working?

zaa76 commented 1 year ago

I can't build with UI

go version go1.21.0 linux/amd64

export BUILD_PKG=github.com/go-spatial/tegola/internal/build export GIT_REVISION=$(git log HEAD --oneline | head -n 1 | cut -d ' ' -f 1) export GIT_BRANCH=$(git describe --all --exact-match 2>/dev/null | sed 's=.*/==') export VERSION=v0.18.0

cd /usr/local/src/tegola_v0.18.0 go generate ./... warning: GOPATH set to GOROOT (/opt/go) has no effect checking to see if we can remove build.go no checking to see if we can remove cgo.generated.go yes checking to see if we can remove no_azblob_cache.generated.go yes checking to see if we can remove no_gpkg_provider.generated.go yes checking to see if we can remove no_postgis_provider.generated.go yes checking to see if we can remove no_prometheus_observer.generated.go yes checking to see if we can remove no_redis_cache.generated.go yes checking to see if we can remove no_s3_cache.generated.go yes checking to see if we can remove no_viewer.generated.go yes checking to see if we can remove no_viewer.go no checking to see if we can remove not_cgo.generated.go yes checking to see if we can remove not_no_azblob_cache.generated.go yes checking to see if we can remove not_no_gpkg_provider.generated.go yes checking to see if we can remove not_no_postgis_provider.generated.go yes checking to see if we can remove not_no_prometheus_observer.generated.go yes checking to see if we can remove not_no_redis_cache.generated.go yes checking to see if we can remove not_no_s3_cache.generated.go yes checking to see if we can remove not_no_viewer.generated.go yes checking to see if we can remove not_pprof.generated.go yes checking to see if we can remove pprof.generated.go yes checking to see if we can remove tags no checking to see if we can remove viewer.go no wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_azblob_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_azblob_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_gcs_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_gcs_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_gpkg_provider.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_gpkg_provider.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_hana_provider.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_hana_provider.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_postgis_provider.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_postgis_provider.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_prometheus_observer.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_prometheus_observer.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_redis_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_redis_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_s3_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_s3_cache.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/no_viewer.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_no_viewer.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/cgo.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_cgo.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/pprof.generated.go wrote file: /usr/local/src/tegola_v0.18.0/internal/build/not_pprof.generated.go warning: GOPATH set to GOROOT (/opt/go) has no effect Changed to directory: /usr/local/src/tegola_v0.18.0/ui Running: npm version Running: npx browserslist@latest --update-db Running: npm install Running: npm run build success

cd cmd/tegola go build -mod vendor -ldflags "-w -X ${BUILD_PKG}.Version=${VERSION} -X ${BUILD_PKG}.GitRevision=${GIT_REVISION} -X ${BUILD_PKG}.GitBranch=${GIT_BRANCH}" -tags "noAzblobCache noS3Cache noGpkgProvider noPrometheusObserver"

./tegola version version: v0.18.0 git: v0.18.0 @ 096b5d90 build tags: !noGCSCache !noHanaProvider !noPostgisProvider !noRedisCache !noViewer !pprof cgo noAzblobCache noGpkgProvider noPrometheusObserver noS3Cache ui viewer: viewer not build

jchamberlain commented 1 year ago

@zaa76, when you made the build mentioned in your last post, did you try going to the UI? Or did you see the "viewer not build" and stop there?

I noticed that ui viewer: viewer not build is always in the version output, even though the UI works for me when building locally. Based on your build output, I would expect that your viewer is actually functional and it's just the version output that's wrong.

ARolek commented 1 year ago

This code has landed in the master branch. Please give the build another try.