Azure / Edge-infrastructure-quickstart-template

MIT License
5 stars 8 forks source link

[Bug] Running module-export and site-scale binaries on MacOS raises error: exec format error #72

Closed mikkiweesenaar closed 2 months ago

mikkiweesenaar commented 2 months ago

Describe the bug Using the private_preview.sh script, I am downloading the binaries; however during execution they raise the error: exec format error.

To Reproduce Steps to reproduce the behavior:

➜  edge-infrastructure-quickstart-template git:(main) ✗ bash ./private_preview.sh "[TOKEN]"
--2024-05-22 11:41:21--  https://aka.ms/az-edge-module-export-linux-amd64?[TOKEN]
Resolving aka.ms (aka.ms)... 173.223.118.95
Connecting to aka.ms (aka.ms)|173.223.118.95|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://iacbin.blob.core.windows.net/bin/az-edge-module-export-linux-amd64?[TOKEN] [following]
--2024-05-22 11:41:22--  https://iacbin.blob.core.windows.net/bin/az-edge-module-export-linux-amd64?[TOKEN]
Resolving iacbin.blob.core.windows.net (iacbin.blob.core.windows.net)... 20.60.132.100
Connecting to iacbin.blob.core.windows.net (iacbin.blob.core.windows.net)|20.60.132.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15067048 (14M) [application/octet-stream]
Saving to: ‘az-edge-module-export’

az-edge-module-export                                                        100%[=============================================================================================================================================================================================>]  14,37M  5,46MB/s    in 2,6s    

2024-05-22 11:41:25 (5,46 MB/s) - ‘az-edge-module-export’ saved [15067048/15067048]

--2024-05-22 11:41:25--  https://aka.ms/az-edge-site-scale-linux-amd64?[TOKEN]
Resolving aka.ms (aka.ms)... 173.223.118.95
Connecting to aka.ms (aka.ms)|173.223.118.95|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://iacbin.blob.core.windows.net/bin/az-edge-site-scale-linux-amd64?[TOKEN] [following]
--2024-05-22 11:41:25--  https://iacbin.blob.core.windows.net/bin/az-edge-site-scale-linux-amd64?[TOKEN]
Resolving iacbin.blob.core.windows.net (iacbin.blob.core.windows.net)... 20.60.132.100
Connecting to iacbin.blob.core.windows.net (iacbin.blob.core.windows.net)|20.60.132.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15065886 (14M) [application/octet-stream]
Saving to: ‘az-edge-site-scale’

az-edge-site-scale                                                           100%[=============================================================================================================================================================================================>]  14,37M  4,89MB/s    in 2,9s    

2024-05-22 11:41:29 (4,89 MB/s) - ‘az-edge-site-scale’ saved [15065886/15065886]

➜  edge-infrastructure-quickstart-template git:(main) ✗ chmod +x az-edge-module-export az-edge-site-scale 
➜  edge-infrastructure-quickstart-template git:(main) ✗ ./az-edge-module-export -v
zsh: exec format error: ./az-edge-module-export
➜  edge-infrastructure-quickstart-template git:(main) ✗ ./az-edge-site-scale -v   
zsh: exec format error: ./az-edge-site-scale
➜  edge-infrastructure-quickstart-template git:(main) ✗ uname -a
Darwin Mikkis-Laptop.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64
➜  edge-infrastructure-quickstart-template git:(main) ✗ uname -m
arm64
➜  edge-infrastructure-quickstart-template git:(main) ✗ file az-edge-module-export 
az-edge-module-export: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=E41yHcrq5ZC1CVgP_DU1/EKJPrw3JdmqRgCH_XvfG/S64iRYLAzzZDLe8JPyx3/Y0gDfmosns4qCpJHw-Wp, with debug_info, not stripped
➜  edge-infrastructure-quickstart-template git:(main) ✗ file az-edge-site-scale 
az-edge-site-scale: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=bKssstOaC5ZpYilXrGpM/28-9iGRiKgegXx78Ajcj/yF_NtVkwhq2PpLeNEuqn/k1ulbPeqzXDW7TRyecWh, with debug_info, not stripped

Which resource az-edge-module-export and az-edge-site-scale

Screenshots N/a; logging / terminal output provided above.

Additional context I changed the script's if-statement from if amd to if arm, this did get me binaries built for ARM architecture, however- my MacBook was unable to execute these scripts.

➜  edge-infrastructure-quickstart-template git:(main) ✗ ./az-edge-module-export -v
zsh: exec format error: ./az-edge-module-export
➜  edge-infrastructure-quickstart-template git:(main) ✗ ./az-edge-site-scale -v   
zsh: exec format error: ./az-edge-site-scale
➜  edge-infrastructure-quickstart-template git:(main) ✗ file az-edge-module-export 
az-edge-module-export: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=9OaO7A6hCA546D880Af5/RaQpr8LOJEmD2hyDuuf0/RbQNJqrkk_ngR8Aalctt/e-O2Fsma-TPcaT0Pvy2j, with debug_info, not stripped
➜  edge-infrastructure-quickstart-template git:(main) ✗ file az-edge-site-scale   
az-edge-site-scale: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=YiasoImolJVv6FtGGzAv/Fm824c6v46cBGOLFa3tY/b21LVDsr2ofiN_QCjhwM/W2D7g13lqQUjkZaHjFyt, with debug_info, not stripped
duzitong commented 2 months ago

Hi @mikkiweesenaar , I have created a new build for MacOS and fixed the downloading script in #75 . Could you please verify whether it's working on your Macbook?

mikkiweesenaar commented 2 months ago
➜  edge-infrastructure-quickstart-template git:(main) ✗ ./az-edge-module-export -v
2024/05/23 08:46:12 telemetry.go:110: InstallationId: 307a4cfe-988c-45fe-808e-a50bbc077753, SessionId: 8f9f8078-3593-46f3-9559-297da5d0ebc0
az-edge-module-export version main(20240523.1)
➜  edge-infrastructure-quickstart-template git:(main) ✗ ./az-edge-site-scale -v   
2024/05/23 08:46:18 telemetry.go:110: InstallationId: 307a4cfe-988c-45fe-808e-a50bbc077753, SessionId: 65849894-f635-418d-b47c-8052538b1a07
az-edge-site-scale version main(20240523.1)

Awesome, perfect! Thank you so much!