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+accounts: fix i386 compilation issue #951

Merged
merged 6 commits into from
Jan 23, 2025
Merged

Conversation

guggero
Copy link
Member

@guggero guggero commented Jan 23, 2025

Fixes a compilation issue that prevented the release build.
And in the process also updates and fixes a couple of things in the CI pipeline:

  • Add cross compilation steps (and don't cache the actual build cache as that can grow super large)
  • Update actions/checkout to the latest version
  • Fix the linter issue that sometimes caused a "permission denied" error in CI only
  • Cancel CI jobs for a previous run if the same PR is pushed again

This allows us to control the cache key and whether we want to cache the
Go build cache (which can grow very large).
Apparently the %d formatting directive implicitly uses `int` as its data
type, which on i386 systems is int32. So the value math.MaxInt64
overflows that value, which causes the compilation to fail.
This attempts to fix the following error that sometimes occurs on the
GitHub runners:

 go: github.com/lightninglabs/lightning-terminal imports
	github.com/lightningnetwork/lnd/kvdb imports
	github.com/lightningnetwork/lnd/kvdb/etcd imports
	go.etcd.io/etcd/server/v3/embed: mkdir /home/runner/go/pkg/mod/cache/download/go.etcd.io/etcd/server: permission denied

The suspicion is that the lint step that runs as root within docker
changes the permissions of some of the module cache directories.
So by simply changing the order of operations, this should be fixed.
This takes over two more settings we have in the lnd repo. The first is
to cancel existing CI runs for the same PR if it is pushed again before
the previous run has completed.

The second is just for consistency, to make sure all shells are bash
shells.
Copy link
Member

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

lgtm! thanks for this 💥

Comment on lines +247 to +248
return fmt.Errorf("amount %v exceeds the maximum of %v",
amount, int64(math.MaxInt64))
Copy link
Member

Choose a reason for hiding this comment

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

very interesting!

@@ -207,7 +207,7 @@ jobs:
run: mkdir -p app/build; touch app/build/index.html

- name: run check
run: make lint mod-check
run: make mod-check && make lint
Copy link
Member

Choose a reason for hiding this comment

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

great investigation skills 🏅

@@ -8,6 +8,15 @@ on:
branches:
- "*"

concurrency:
# Cancel any previous workflows if they are from a PR or push.
Copy link
Member

Choose a reason for hiding this comment

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

very nice 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, very nice 🚀!

Copy link
Contributor

@ViktorTigerstrom ViktorTigerstrom left a comment

Choose a reason for hiding this comment

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

tACK LGTM 🙏!

@@ -8,6 +8,15 @@ on:
branches:
- "*"

concurrency:
# Cancel any previous workflows if they are from a PR or push.
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, very nice 🚀!

@guggero guggero merged commit 396b898 into master Jan 23, 2025
15 of 16 checks passed
@guggero guggero deleted the compilation-fix branch January 23, 2025 11:22
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.

3 participants