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

Fix build on FreeBSD by updating foomo/simplecert dependency. #176

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

yonas
Copy link

@yonas yonas commented Sep 21, 2022

This updates the foomo/simplecert dependency in go.mod and go.sum.

Fix build on FreeBSD by updating foomo/simplecert dependency.
Fix build on FreeBSD by updating foomo/simplecert dependency.
@adamboutcher
Copy link
Collaborator

Looks sensible to me.

@adamboutcher adamboutcher added Improvement An Improvement of an already implemented feature Build build-related changes labels Oct 7, 2022
@yonas yonas closed this by deleting the head repository Oct 10, 2022
@adamboutcher adamboutcher reopened this Oct 10, 2022
@yonas
Copy link
Author

yonas commented Oct 18, 2022

Thanks @adamboutcher . Can we have this reviewed and committed?

@jemand771
Copy link
Member

hey @yonas, can you "un-delete" your fork+the branch this PR is coming from? github still shows everything fine, but I can't actually check out the changes to test them D:

I know github can restore deleted branches, not sure about repos. no worries if it doesn't work, you (or I) can always just put the changes on a new branch + make a new PR

@yonas
Copy link
Author

yonas commented Oct 24, 2022

@jemand771 Done.

@jemand771
Copy link
Member

go generate ./.. or make generate (using ubuntu 20) or step 28 in the docker build (alpine afaik) fails:

generate.go:14:2: missing go.sum entry for module providing package github.com/tdewolff/minify/v2; to add:
        go mod download github.com/tdewolff/minify/v2
generate.go:15:2: missing go.sum entry for module providing package github.com/tdewolff/minify/v2/html; to add:
        go mod download github.com/tdewolff/minify/v2
notifiers/notifiers.go:14: running "go": exit status 1
generate_help.go:9:2: missing go.sum entry for module providing package github.com/gomarkdown/markdown; to add:
        go mod download github.com/gomarkdown/markdown
generate_help.go:10:2: missing go.sum entry for module providing package github.com/gomarkdown/markdown/html; to add:
        go mod download github.com/gomarkdown/markdown
source/source.go:3: running "go": exit status 1
make: *** [Makefile:163: generate] Error 1

@adamboutcher
Copy link
Collaborator

@jemand771 Are you happy with this?

@jemand771
Copy link
Member

nu, the build fails (at least for me)
but yeah I forgot to add the actual review with my comment

Copy link
Member

@jemand771 jemand771 left a comment

Choose a reason for hiding this comment

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

see previous comments
(funnily enough github requires you to put text here)

@jemand771
Copy link
Member

hey @yonas, can you check whether builds on the dev branch are still broken for you? there have been a lot of somewhat chaotic changes recently, this might just have fixed itself

@yonas
Copy link
Author

yonas commented Jul 10, 2023

@jemand771 Still an issue:

cd source && rice embed-go
# github.com/lextoumbourou/goodhosts
/tmp/go/pkg/mod/github.com/lextoumbourou/goodhosts@v2.1.0+incompatible/goodhosts.go:108:36: undefined: eol
/tmp/go/pkg/mod/github.com/lextoumbourou/goodhosts@v2.1.0+incompatible/goodhosts.go:221:53: undefined: hostsFilePath

@adamboutcher
Copy link
Collaborator

@jemand771 Still an issue:

cd source && rice embed-go
# github.com/lextoumbourou/goodhosts
/tmp/go/pkg/mod/github.com/lextoumbourou/goodhosts@v2.1.0+incompatible/goodhosts.go:108:36: undefined: eol
/tmp/go/pkg/mod/github.com/lextoumbourou/goodhosts@v2.1.0+incompatible/goodhosts.go:221:53: undefined: hostsFilePath

I don't know go but this looks like its an issue with their package? I'm possibly wrong though so feel free to explain it to me.

@yonas
Copy link
Author

yonas commented Jul 12, 2023

@adamboutcher Some kind of bug in foomo/simplecert that got fixed in the latest version.

@adamboutcher
Copy link
Collaborator

Do all the dependencies need updating or just simple cert? It looks like previously the changes broke something for @jemand771 so if we can drop this to just the one dep it should be a happier merge?

@yonas
Copy link
Author

yonas commented Jul 13, 2023

@adamboutcher Yes, a bunch of other dependencies need to be updated as well.

To get around the issue @jemand771 mentioned, I wrote a script to download those modules and run git checkout go.mod go.sum just before running make clean generate embed:

 #!/bin/sh

 SIMPLECERT=$(xh https://api.github.com/repos/foomo/simplecert/releases/latest | gojq -r '.tag_name')
 echo "Updating simlecert to $SIMPLECERT..."
 sd 'github.com/foomo/simplecert.*$' "github.com/foomo/simplecert $SIMPLECERT" go.mod

 cd frontend
 yarn install --pure-lockfile --network-timeout 1000000
 yarn build && yarn cache clean
 doas pkg install -y sassc
 cd ..

 go mod download

 GO111MODULE=on CGO_ENABLED=1 go get github.com/stretchr/testify/assert && \
 GO111MODULE=on CGO_ENABLED=1 go get github.com/stretchr/testify/require && \
 GO111MODULE=on CGO_ENABLED=1 go get github.com/GeertJohan/go.rice/rice && \
 GO111MODULE=on CGO_ENABLED=1 go get github.com/cortesi/modd/cmd/modd && \
 GO111MODULE=on CGO_ENABLED=1 go get github.com/crazy-max/xgo
 GO111MODULE=on CGO_ENABLED=1 go get github.com/tdewolff/minify/v2
 GO111MODULE=on CGO_ENABLED=1 go get github.com/gomarkdown/markdown
 GO111MODULE=on CGO_ENABLED=1 go get github.com/fsnotify/fsnotify
 GO111MODULE=on CGO_ENABLED=1 go install github.com/GeertJohan/go.rice/rice@latest
 GO111MODULE=on CGO_ENABLED=1 go get github.com/prometheus/client_golang/prometheus
 GO111MODULE=on CGO_ENABLED=1 go get github.com/statping-ng/statping-ng/utils
 GO111MODULE=on CGO_ENABLED=1 go get github.com/statping-ng/statping-ng/types/null
 GO111MODULE=on CGO_ENABLED=1 go get github.com/aws/aws-sdk-go
 GO111MODULE=on CGO_ENABLED=1 go get github.com/aws/aws-sdk-go/aws/awsutil
 GO111MODULE=on CGO_ENABLED=1 go mod download github.com/tdewolff/minify/v2
 GO111MODULE=on CGO_ENABLED=1 go mod download github.com/gomarkdown/markdown

 cp -a frontend/dist source/

 git checkout go.mod go.sum
 make clean generate embed

 VERSION=$(git rev-list -1 HEAD)
 COMMIT=$(git rev-list -1 HEAD)

 go build -v -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" -o statping --tags "netgo freebsd" ./cmd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build build-related changes Improvement An Improvement of an already implemented feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants