-
Notifications
You must be signed in to change notification settings - Fork 36
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
ci: change to use GitHub actions #239
Conversation
Signed-off-by: PoAn Yang <[email protected]>
Signed-off-by: PoAn Yang <[email protected]>
-X main.BuildDate=$BUILDDATE | ||
-linkmode external -extldflags -static" | ||
-X main.BuildDate=$BUILDDATE" | ||
[ "$(uname)" != "Darwin" ] && OTHER_LINKFLAGS="-extldflags -static" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This should not happen, as we build only on Linux, except for local development which is done on Mac.
It's better to explain why removing linkmod
, as it will be auto by default. We don't need to do it specially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @innobead, I copied these lines from https://github.com/longhorn/longhorn-manager/blob/4dbba5b1c1036acdbc35f01982b0f15fa00f5dc4/scripts/build#L6-L9.
If we put -linkmode external
, the make build
can't pass on MacBook.
+ CGO_ENABLED=0
+ GOARCH=amd64
+ go build -o bin/backing-image-manager-amd64 -ldflags '-X main.Version=e99083a-dirty
-X main.GitCommit=e99083a9ae07f8259456711fc58a06127dea3afd
-X main.BuildDate=2024-05-02T07:40:08+00:00
-linkmode external -extldflags -static' -cover -coverpkg=github.com/longhorn/backing-image-manager/...
# github.com/longhorn/backing-image-manager
loadinternal: cannot find runtime/cgo
/usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
If CGO_ENABLED
is changed to 1
, the error message change.
+ CGO_ENABLED=1
+ GOARCH=amd64
+ go build -o bin/backing-image-manager-amd64 -ldflags '-X main.Version=e99083a-dirty
-X main.GitCommit=e99083a9ae07f8259456711fc58a06127dea3afd
-X main.BuildDate=2024-05-02T07:44:32+00:00
-linkmode external -extldflags -static' -cover -coverpkg=github.com/longhorn/backing-image-manager/...
# runtime/cgo
gcc: error: unrecognized command line option '-m64'
If I remove -linkmode external
, the command can pass without error, but I think it's better to follow the style in longhorn-manager, so I add [ "$(uname)" != "Darwin" ] && OTHER_LINKFLAGS="-extldflags -static"
.
@FrankYang0529 let's do longhorn/longhorn#8467 (comment) in another PR. |
@mergify backport v1.6.x |
✅ Backports have been created
|
@mergify backport v1.5.x |
✅ Backports have been created
|
Which issue(s) this PR fixes:
longhorn/longhorn#8039
What this PR does / why we need it:
Special notes for your reviewer:
Additional documentation or context