-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Unable to build for target linux/amd64. #182
Comments
Yup CI doesn't appear to be rebuilding and testing the base images. I think it's because the images aren't being tagged locally during the build so instead of using the recently built "base" and "go-1.19.3" for "latest" it's just downloading the old one. I'm gonna try adding the setting ah looks like it should be Nope I don't know what to do! |
There was a bug in techknowlogick#182 whereby quoting was messed up - this PR correctly uses arrays to fix this Signed-off-by: Andrew Thornton <[email protected]>
There was a bug in techknowlogick#180 whereby quoting was messed up - this PR correctly uses arrays to fix this Fix techknowlogick#182 Signed-off-by: Andrew Thornton <[email protected]>
There was a bug in techknowlogick#180 whereby quoting was messed up - this PR correctly uses arrays to fix this Fix techknowlogick#182 Signed-off-by: Andrew Thornton <[email protected]>
* Remove ldflags from go get calls Signed-off-by: Andrew Thornton <[email protected]> * Fix broken build There was a bug in #180 whereby quoting was messed up - this PR correctly uses arrays to fix this Fix #182 Signed-off-by: Andrew Thornton <[email protected]> * And output images to local registry Signed-off-by: Andrew Thornton <[email protected]> * try load instead Signed-off-by: Andrew Thornton <[email protected]> * try again Signed-off-by: Andrew Thornton <[email protected]> * I give up I can't get this to update properly Signed-off-by: Andrew Thornton <[email protected]>
This is still broken for me somehow:
I have nothing changed on my build setup but the latest |
Switching back to an older digest of the image |
@zeripath Seems to be related to the change in Line 196 of https://github.com/techknowlogick/xgo/pull/184/files#diff-08ee30052ae3fc42f1e871d9cec2bd4c861efff636342532ef2cc43a9386daf7R196-R197 The resulting |
Removing |
Damn! Sorry about this! I have another PR that should fix that. |
diff --git a/docker/base/build.sh b/docker/base/build.sh
index 835d293..c134bfd 100644
--- a/docker/base/build.sh
+++ b/docker/base/build.sh
@@ -182,7 +182,7 @@ if [ "$FLAG_X" == "true" ]; then X=-x; fi
if [ "$FLAG_RACE" == "true" ]; then R=-race; fi
if [ "$FLAG_TAGS" != "" ]; then T=(--tags "$FLAG_TAGS"); fi
if [ "$FLAG_LDFLAGS" != "" ]; then LD=("${LD[@]}" "${FLAG_LDFLAGS[@]}"); fi
-if [ "$FLAG_GCFLAGS" != "" ]; then GC=(--gcflags="$FLAG_GCFLAGS"); fi
+if [ "$FLAG_GCFLAGS" != "" ]; then GC=(--gcflags=\""$FLAG_GCFLAGS"\"); fi
if [ "$FLAG_BUILDMODE" != "" ] && [ "$FLAG_BUILDMODE" != "default" ]; then BM=(--buildmode="${FLAG_BUILDMODE[@]}"); fi
if [ "$FLAG_TRIMPATH" == "true" ]; then TP=-trimpath; fi
@@ -193,7 +193,7 @@ if [ "$TARGETS" == "" ]; then
TARGETS="./."
fi
-if [ "${#LD[@]}" -gt 0 ]; then LDF=(--ldflags="${LD[@]}"); fi
+if [ "${#LD[@]}" -gt 0 ]; then LDF=(--ldflags=\""${LD[@]}"\"); fi
# Build for each requested platform individually
for TARGET in $TARGETS; do
@@ -439,7 +439,7 @@ for TARGET in $TARGETS; do
LDS=("-s" "${LDS[@]}")
fi
if [ ${#LDS[@]} -gt 0 ]; then
- LDFS=(--ldflags="${LDS[@]}")
+ LDFS=(--ldflags=\""${LDS[@]}"\")
fi
# Build the requested darwin binaries
if [ "$XGOARCH" == "." ] || [ "$XGOARCH" == "amd64" ]; then
|
Unfortunately the construction of the GCFLAGS and LDFLAGS arrays doesn't result in correct quoting. Forcibly quote these. Fix techknowlogick#182 Signed-off-by: Andrew Thornton <[email protected]>
No need to apologize. Does that work for you? I tried simple double quotes + escaping as well without success but maybe I made a mistake. |
Could you give me a quick test case? I checked with echo and it looked right. yup it's still wrong. |
This way, it fails in both cases for me. |
I just saw your comment above using the printf which I think is the way to go so I've pushed that up to the PR |
just rebuilding base and go1.19.3 - will retag locally and retest with gitea |
It's really a shame that we're having to go down the printf route - there should be a way of using bash arrays a bit more cleverly - but my bashfoo is failing me. |
Agree still ugly but I gave up after an hour as well trying to find another way. |
OK the printf route is confirmed to work here. I might use my powers to merge. |
I have a feeling we should restructure the dockers - the |
* Properly quote the GCFLAGS and LDFLAGS Unfortunately the construction of the GCFLAGS and LDFLAGS arrays doesn't result in correct quoting. Forcibly quote these. Fix #182 Signed-off-by: Andrew Thornton <[email protected]> * as per xoxys Signed-off-by: Andrew Thornton <[email protected]> Signed-off-by: Andrew Thornton <[email protected]>
Thanks @techknowlogick ! |
Thank you both. |
Today I was setting up a new building environment, and was unable to build for target linux/amd64.
At first I xgo gave me the following error message, and I thought that it was
ldflags
which broke the build:Then I proceeded to try building without
ldflags
flag, and xgo still failed:Here is my command for building the package:
It seems that pull request #180 broke some string concatenation stuff in
docker/base/build.sh
. And with an older xgo Docker image, the building process succeeded:The text was updated successfully, but these errors were encountered: