Hi Suhail,

Sorry if some of my instructions were not clear before. I'll try to explain in more detail.

On Wed, 2 Oct 2024 at 21:21, Suhail Singh <suhailsingh247@gmail.com> wrote:
Omar Bassam <omar.bassam88@gmail.com> writes:

> This is expected as the jpm install command is meant to install janet
> packages globally which would be impure.

It would help for this to be noted in some manner.  Be it in the
description or as comments in the package description.
 
I don't think this needs to be said because all package managers installed via guix have this issue.
This is a common Nix/Guix issue that I struggled a lot to understand at the beginning.
Also, there is no one way to solve this because jpm gives you the freedom to install packages on a user level
or on a project only level.
 
> To install janet packages to your local project directory, you need to add
> the "-l" flag as follows:
> jpm install -l sh

Does this work for you (for jpm installed via guix)?  If so, could you
please confirm the set of dependencies you have installed in the guix
profile for the above to work?  If not, could you provide an example
invocation that I could test out which would allow me to install a janet
dependency in a local directory?

Do you still get the same error?
Yes, this does work for me without any other dependencies. I am using guix on ubuntu with guix shell. 
It should create a "jpm_tree" folder in the directory where you invoked the command from.
Alternatively you can set the "JANET_TREE" environment variable before invoking the command. For example:
JANET_TREE=~/.jpm jpm install sh

Also, note that janet is a lisp that compiles to C. So, if the library you are trying to install has other dependencies, 
you'll need to have those available in your profile/shell.

 
> Maybe in the future we can add a "janet-build-system" that will allow us to
> add janet packages to the guix repository.

That would be helpful.
Yes, indeed. I don't have much experience about that yet. But I plan to do so in the future.
--
Suhail