attila-lendvai / maru

Maru - a tiny self-hosting lisp dialect
http://piumarta.com/software/maru/
Other
189 stars 10 forks source link

test compiler LLVM #4

Closed TheFausap closed 3 years ago

TheFausap commented 3 years ago

I found a little typo in the Makefile preventing to run the tests for the compiler. $(EVAL0_DIR)/$(EVAL0) is an invalid filename because, $(EVAL0) contains already the full path of the executable. However, once I fixed the typo, I got this error:

fausap@maru:~/maru.attila$ make test-compiler-llvm
time --format='\nuser time: %U\n' /home/fausap/maru.attila/build/eval0/eval0-llvm  -O -v --define *host-directory*      "/home/fausap/maru.attila/build/eval0" --define *slave-directory*       "/home/fausap/maru.attila" --define *compiler-backend*  llvm --define target/cpu                x86_64 --define target/vendor  linux --define target/os                 gnu source/bootstrapping/prepare.l boot.l /home/fausap/maru.attila/source/bootstrapping/host-ready.l source/bootstrapping/early.l --define feature/profiler             0 boot.l source/bootstrapping/late.l tests/compiler-tests.l source/emit-finish.l >build/llvm-libc/64bit-le/compiler-test.ll || { touch -t 200012312359 build/llvm-libc/64bit-le/compiler-test.ll; exit 42; }
loading file: source/bootstrapping/prepare.l    (as a CLA)
changing working directory to: /home/fausap/maru.attila/build/eval0
loading file: boot.l    (as a CLA)
loading file: source/list-min.l
loading file: source/control-structures.l
loading file: source/list-basic.l
loading file: source/destructuring.l
loading file: source/iteration-min.l
loading file: source/sequences-basic.l
loading file: source/types.l
loading file: source/selector.l
loading file: source/printing.l
loading file: source/generic.l
loading file: /home/fausap/maru.attila/source/bootstrapping/host-ready.l       (as a CLA)
changing working directory to: /home/fausap/maru.attila
loading file: source/bootstrapping/early.l      (as a CLA)
loading file: boot.l    (as a CLA)
boot.l speaking with *verbosity* 1; we're bootstrapping
loading file: source/list-min.l
loading file: source/control-structures.l
loading file: source/list-basic.l
loading file: source/destructuring.l
loading file: source/iteration-min.l
loading file: source/sequences-basic.l
loading file: source/types.l
loading file: source/selector.l
loading file: source/printing.l
loading file: source/generic.l
loading file: source/bootstrapping/late.l       (as a CLA)
loading file: tests/compiler-tests.l    (as a CLA)
loading file: source/platforms/libc/libc.l
loading file: source/platforms/platform-c-based.l
loading file: source/platforms/platform-common.l

ERROR:
encode/symbol: failed for define-C-variable, *globals* Env<maru-user Lv0,Off272,#272,parent: Env<maru Lv0,Off105,#105>>, env Env< Lv1,Off0,#0,parent: Env<maru-user Lv0,Off272,#272,parent: Env<maru Lv0,Off105,#105>>>
ABORTED
  0: load.0+19
        callee: Expr<load (path.2+0)>
        arg 0:  source/platforms/libc/libc.l
  1: apply
        callee: Expr<load (path.2+0)>
        arg 0:  source/platforms/libc/libc.l
  2: primitive/load.0+18
        callee: .load
        arg 0:  source/platforms/libc/libc.l
  3: apply
        callee: .load
        arg 0:  source/platforms/libc/libc.l
  4: encode
        expr: (define-C-variable libc/stdin stdin (* %m_libc-FILE))
        env: Env< Lv1,Off0,#0,parent: Env<maru-user Lv0,Off272,#272,parent: Env<maru Lv0,Off105,#105>>>
  5: encode
        expr: define-C-variable
        env: Env< Lv1,Off0,#0,parent: Env<maru-user Lv0,Off272,#272,parent: Env<maru Lv0,Off105,#105>>>
Command exited with non-zero status 255

user time: 0.05

Makefile:501: recipe for target 'build/llvm-libc/64bit-le/compiler-test.ll' failed
make: *** [build/llvm-libc/64bit-le/compiler-test.ll] Error 42

Is it expected?

regards Fausto

TheFausap commented 3 years ago

I found a possible typo in the Makefile, the missing emit-llvm.l inclusion in the command line. In the previous branches, there's at least the inclusion of emit-llvm.l or (in maru.8 and before) the Makefile variable EMIT_FILES_llvm or EMIT_FILES_x86 (depending on the target). I, also, noticed in maru.9 emit-llvm, calls emit-early and emit-late, and define-C-variable is defined in emit-late.l

Really I cannot understand which kind of error is it.

attila-lendvai commented 3 years ago

thanks for the report!

that compiler test stuff is very kludgey. it originates from a time before platforms were introduced, and it was not really updated... i have pushed a fix into the maru.10 branch with some comments.

closing it, but feel free to reopen if it still fails for you.