savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
156 stars 12 forks source link

Provide install instructions #328

Open mneumann opened 2 years ago

mneumann commented 2 years ago

What is the correct way of installing savi to a system location?

I copied build/savi-debug to /usr/local/bin/savi. When I run savi in a directory containing a manifest.savi, I get:

Savi compiler error occured with message "Error opening directory: '/usr/local/core/declarators/meta': No such file or directory". Consider submitting an issue ticket.

When I copy the core directory to /usr/local/core it works. I'd suggest to search for these files in /usr/local/lib/savi/core instead.

Also savi init exists silently, not generating any files and not printing any hints to run savi init bin.

jemc commented 2 years ago

Right now the only expected way to install is with asdf, or with the release tarballs that asdf uses (which get automatically built for each platform by CI - though as you know, FreeBSD CI isn't working yet).

In that case, the tarball can be extracted anywhere - you only need to keep the file structure intact.

asdf is a convenient way to install because it makes shims for easily selecting a specified version, and you don't need to manually manage the PATH to find the savi binary - once you've set up asdf once.

I'd suggest to search for these files in /usr/local/lib/savi/core instead.

I don't want Savi to be searching for its files at an absolute file path - I want it to stay relative to the savi binary so that you can put the files anywhere you choose. At this time, installing in a global directory like /usr/local/bin is not the expected use case.

However, if you want to rearrange the relative paths in the tarball a bit so that it's a bit more friendly for a global installation (while still staying friendly to the main "anywhere installation" use case.

mneumann commented 2 years ago

asdf doesn't seem to be easily available for FreeBSD :( There is only support for ASDF, Advanced Scientific Data Format :).

You probably have code in the Makefile to produce that tarball right? I can run that locally and unpack the tar in a system directory or into $HOME/.local etc.

If I know which directories are needed by savi, I can just cpdup them accordingly.

jemc commented 2 years ago

asdf doesn't seem to be easily available for FreeBSD :(

@mneumann - did you try using the Git method of installation for asdf? Nothing on that page explicitly says FreeBSD is supported, but I do see some PR activity in the asdf repo that mentions FreeBSD, implying that it works on that platform.

You probably have code in the Makefile to produce that tarball right? I can run that locally and unpack the tar in a system directory or into $HOME/.local etc.

Right now, it's only in CirrusCI steps but I could likely move those steps into a Makefile target, then invoke that target from CirrusCI.

If I know which directories are needed by savi, I can just cpdup them accordingly.

Basically, at the time of this writing (which may change in the future) what you need is: