mint-lang / mint

:leaves: A refreshing programming language for the front-end web

Home Page:https://mint-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mint crashes on start (aarch64)

MarcusE1W opened this issue · comments

Hi.

I have successfully build mint from source on my ARM Pinebook (aarch64) with Manjaro ARM (archlinux) using the suggested commands:

git clone https://github.com/mint-lang/mint.git
cd mint
shards install
shards build --progress --release --no-debug

If I then want to try it out with:

cd bin
./mint --help

I get this error message

Unhandled exception: BakedFileSystem empty: no files in /home/mmw/.local/mint/src/assets (Exception)
  from ./mint in '??'
  from ./mint in '??'
  from ./mint in '__crystal_main'
  from ./mint in 'main'
  from /usr/lib/libc.so.6 in '??'
  from /usr/lib/libc.so.6 in '__libc_start_main'
  from ./mint in '_start'
  from ???

The content of assets is this:

mmw@PBP  ~/.../src/assets   master  ls
css_properties  html_tags       mint-logo.svg  sw-utils.js
docs-viewer     live-reload.js  runtime.js

Any suggestions ?

We bake the needed assets into the binary here: https://github.com/mint-lang/mint/blob/master/src/assets.cr using https://github.com/schovi/baked_file_system

From the looks of it the baking fails or there is nothing at the given path (maybe it resolves differently on Manjaro?) you can try setting the absolute path instead of the relative one.

Thanks.
Manjaro is essentially Archlinux with a bit delay to ensure the new packages work. I am not aware of any differences to resolve the path differently.

Where would I set the absolute path?

Hmm, no success so far.

Here is what I did with a fresh install:

rm -rf mint
git clone https://github.com/mint-lang/mint.git
cd mint

edited assets.cd and replaced line 5 from

    bake_folder "./assets"

to

    bake_folder "/home/mmw/.local/mint/src/assets"
shards install
shards build --progress --release --no-debug

unfortunately the same error occurs:

 mmw@PBP  ~/.local/mint   master ●  ./bin/mint --help
Unhandled exception: BakedFileSystem empty: no files in /home/mmw/.local/mint/src/assets (Exception)
  from ./bin/mint in '??'
  from ./bin/mint in '??'
  from ./bin/mint in '__crystal_main'
  from ./bin/mint in 'main'
  from /usr/lib/libc.so.6 in '??'
  from /usr/lib/libc.so.6 in '__libc_start_main'
  from ./bin/mint in '_start'
  from ???

The folder mentioned in the first line of the exception is the correct folder path.

There are no baked files, but I don't know why.

The error comes from here: https://github.com/schovi/baked_file_system/blob/master/src/baked_file_system.cr#L186
Here is the code that does the actual baking: https://github.com/schovi/baked_file_system/blob/master/src/loader/loader.cr#L10

So If you are so inclined, you can debug it locally, the shards are installed in the lib directory in the project.

Currently I know nothing about crystal. I just thought I give mint a try.
So I might not be able to do it, but I will try.

I think I found the issue: https://github.com/schovi/baked_file_system/blob/master/src/loader/loader.cr#L25 paths are rejected that have a dot in them . ¯_(ツ)_/¯ try to move the repo outside the .local directory.

Perfect, that works :-)

This could be the related issue:
schovi/baked_file_system#34