guild icon
Toit
#toit build fails on ARM64
Thread channel in help
meercat
meercat 04/24/2023 03:29 AM
I'm building Jaguar on ARM64, and my toit build fails. generating sdk/bin/toit.lsp fails, saying undefined: atomic.Bool (with note: module requires Go 1.19
bitphlipphar
bitphlipphar 04/24/2023 03:32 AM
Which version of Go are you using?
bitphlippharbitphlipphar
Which version of Go are you using?
meercat
meercat 04/24/2023 03:33 AM
1.18.1 linux/arm64
meercat
meercat 04/24/2023 03:44 AM
now getting no rule to make target '.../toit.pkg', needed by 'install-dependencies'. Stop.
meercat
meercat 04/24/2023 03:56 AM
okay, updated to 1.20.3
bitphlipphar
bitphlipphar 04/24/2023 03:56 AM
I am in front of my computer now, so maybe I can help from here.
bitphlipphar
bitphlipphar 04/24/2023 03:57 AM
Maybe it's worth deleting the toit/build and jaguar/build directories.
bitphlipphar
bitphlipphar 04/24/2023 03:58 AM
Then if the submodules are correctly initialized start by building from toit.
bitphlipphar
bitphlipphar 04/24/2023 03:58 AM
Can you verify that toit/third_party/esp-idf isn't empty?
meercat
meercat 04/24/2023 04:03 AM
seems to be working now? I just did make all in my clone of Jaguar
bitphlipphar
bitphlipphar 04/24/2023 04:03 AM
That is good news!
bitphlipphar
bitphlipphar 04/24/2023 04:04 AM
You should have build/jag in your jaguar directory -- and toit/build/esp32/firmware.envelope should have the ESP32 bits.
bitphlippharbitphlipphar
That is good news!
meercat
meercat 04/24/2023 04:27 AM
hmm now it's File not found: '.../toit/tools/toit.run.toit'
bitphlipphar
bitphlipphar 04/24/2023 04:29 AM
Does it start with .../toit? (three dots)
bitphlipphar
bitphlipphar 04/24/2023 04:29 AM
What is your JAG_TOIT_REPO_PATH?
meercat
meercat 04/24/2023 04:29 AM
no sorry, I mean it has a directory -- /home/hydrologic/JagToit/toit/build/toit.run.toit
bitphlipphar
bitphlipphar 04/24/2023 04:30 AM
Ah, good :😉:
meercat
meercat 04/24/2023 04:30 AM
toit being the folder at which the clone is located(edited)
bitphlippharbitphlipphar
What is your JAG_TOIT_REPO_PATH?
meercat
meercat 04/24/2023 04:30 AM
//home/hydrologic/JagToit/toit
bitphlipphar
bitphlipphar 04/24/2023 04:30 AM
Can you build from toit/? Try something like make sdk.
meercat
meercat 04/24/2023 04:31 AM
tells me the same thing, can't find that file
meercatOPmeercat
no sorry, I mean it has a directory -- /home/hydrologic/JagToit/toit/build/toit.run.toit
meercat
meercat 04/24/2023 04:31 AM
this one
bitphlipphar
bitphlipphar 04/24/2023 04:31 AM
kasper@mole toit % build/host/sdk/bin/toit.run examples/hello.toit Hello, World!
bitphlipphar
bitphlipphar 04/24/2023 04:32 AM
Do you have the file toit/tools/toit.run.toit?
meercat
meercat 04/24/2023 04:32 AM
no, I don't
meercatOPmeercat
//home/hydrologic/JagToit/toit
bitphlipphar
bitphlipphar 04/24/2023 04:32 AM
Does it start with //?
bitphlippharbitphlipphar
Does it start with //?
meercat
meercat 04/24/2023 04:32 AM
it does
meercat
meercat 04/24/2023 04:33 AM
wait, I do have the file
meercat
meercat 04/24/2023 04:33 AM
toit.run.toit
meercat
meercat 04/24/2023 04:33 AM
and it is in that directory
bitphlipphar
bitphlipphar 04/24/2023 04:33 AM
Hmm.
bitphlippharbitphlipphar
Does it start with //?
meercat
meercat 04/24/2023 04:36 AM
same error after changing this to one /
meercat
meercat 04/24/2023 04:37 AM
bmentink
bmentink 04/24/2023 07:25 AM
@bitphlipphar Hi, I tried this as well. A make all seems to have built build/jag but I do not have a toit directory in my jaguar top level. Also, I got this error on the compile:
bmentink
bmentink 04/24/2023 07:25 AM
make: *** No rule to make target '/home/bmentink/src/jaguar/build/sdk/bin/toit.pkg', needed by 'install-dependencies'. Stop.
meercat
meercat 04/24/2023 07:27 AM
yup I got that too
bitphlipphar
bitphlipphar 04/24/2023 07:32 AM
Looks like JAG_TOIT_REPO_PATH isn't set correctly or isn't handled correctly by the Makefile.
bitphlipphar
bitphlipphar 04/24/2023 07:33 AM
It should look for $(JAG_TOIT_REPO_PATH)/build/host/sdk and find toit.pkg in there, not in jaguar/build.
bmentink
bmentink 04/24/2023 07:34 AM
ok, how do I fix?
bitphlipphar
bitphlipphar 04/24/2023 07:34 AM
Maybe the way make starts a new shell is messing with us here.
bmentink
bmentink 04/24/2023 07:35 AM
There is also another bug:
bmentink
bmentink 04/24/2023 07:35 AM
./build/jag version panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xa2d3fc] goroutine 1 [running]: github.com/toitlang/jaguar/cmd/jag/commands.VersionCmd.func1(0x4000226000?, {0x12299e0?, 0x0?, 0x0?}) /home/bmentink/src/jaguar/cmd/jag/commands/version.go:30 +0x5c github.com/spf13/cobra.(*Command).execute(0x4000226000, {0x12299e0, 0x0, 0x0}) /home/bmentink/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x5ac github.com/spf13/cobra.(*Command).ExecuteC(0x4000212300) /home/bmentink/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x340 github.com/spf13/cobra.(*Command).Execute(...) /home/bmentink/go/pkg/mod/github.com/spf13/[email protected]/command.go:968 github.com/spf13/cobra.(*Command).ExecuteContext(0xba4929?, {0xcc6530?, 0x40001b1b30?}) /home/bmentink/go/pkg/mod/github.com/spf13/[email protected]/command.go:961 +0x4c main.main() /home/bmentink/src/jaguar/cmd/jag/main.go:34 +0x17c
bmentink
bmentink 04/24/2023 07:37 AM
Also, when I did git submodule update --init --recursive nothing happened ..
floitsch
floitsch 04/24/2023 08:34 AM
Let's take a step back.
Here are some instructions that should work. Let me know at which point things go bad.
export TOIT_PATH=YOUR_ABSOLUTE_PATH_TO_THE_TOIT_CLONE export JAG_PATH=YOUR_ABSOLUTE_PATH_TO_THE_JAGUAR_CLONE export JAG_TOIT_REPO_PATH=$TOIT_PATH # Check that the paths are set up correctly: ls $TOIT_PATH ls $JAG_PATH # Let's do some cleanups. They shouldn't be necessary, but can't hurt. cd $TOIT_PATH make clean cd $JAG_PATH rm -rf build # recursively init the submodules of Toit cd $TOIT_PATH git submodule update --init --recursive . # While we are here, make sure we have the esp-idf requirements installed. third_party/esp-idf/install.sh # Let's build Toit here. make # This should take some time and compile quite a few things. # If you get a build-error, it's likely the mbedtls issue I mentioned. # Instructions for that one are below. # You should end up with files in: ls build/host/sdk/bin # If the build completed succesfully, let's build Jaguar now. cd $JAG_PATH make # This will do another build in Toit (this time the ESP32 firmware), and then # finish by building 'build/jag'. build/jag version # At this point you should be able to use the 'build/jag' executable as if it was # a downloaded Jaguar binary.
floitsch
floitsch 04/24/2023 08:36 AM
Now if there was a compilation error because of mbedtls:
cd $TOIT_PATH/third_part/esp-idf/components/mbedtls/mbedtls wget https://raw.githubusercontent.com/toitlang/toit/438ab4e65213816f9ed60a72cde0cc89e374d6d7/aarch64.diff patch -p1 < aarch64.diff # And now try to build Toit again: cd $TOIT_PATH make
(edited)
floitschfloitsch
Now if there was a compilation error because of mbedtls: ``` cd $TOIT_PATH/third_part/esp-idf/components/mbedtls/mbedtls wget https://raw.githubusercontent.com/toitlang/toit/438ab4...(edited)
meercat
meercat 04/24/2023 09:56 AM
error relating to toit.run.toit, I think 404 when I run this wget command
meercat
meercat 04/24/2023 10:01 AM
nvm didn't have my glasses on LOL
floitschfloitsch
Now if there was a compilation error because of mbedtls: ``` cd $TOIT_PATH/third_part/esp-idf/components/mbedtls/mbedtls wget https://raw.githubusercontent.com/toitlang/toit/438ab4...(edited)
meercat
meercat 04/24/2023 10:06 AM
same error about toit.run.toit(edited)
meercat
meercat 04/24/2023 10:07 AM
also make clean returns rm: missing operand
meercat
meercat 04/24/2023 10:08 AM
and the submodule command doesn't return anything
meercatOPmeercat
same error about toit.run.toit(edited)
meercat
meercat 04/24/2023 10:11 AM
despite the fact that the file does exist there and has information according to nano
floitsch
floitsch 04/24/2023 10:48 AM
weird.
floitsch
floitsch 04/24/2023 10:49 AM
Could you try to run the command by hand?
floitsch
floitsch 04/24/2023 10:49 AM
On my machine it looks like the following:
/usr/bin/cmake -E env ASAN_OPTIONS=detect_leaks=false /home/flo/code/opentoit/build/host/sdk/bin/toit.compile --dependency-file /home/flo/code/opentoit/build/host/src/boot.dep --dependency-format ninja -w /home/flo/code/opentoit/build/host/generated/toit.run.snapshot /home/flo/code/opentoit/tools/toit.run.toit
(edited)
floitsch
floitsch 04/24/2023 10:51 AM
But really, the command is:
/home/flo/code/opentoit/build/host/sdk/bin/toit.compile -w /home/flo/code/opentoit/build/host/generated/toit.run.snapshot /home/flo/code/opentoit/tools/toit.run.toit
The rest is just build-stuff.
meercatOPmeercat
and the submodule command doesn't return anything
floitsch
floitsch 04/24/2023 10:52 AM
That's ok. Once the submodules have been initialized 'git' doesn't print anything anymore.
meercatOPmeercat
also make clean returns rm: missing operand
erikcorry_arbat
erikcorry_arbat 04/24/2023 11:41 AM
floitschfloitsch
But really, the command is: ``` /home/flo/code/opentoit/build/host/sdk/bin/toit.compile -w /home/flo/code/opentoit/build/host/generated/toit.run.snapshot /home/flo/code/opentoit/to...
meercat
meercat 04/24/2023 03:28 PM
what's the prefix here?
meercat
meercat 04/24/2023 03:29 PM
as in what command*
floitsch
floitsch 04/24/2023 03:29 PM
In this case /home/flo/code/opentoit would be TOIT_PATH.
meercat
meercat 04/24/2023 03:29 PM
I can't run the toit command
floitsch
floitsch 04/24/2023 03:29 PM
do you have the file $TOIT_PATH/build/host/sdk/bin/toit.compile ?
meercat
meercat 04/24/2023 03:30 PM
yup
floitsch
floitsch 04/24/2023 03:30 PM
ok. What does $TOIT_PATH/build/host/sdk/bin/toit.compile --version say?
meercat
meercat 04/24/2023 03:32 PM
v2.0.0-alpha.79.2+a4d6336e
floitsch
floitsch 04/24/2023 03:32 PM
ok. So the compiler is compiled and seems to work.
floitsch
floitsch 04/24/2023 03:33 PM
Does this work?
$TOIT_PATH/build/host/sdk/bin/toit.compile -w $TOIT_PATH/build/host/generated/toit.run.snapshot $TOIT_PATH/tools/toit.run.toit
meercat
meercat 04/24/2023 03:33 PM
brings up the toit usage
floitsch
floitsch 04/24/2023 03:33 PM
can you show me?
meercat
meercat 04/24/2023 03:34 PM