[Pharo9.0] Cmake: invalid VM_URL_HASH for Linux AARCH64 in cmake/vmmaker.cmake
Branch: Pharo9.0
I'm trying to cross-compile the VM in Yocto for an aarch64 embedded system, i have an error in CMAKE stated that the VM_URL_HASH is invalid. It works when i apply the following patch:
message("Defining Linux AARCH64 VM to download for code generation")
set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
set(VM_URL https://files.pharo.org/vm/pharo-spur64/Linux-aarch64/stable.zip)
- set(VM_URL_HASH SHA256=924e5a25f8e2d51773e8571ebefa2404da9561418af2b54af1330357b75ae865)
+ set(VM_URL_HASH SHA256=bbbc4f481fa49bf26b98eb686778ef5995680837c4d60c1b91a5b956b73b828b)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l"))
message("Defining Linux ARM 32 VM to download for code generation")
set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
It is either the file is bad of the hash is not correctly updated
Yes, we should not use https://files.pharo.org/vm/pharo-spur64/Linux-aarch64/stable.zip but a fixed VM version.
Maybe we should use `https://files.pharo.org/vm/pharo-spur64-headless/Linux-x86_64/PharoVM-9.0.10-6e541fb-Linux-x86_64-bin.zip'.
Could you try if that version works for you? Haing a cross-compilation for Yocto would be super nice :)
I was not very clear when i said it worked with the previous patch. I meant that the patch allowed to bypass the sha256sum check but i got a compilation error after with vmmaker. The .cmake file is designed to work on the case where the build system and the target system are the same (e.g. aarch64). In cross compile, it wont work since the script downloads the VM for the target system (aarch64) but then uses this VM on the build system (x86_64) to generate VM code.
In my Yocto recipe, to make the cross-build work, i finally used the following patch:
--- a/cmake/vmmaker.cmake
+++ b/cmake/vmmaker.cmake
@@ -62,16 +62,6 @@ if(GENERATE_SOURCES)
set(VMMAKER_VM ${VMMAKER_DIR}/vm/PharoConsole.exe)
set(VM_URL https://files.pharo.org/vm/pharo-spur64/win/PharoVM-8.6.1-e829a1da-StockReplacement-win64-bin_signed.zip)
set(VM_URL_HASH SHA256=d24a2fb5d8d744a4c8ce0bc332051960d6f5d8db9f75754317b5aee8eafb7cb1)
- elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"))
- message("Defining Linux AARCH64 VM to download for code generation")
- set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
- set(VM_URL https://files.pharo.org/vm/pharo-spur64/Linux-aarch64/stable.zip)
- set(VM_URL_HASH SHA256=924e5a25f8e2d51773e8571ebefa2404da9561418af2b54af1330357b75ae865)
- elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l"))
- message("Defining Linux ARM 32 VM to download for code generation")
- set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
- set(VM_URL https://files.pharo.org/vm/pharo-spur32/Linux-armv7l/stable.zip)
- set(VM_URL_HASH SHA256=1816e44523e08e7effe3226a3cabc4ea701fb9582c00456ab90936efb5c645c4)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message("Defining Linux VM x86_64 to download for code generation")
set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
The patch allows to download the correct VM for the build system (x86_64) and not the target system (aarch64). It is normal in Yocto to have patches like this.
However, if someone tries to build the VM directly in the aarch64 system, they will have the problem of checksum invalid. So i think the checksum should be updated