savi icon indicating copy to clipboard operation
savi copied to clipboard

Provide install instructions

Open mneumann opened this issue 3 years ago • 3 comments

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.

mneumann avatar May 16 '22 21:05 mneumann

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.

jemc avatar May 17 '22 04:05 jemc

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.

mneumann avatar May 17 '22 06:05 mneumann

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:

  • bin/savi (technically this can be named anything, as long as the relative path to the following two directories in this list is retained)
  • core (Savi source code for the core library, referenced during compilation)
  • lib/libsavi_runtime (built LLVM IR and debugging info for the runtime, referenced at the final stage of compilation)

jemc avatar May 19 '22 15:05 jemc