Akuli / jou

Yet another programming language
MIT License
12 stars 4 forks source link

Logs about working on the self-compiler #292

Closed littlewhitecloud closed 1 year ago

littlewhitecloud commented 1 year ago

Taking logs

littlewhitecloud commented 1 year ago

Well maybe it can't find the stdlib in the install path now. image

Akuli commented 1 year ago

Looking at the screenshot, the two Jou compilers find stdlib from different places: jou.exe finds it from C:\Program Files and the self-hosted compiler finds it from Downloads. The self-hosted compiler is correct here: because you develop Jou in the downloads folder, it should use the stdlib from the downloads folder as well.

I just merged #293. If you compile Jou with the new instructions in CONTRIBUTING.md, do you still get the same result?

Akuli commented 1 year ago

Also, sorry about the experiences where you get a weird error every time you try to do something! And thanks for working on Jou anyway.

littlewhitecloud commented 1 year ago

It can't compile now...? image

Akuli commented 1 year ago

Any update on this? As I mentioned in #305, it now works on Windows for me.

littlewhitecloud commented 1 year ago

image

$ mingw32-make
echo -IC:/Users/Administrator/Downloads/jou-main (1)/jou-main > compile_flags.txt
/usr/bin/sh: -c: line 1: syntax error near unexpected token `('
/usr/bin/sh: -c: line 1: `echo -IC:/Users/Administrator/Downloads/jou-main (1)/jou-main > compile_flags.txt'
mingw32-make: *** [Makefile.windows:20: compile_flags.txt] Error 2
(jou dev)

Can't compile

Akuli commented 1 year ago

I just pushed a commit to try to fix this. Run git pull and try again.

Akuli commented 1 year ago

Ah, you have downloaded it from github instead of git clone... I would recommend git clone, as in the instructions, so that you don't need to redownload the whole thing when something changes.

littlewhitecloud commented 1 year ago

image ...?

Akuli commented 1 year ago

You need to run windows_setup.sh again. You can copy the mingw64 folder from a previous copy, if you don't want to wait for it to download again.

littlewhitecloud commented 1 year ago

I am working on the self-hosted compiler and run the compare_compilers.sh, but it failed: image

+./compare_compilers.sh: line 92: ./self_hosted_compiler: cannot execute binary file: Exec format error

What happened?

Akuli commented 1 year ago

What files exist in the folder? Run ls and copy the output here.

littlewhitecloud commented 1 year ago

image

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2023/3/17     18:11                .github
d-----         2023/3/17     18:11                doc
d-----         2023/3/17     18:11                examples
d-----         2023/3/17     21:04                libs
d-----         2023/3/17     19:54                llvm
d-----         2023/3/17     19:54                llvm-c
d-----         2023/3/17     21:01                mingw64
d-----         2023/3/18      6:21                obj
d-----         2023/3/18     21:26                self_hosted
d-----         2023/3/18      6:19                src
d-----         2023/3/18     17:55                stdlib
d-----         2023/3/17     18:11                tests
d-----         2023/3/18     21:26                tmp
-a----         2023/3/17     18:11             89 .gitattributes
-a----         2023/3/17     18:11            297 .gitignore
-a----         2023/3/17     18:11            263 activate
-a----         2023/3/18     21:32           4177 compare_compilers.sh
-a----         2023/3/17     21:05             75 compile_flags.txt
-a----         2023/3/18      6:45             80 config.jou
-a----         2023/3/17     18:11           7652 CONTRIBUTING.md
-a----         2023/3/18     21:26         511592 jou.exe
-a----         2023/3/17     18:11           1067 LICENSE
-a----         2023/3/17     18:11        4897114 llvm_headers.zip
-a----         2023/3/17     18:11            351 Makefile
-a----         2023/3/17     18:11           1288 Makefile.posix
-a----         2023/3/17     20:58           1199 Makefile.windows
-a----         2023/3/17     19:50       64640812 mingw64-small.zip
-a----         2023/3/17     18:11           5977 README.md
-a----         2023/3/17     18:11           6281 runtests.sh
-a----         2023/3/18     21:26         249593 self_hosted_compiler.exe
-a----         2023/3/17     18:11           2110 update.ps1
-a----         2023/3/17     18:11            825 valgrind-suppressions.sup
-a----         2023/3/17     18:11           3863 windows_setup.sh
Akuli commented 1 year ago

What should be happening is that ./self_hosted_compiler finds self_hosted_compiler.exe and runs that. The error message basically means that the exe is broken.

Let's try to delete everything we have compiled and recompile everything:

source activate
mingw32-make clean
./compare_compilers.sh