Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Build fail #21

Open
DoctorRyner opened this issue Jan 17, 2020 · 4 comments
Open

Build fail #21

DoctorRyner opened this issue Jan 17, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@DoctorRyner
Copy link

build.zip

Hi. When I put this to src and rename Main.lua to main.lua I get:

=> main λ (~/tmp/purescript/ps-to-lua-test/ceres) = ceres build -- --map WorldEditTestMap.w3x
> Received build command
>     Input: WorldEditTestMap.w3x
>     Retain map script: true
>     Output type: mpq
> Loaded map WorldEditTestMap.w3x
> WARN: Could not extract script from map WorldEditTestMap.w3x: File not found
> WARN: Map script won't be included in the final artifact
> Building without including original map script
> ERR: Map build failed:
> Could not compile module [castl.constructor.error.error] ("src/castl/constructor/error/error.lua"):
Cyclical dependency found involving module castl.internal

But when I use original Lua interpreter, it works fine

=> main λ (~/tmp/purescript/ps-to-lua-test/ceres/src) = lua main.lua
Power of PureScript!

Is it possible to make it work?

I use http://www.purescript.org as a scripting language

It compiles to JavaScript and then I use https://github.com/PaulBernier/castl to compile it from JavaScript to Lua. castl/ directory comes from lua/castl in the previously mentioned repository and it contains runtime for JavaScript

@DoctorRyner
Copy link
Author

Also when I used http://siffiejoe.github.io/lua-amalg/ to bundle it in a single file it throws this error:

main.lua.zip

=> main λ (~/tmp/purescript/ps-to-lua-test/ceres) = ceres build -- --map WorldEditTestMap.w3x
> Received build command
>     Input: WorldEditTestMap.w3x
>     Retain map script: true
>     Output type: mpq
> Loaded map WorldEditTestMap.w3x
> WARN: Could not extract script from map WorldEditTestMap.w3x: File not found
> WARN: Map script won't be included in the final artifact
> Building without including original map script
> ERR: Map build failed:
> Could not compile module [main] ("src/main.lua"):
Could not parse file:
    --> 3366:11
     |
3366 |     local local_UTC_offset_sec = difftime(time(date("!*t", now)), time(date("*t", now)))␊
     |           ^---
     |
     = expected Ident

@ElusiveMori
Copy link
Collaborator

I'm not really sure whether pure Lua even supports cyclic dependencies (maybe when the module doesn't return any result it is ok?), but in general there is no nice way of solving circular dependencies in a language like Lua.

The second issue seems to be down to a parser error. I'll look into fixing it.

@ElusiveMori ElusiveMori added the bug Something isn't working label Feb 20, 2020
@DoctorRyner
Copy link
Author

Well, Lua's interpreter is able to run my code from CLI

@ElusiveMori
Copy link
Collaborator

If that's the case, then I might lift the restriction on cyclic dependencies. I'll look into it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants