-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Doc environment variables #20162
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
Doc environment variables #20162
Conversation
|
Hey @kbdave314, great first Julia PR! This is very comprehensive and well thought out. I have just a few minor stylistic comments to ensure consistency with the other markdown files in the manual. Overall nice work here! |
| @@ -0,0 +1,138 @@ | |||
| # Environment Variables in Julia | |||
|
|
|||
| The environment variables that Julia uses generally start with `JULIA`. If [`Base.versioninfo()`](https://github.com/JuliaLang/julia/blob/master/base/interactiveutil.jl#L247) is called with `verbose` equal to `true`, then the output will list all environment variables for which `JULIA` appears in the name. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically we put line breaks to keep the line length down. Markdown renders a single newline as a space, so it works out just fine.
| ## File locations | ||
|
|
||
| ### `JULIA_HOME` | ||
| The absolute path of the directory containing the Julia executable, which sets the global variable [`Base.JULIA_HOME`](https://github.com/JuliaLang/julia/blob/master/base/initdefs.jl#L90). If `$JULIA_HOME` is not set, then `Base.JULIA_HOME` defaults to its compile-time value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little mixed in the existing markdown files, but I think in general we should be using a single space after periods (or a line break—that also works) rather than two spaces.
|
|
||
| ## File locations | ||
|
|
||
| ### `JULIA_HOME` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the other files it would be good to add a line break after the headings. It should render the same, it's just a consistency thing.
| $JULIA_HOME/$SYSCONFDIR/julia/juliarc.jl | ||
| $JULIA_HOME/../etc/julia/juliarc.jl | ||
| ``` | ||
| by default (via [`Base.load_juliarc()`](https://github.com/JuliaLang/julia/blob/master/base/client.jl#L316) ). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra space here after the URL and before the outer closing parenthesis.
| ## REPL formatting | ||
| Environment variables that determine how REPL output should be formatted at the terminal. Generally, these variables should be set to [ANSI terminal escape sequences](http://ascii-table.com/ansi-escape-sequences.php). | ||
|
|
||
| ### `JULIA_ERROR_COLOR` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These have 3 spaces after the hashes. Was that intentional? For consistency it would be better to use a single space.
| ``` | ||
| by default. | ||
|
|
||
| The global variable [`Base.DATAROOTDIR`](https://github.com/JuliaLang/julia/blob/master/base/Makefile#L62) determines a relative path from `Base.JULIA_HOME` to the data directory associated with Julia; then the directory. Then the path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea behind linking the function and variable names to locations in the source code is a good one, but the problem is that any edits to those files will change what's at the given line. It would get kind of messy for every PR to track the line numbers and update this file accordingly. So perhaps it would be better to link to documentation for the functions and/or variables if they're available, otherwise don't provide a link.
| # Environment Variables in Julia | ||
|
|
||
| The environment variables that Julia uses generally start with `JULIA`. If | ||
| `Base.versioninfo()` is called with `verbose` equal to `true`, then the output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a link here?
| Windows and OS X, or `/etc/alternatives/editor` if it exists, or `emacs` | ||
| otherwise. | ||
|
|
||
| **Warning:** `JULIA_EDITOR` is *not* used in the determination of the editor for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be !!! warning?
|
This is a really great first PR. Welcome to Julia! |
MichaelHatherly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: line wrapping, the manual is generally wrapped at about 92 chars rather than 80. That's just a general guideline though, so don't worry about changing that now unless it makes the paragraphs "flow" better.
Some other minor style comments in line.
| [`Base.versioninfo()`](@ref) is called with `verbose` equal to `true`, then the | ||
| output will list all environment variables for which `JULIA` appears in the name. | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double blank line can be reduced to a single one for consistency with the rest of the docs.
| A separated list of absolute paths that are to be appended | ||
| to the variable [`Base.LOAD_PATH`](@ref). (In Unix-like systems, the path | ||
| separator is `:`; in Windows systems, the path separator is `;`.) The | ||
| `Base.LOAD_PATH` variable is where [`Base.require()`](@ref Base.require) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(@ref Base.require) should be able to be changed to just (@ref). The trailing () in Base.require() can be removed I think, since there is no zero-arg require method.
(Same applies to the other "named" @refs further down as well.)
| is taken to be `open` on Windows and OS X, or `/etc/alternatives/editor` if it | ||
| exists, or `emacs` otherwise. | ||
|
|
||
| *Note:* `$JULIA_EDITOR` is *not* used in the determination of the editor for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could perhaps use an admonition here for the note, i.e. !!! note syntax (see docs for details). Same applies to some of the other notes further down.
| @@ -0,0 +1,295 @@ | |||
| # Environment Variables in Julia | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either this title should change to # Environment Variables or the @refs that are meant to link here should be changed to [Environment Variables in Julia](@ref) otherwise the docs build will probably fail.
| `$JULIA_HOME` is not set, then `Base.JULIA_HOME` defaults to its compile-time | ||
| value. | ||
|
|
||
| The executable itself is one of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the docs leave a single blank line before and after triple backtick blocks. Makes it a bit easier to see where code blocks start and end if they don't specify a language.
…to admonition syntax, simplify cross-references, fix title.
b62441f to
f153d5b
Compare
| commands (via `Base.repl_cmd()`). Defaults to the environment variable | ||
| `$SHELL`, and falls back to `/bin/sh` if `$SHELL` is unset. | ||
|
|
||
| !!! note the `fish` shell is unsupported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to #19984
|
|
||
| !!! note the `fish` shell is unsupported. | ||
|
|
||
| ### `JULIA_EDITOR`, `VISUAL`, `EDITOR` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would take VISUAL and EDITOR out of the heading as they aren't Julia specific ENV variables.
| is taken to be `open` on Windows and OS X, or `/etc/alternatives/editor` if it | ||
| exists, or `emacs` otherwise. | ||
|
|
||
| !!! note `$JULIA_EDITOR` is *not* used in the determination of the editor for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Syntax here should be
!!! note
`$JULIA_EDITOR` is *not* used in the determination of the editor for
[`Base.Pkg.edit`](@ref): this function checks `$VISUAL` and `$EDITOR`
alone.
so the admonition body text needs to be written on a newline rather than running on from !!! note.
Same for the other admonitions in the file.
KristofferC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice work. Only a few comments from me.
|
|
||
| !!! note | ||
|
|
||
| the `fish` shell is unsupported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for fish shell was just merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though not well tested
| $JULIA_HOME/../share/julia/site/v$(Base.VERSION.major).$(Base.VERSION.minor) | ||
| ``` | ||
|
|
||
| so that, e. g., version 0.5 of Julia on a Linux system with a Julia executable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. perhaps (no space)
|
|
||
| !!! note | ||
|
|
||
| input is hardcoded to be bold (`"\033[1m"`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore.
|
|
||
| !!! note | ||
|
|
||
| output is hardcoded to be bold (`"\033[1m"`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore.
|
@KristofferC has requested a few small changes. I believe @MichaelHatherly's requested changes have been addressed? This seems very close to being ready to merge... |
|
There are a few places that say "64 bit integer" that may not be accurate on 32 bit Julia, those should be verified. |
|
|
||
| The absolute path of the directory containing the Julia executable, which sets | ||
| the global variable [`Base.JULIA_HOME`](@ref). If `$JULIA_HOME` is not set, | ||
| then `Base.JULIA_HOME` defaults to its compile-time value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't quite right, you can move around the compiled executable and Base.JULIA_HOME will reflect the location it gets run from
| ### `JULIA_SHELL` | ||
|
|
||
| The absolute path of the shell with which Julia should execute external | ||
| commands (via `Base.repl_cmd()`). Defaults to the environment variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only on unix - on windows, commands don't go through a shell
| ### `JULIA_WORKER_TIMEOUT` | ||
|
|
||
| A `Float64` that sets the value of `Base.worker_timeout()` (default: `60.0`). | ||
| This function gives the number of a seconds a worker process will wait for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
number of seconds
| Environment variables that determine how REPL output should be formatted at the | ||
| terminal. Generally, these variables should be set to [ANSI terminal escape | ||
| sequences](http://ascii-table.com/ansi-escape-sequences.php). The Julia base | ||
| package provides a high-level interface with much of the same functionality: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"base package" isn't a term we use much, I guess you just mean functions that are under Base?
| then garbage collection is forced. | ||
| * If it's the `n`th time that `jl_gc_collect()` has been called, and `n` | ||
| belongs to the arithmetic sequence represented by `$JULIA_GC_ALLOC_PRINT`, | ||
| then counts for for the number of calls to `jl_gc_pool_alloc()` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
counts for the
| then counts for for the number of calls to `jl_gc_pool_alloc()` and | ||
| `maybe_collect()` are printed. | ||
|
|
||
| If the character `'r'` appears as above, then the interval between garbage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is "as above" referring to?
| !!! note | ||
|
|
||
| this environment variable has an effect only if Julia was compiled with | ||
| `JL_DEBUG_BUILD` set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is enabled when building the julia-debug executable, so julia-debug always has this on
|
Still need to fix JULIA_HOME section. |
|
|
||
| If set to anything besides `0`, then the Julia garbage collector will wait for | ||
| the debugger to attach instead of aborting whenever there's a critical error. | ||
| If set to anything besides `0`, then the Julia garbage collector will wait for the debugger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the debugger" sounds a little funny, doesn't it wait for any debugger?
| this environment variable has an effect only if Julia was compiled with | ||
| `JL_DEBUG_BUILD` set. | ||
| This environment variable has an effect only if Julia was compiled with `JL_DEBUG_BUILD` | ||
| set—in particular, the `julia-debug` executable is always compiled with this build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put spaces around the dash, otherwise it looks like "set-in" is being used as a single hyphenated word
|
|
||
| ### `JULIA_EDITOR` | ||
|
|
||
| The editor returned by `Base.editor()` and used in, e.g., [`Base.edit`](@ref). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should mention that this is a command and not a path.
|
|
||
| The absolute path `Base.find_hist_file()` of the REPL's history file. If `$JULIA_HISTORY` is | ||
| not set, then `Base.find_hist_file()` defaults to | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Base.REPL.find_hist_file() ?
| @@ -0,0 +1,313 @@ | |||
| # Environment Variables | |||
|
|
|||
| The environment variables that Julia uses generally start with `JULIA`. If | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add here in the beginning how to actually set/modify the variables? And perhaps mention that it could be done conveniently in the .juliarc.jl file?
|
Could we by any chance have a list of all the variables in the |
|
Is there a chance for this to go soon into master? I would find such an overview to really improve the documentation. |
|
@m-j-w I don't think anyone would be offended if you wanted to copy the branch to your fork, address the last few review comments and remaining todo's, and open a new PR. We can keep the attribution and existing commits to recognize the good work that @kbdave314 did to flesh this out. |
Doc environment variables (Continuation of #20162)
Adds a documentation section for environment variables and their defaults.
Fix #5432
Fix #19988