Closed hanssv closed 1 year ago
thanks for creating the issue! 👍
maybe it would be good if the include path doesn't have to be referenced at all if every path is relative? 🤔
Definitely - this contract should compile with aesophia_cli /tmp/foo.aes
and nothing more.
Module system in Sophia is inherently broken and we plan to fix it in the rewritten version. I am giving it low priority because
Straighforward to fix for now 😅
Not sure if it is a minimal reproducing example, but it should be small enough. Three files, in three different directories:
/tmp/foo.aes
:/tmp/dir1/bar.aes
:/tmp/dir2/baz.aes
:Straight up compiling
foo.aes
fails:The problem is that while resolving the includes in
bar.aes
(which is indir1
) we still do this relative to the root source file (i.e. in/tmp
) this means we won't find../dir2
.A workaround is to pass both the top level and the subdirectory as include paths: