-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GNU/Linux local install instructions #79
Comments
This would be the instructions on https://janet-lang.org/docs/index.html under "Compiling and running from source" --> "macOS and Unix-like". |
Here's my attempt at touching on some of the details. If I get things wrong, I hope others will point out and amend :) Regarding
So my reading is that Regarding where janet itself is installed, IIUC, one can decide that via specifying an appropriate value for For your situiation, my guess is that you might do something like this:
That's pretty close to what I do typically (though I also happen to have my jpm-related bits live nearby). FWIW,
I mention this part to give you some idea of what a system that seems to be running ok might be like -- I think I've seen other people do something similar. As to what the |
Quick description of the various paths:
Besides syspath and modpath, the other path defaults are hardcoded into the jpm script itself. They can be overriden with both command line flags or environment variables, but during a system install it's best to just patch the script so that you need to set environment variables to get things working. There is a tool to do this that is called by |
Thank you for the help. Sorry to take so long to get back to this issue, but I'm excited to sort this out. So, I see three separate times to consider:
It sounds like JANET_PATH is used for the latter two times. As for terminology, my understanding is that:
Are those correct? I'm somewhat confused by the jpm man page where, as sogaiu pastes:
and @bakpakin 's comment above:
What precisely is a janet "library"? (Or, how is a janet module different from a janet library?) So, I didn't understand that when jpm installs things, it likes to have a similar selection of directories like what's found under /usr/local (it wants lib, bin, and include directories, for example). Why is a tree like that necessary? Does Thanks so much for helping me understand this! :) |
Regarding terminology, looking at https://github.com/janet-lang/pkgs, I see that it uses "package" to mean the thing you install using jpm. Any clarity here would be appreciated. My best guess so far is that the terms are:
And "project" is just a more generic term. |
Below is one take (corrections welcome :) ). Looking at the "Glossary" section of: https://janet-lang.org/docs/jpm.html I see:
So your "git repo" idea seems consistent with this. (As a side note, I think it's possible for one to specify local directories as dependencies (IIRC, one writes a Note that in the section titled "Declaring a project" there is mention of The text continues:
So according to this it is possible for there to be only one library (module?) in a project. This might partly explain why one might hear statements that seem to conflate the two terms ("project" and "library") or use them interchanegeably in conversation. Further bits of the text say:
Looking at the "Creating a module", "Creating a native module", and "Creating an executable" at: https://janet-lang.org/docs/jpm.html you'll likely come across:
So I think these correspond to the terms Regarding "package", the "Installing a module" section of: https://janet-lang.org/docs/modules.html says:
So going by this, I think package == project is a fair interpretation. Regarding "module", https://janet-lang.org/docs/modules.html has the text:
So it's a notion that has a default but it can be something else. The "Importing a Module" section says:
So this is consistent with an edited version of your statement "you import a module". To summarize a bit, if you focus on these constructs:
that might help to reduce confusion. FWIW, I found examining (by installation and creating) specific projects helped me in developing my current mental model. For reference, below are examples where one or more of Only one:
More than one:
|
Thank you. I think I'm gathering some more undertanding of this here. To start with the very basics, I see that, for Janet projects, you It seems like I see and hear the term "library" when talking about native libraries, and "module" when talking about importable Janet source code modules. (Note: the wording in the So, regarding a project's project.janet file, do I have the following correct? :
Please let me know if I have that correct. And if it is, if you think the docs could use a going-through to make sure the terms "library" (native extension) vs "module" (Janet source code module) are used consistently throughout. |
This is incorrect iirc. libpath is where libjanet.a is located, libjanet.a/.so contains all the functions that comprise the janet interpreter. jpm needs to know where this is so it can link against it. Everything else is more or less correct. I think module/library are used fairly interchangeably. |
For:
I am trying to think of a case where it is possible to not have Regarding the In discussions where it seems unclear I would suggest asking for clarification. I would be happier with more consistent usage of terms in the official docs and would be happy to review things (or suggest changes, make PRs, etc.). Pretty much avoiding |
Ok, will experiment more! Thank you. I realized one major point of confusion though! Oy! I had gotten used to installing a language that lived in its own directory. That is, for example, when you install In addition to and aside from that, I was also conflating the "Janet install tree" with the jpm "module install tree", which (I think) is usually all the same tree: /usr/local ! But which can also be separate (I can install Janet locally into its own ~/opt/janet (where it then creates all its necessary bin, lib, include, share dirs)). Again, I'll experiment more with setting JANET_PATH (and JANET_MODPATH) and trying to use Thanks, Andrew. I was at first confused about what you wrote about where libjanet.a/so is installed, but I think now I see that you were talking about the case where Janet itself and the jpm-installed libraries are all installed in the same tree (typically /usr/local). |
Have not forgotten about this... Sorry for letting this wait so long. |
For reference, there are some instructions here that might be relevant. |
Thanks, @sogaiu . I plan to put some time in on this late next week. |
On GNU/Linux, the installation of Janet goes very smoothly when installing into /usr/local.
My understanding is that I should alternatively be able to install Janet locally (into, say, ~/opt), where root access would not be required.
I'd like to install Janet into ~/opt, but have
jpm
maintain its installation of libraries under, say, ~/janet (not sure what's commonly used here). Does that sound like somewhat typical usage for Janet?I asked about this on gitter, and @sogaiu (and also Calvin) lent a hand, but I'm still confused specifically about whether the JANET_PATH env var is used to specify where
jpm
installs libraries vs having something to do with where thejanet
itself is installed (~/opt/janet-1.11.3 ?) ( --- or both??).Perhaps if it can be explained here, I can compose a PR to enhance the GNU/Linux installation instructions adding a local install option.
Thanks!
The text was updated successfully, but these errors were encountered: