Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

sogaiu
Copy link
Contributor

@sogaiu sogaiu commented Sep 11, 2025

This PR is an attempt to improve some of the Windows-related documentation as well as comments in some related files.

The main user-visible bit is a suggestion to change the man page which currently mentions:

-m syspath
       Set the dynamic binding :syspath to the string syspath  so  that
       Janet  will  load system modules from a directory different than
       the default. The default is set when Janet  is  built,  and
       defaults to /usr/local/lib/janet on Linux/Posix, and
       C:/Janet/Library on Windows. This option supersedes JANET_PATH.

AFAIU, unlike for non-Windows [1], on Windows, there is no default value baked in to janet.exe[2].

The proposed new text is:

-m syspath
       Set the dynamic binding :syspath to the string syspath so that
       Janet will load system modules from a directory different than
       the default. The default is set when Janet is built, and 
       defaults to /usr/local/lib/janet on Linux/Posix. On Windows,
       there is no default value. This option supersedes JANET_PATH.

Note that, if one installs from the official (or locally-built) .msi, "arrangements are made" (TM) so that JANET_PATH is set to some location under %APPDATA% [3]. Thus, subsequent typical invocations of janet.exe (e.g. those made via new command prompts) will have JANET_PATH set and consequently (dyn :syspath) will likely yield a non-nil string path.


While I was at it, I also tweaked the man page bit about JANET_PATH to have:

If no JANET_PATH is set, Janet will look in the default location set at compile time. This should be a colon-separated list of directory names on Linux/Posix, and a semicolon-separated list on Windows. Note that a typical setup (i.e. not NixOS / Guix) will only use a single directory.


[1] See here and here.

[2] This was also verified by manually building janet.exe from source on Windows and checking (dyn :syspath) (which returned nil) on a system that didn't have Janet installed via a typical .msi.

[3] A comment was added to tools/msi/janet.wxs to this effect.

Copy link
Member

@pepe pepe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sogaiu
Copy link
Contributor Author

sogaiu commented Sep 12, 2025

May be the CI failure is related to this.

@bakpakin bakpakin merged commit e601e8f into janet-lang:master Sep 15, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants