keyman icon indicating copy to clipboard operation
keyman copied to clipboard

maint(core): dx: support 'arch' as synonym for current architecture

Open srl295 opened this issue 2 years ago • 2 comments

core/build.sh supports :arch on Linux meaning "current architecture".

We should support this on mac and windows also. Something like this:

diff --git a/core/build.sh b/core/build.sh
index 08ba60bcb7..f7c55a6f8c 100755
--- a/core/build.sh
+++ b/core/build.sh
@@ -36,6 +36,7 @@ case $BUILDER_OS in
     archtargets+=(
       ":x86    32-bit Windows (x86) build"
       ":x64    64-bit Windows (x64) build"
+      ":arch   Windows current architecture"
     )
     ;;
   mac)
@@ -43,6 +44,7 @@ case $BUILDER_OS in
       ":mac           Mac all architectures fat library build"
       ":mac-x86_64    Mac Intel build"
       ":mac-arm64     Mac arm64 (M1) build"
+      ":arch          Mac current architecture"
     )
     ;;
   linux)

Then we could just run core/build.sh test:arch (which is the command I usually run) and it would work on linux/win/mac the same.

I'd be fine with it being a synonym, wouldn't need to generate core/build/arch on a mac for example.

For that matter, arch on linux would be better off creating core/build/linux-$(uname -m)/… which would be core/build/linux-x86_64/ for example. Then arch remains a pseudo-target on all 3 platforms, and whatever uname -m returns becomes the calculated "current architecture" for linux. (x86_64, aarch64, …)

Caveat I don't really understand how the architecture selection works within build.sh so I might be talking through my hat here!

Could also have :current instead as an alias, which would select :arch on linux.

srl295 avatar Dec 22 '23 22:12 srl295

Workaround:

$ core/build.sh test:mac-$(uname -m)

srl295 avatar Dec 22 '23 22:12 srl295

This is a good idea. Mac and Windows are complicated because they need multiple architectures. For Linux, we have just supported current-arch but that is a little bit limiting. Let's discuss in 18.0.

mcdurdin avatar Jan 02 '24 04:01 mcdurdin