Closed na4ma4 closed 3 years ago
Not sure if it's a good idea or not, but maybe putting in targets to catch artifacts/build/(debug|release)/(linux|darwin|windows)/%
with a $(error)
message that it needs to be changed would be helpful.
Is there any particular reason to switch from a slash (and hence separate directories) to a hyphen between OS and ARCH ?
Nope, and if I remove that from it, it's only a BC break for existing ARM projects since arm5
becomes arm_5
.
If you are happy for that BC break (as ARM's only user currently) I will try to solve this now
So basically
artifacts/build/debug/darwin/arm64/rsc
artifacts/build/debug/linux/arm64/rsc
artifacts/build/debug/linux/arm_5/rsc
artifacts/build/debug/linux/arm_7/rsc
and potentially future artifacts/build/debug/darwin/arm64_9/rsc
I'm down for that, you're already in the code, did you want to do it, or did you want a PR ?
In regards to the run
convention, it's simply no longer correct to use GOHOSTARCH
there. I'd like to just add another variable that is the full build path for the current platform, but I don't think it's currently possible (or at least easy) to detect the correct ARM version if building on arm5/6/7, since go env
doesn't show GOARM
.
I'm down for that, you're already in the code, did you want to do it, or did you want a PR ?
All good, I'm in there messing about now
This would be a BC break on the makefiles, but my suggestion is segmenting the artifacts/build path to include the
OS-ARCH_ARM
.So
artifacts/build/debug/linux/amd64/rsc
would becomeartifacts/build/debug/linux-amd64/rsc
. This is a small change (but BC breaking) for most common build configurations, but now that ARM is becoming more popular it means more compatibility for things likeartifacts/build/debug/darwin-arm64/rsc
(Apple Silicon)artifacts/build/debug/linux-arm_7/rsc
(RPi 3)artifacts/build/debug/linux-arm_5/rsc
(RPi Zero)This also covers if there is a future version of ARM (
ARMv9
) which would becomelinux-arm64_9
.This is mainly for ARM since I really doubt there will be a new
amd64
revision requiring something likelinux-amd64_2
.The main caveat is that when running on a machine the
GOARM
is optional, so where the following pattern is common:changing to
artifacts/build/debug/$(GOHOSTOS)-$(GOHOSTARCH)/rsc
will work, but the cross-compilation won't match.It's not a huge issue, but it's just something to think about (
linux-arm
would work if I ranmake run
on an RPi zero, but the actual cross-compiled build would need to belinux-arm_5
).