-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Fix Issue 17998 - Document Options for install.sh #1936
Conversation
|
Thanks, this was on my to do list as well ;) |
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.
Thanks for pushing this forward!
install.dd
Outdated
|
|
||
| $(D_S $(TITLE), | ||
|
|
||
| $(UL |
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 like to start with a dense overview paragraph that gives reader an idea what this is all about.
What do you think about an introductory paragraph, along the lines of:
Introduction
The
dlang.org/install.shscript is the official D version manager for DMD, GDC and LDC on FreeBSD, Linux and macOS.
Its features include:
- Maintaining one or more portable compiler installations in the user's home directory (
~/dlang/)- Maintaining the latest stable version of Dub (multiple dub version are not supported)
- Self-updating via
~/dlang/install.sh update- Working without require administrative privileges
- Minimal external dependencies (NOTE: I'm not sure if it makes sense to document commands used, besides curl, as this can easily go out of sync with the source, but still we should mention what the users needs to have on his system).
- Supports nested activation of compilers. Activating a compiler, will setup the
PATH,LIBRARY_PATH,LD_LIBRARY_PATH,DMD,DC, andPS1environment variables. After activation, user's can revert those variables to their old values by invoking thedeactivatecommand, added to current shell session, by the activation command.- Supports Fish shell, in addition to Bash-compatible shells.
- For dmd, the installation of following versions is supported:
dmd- latest stable versiondmd-beta- latest beta versiondmd-nightly- the latest nightly releasedmd-<version>- specific official release (including beta releases)dmd-branch- experimental compiler branches- For ldc, the installation of following versions is supported:
ldc- latest stable versionldc-beta- latest beta versionldc-<version>- specific official release (including beta releases)- For gdc, the installation of following versions is supported:
gdc- latest stable version
(Sorry for not writing directly in DDoc, but I am not the go.)
install.dd
Outdated
| $(H2 $(LNAME2 usage, Usage)) | ||
|
|
||
| $(CONSOLE | ||
| ./install.sh [<command>] [<args>] |
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.
Always use ~/dlang/install.sh. Avoid using relative paths, especially in documentation.
I like it. I converted your text to Ddoc and made a few changes. Please feel free to improve upon them ;-) |
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.
see review
install.dd
Outdated
| If you want, you can directly invoke it: | ||
|
|
||
| $(CONSOLE | ||
| curl https://dlang.org/install.sh | bash -s |
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 recall someone (@CyberShadow?) quoted a scathing article about this practice. Perhaps it would be best to not mention it.
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.
AFAIK, it's fine if done right:
https://sandstorm.io/news/2015-09-24-is-curl-bash-insecure-pgp-verified-install
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.
install.dd
Outdated
| wget https://dlang.org/install.sh | ||
| ) | ||
|
|
||
| If you want, you can directly invoke it: |
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.
Oh, also please avoid the use of "you" in documentation.
s/If you want, you can directly invoke it/Alternatively, the script can be invoked directly/
install.dd
Outdated
|
|
||
| $(P Once a compiler can be activated for the current session:) | ||
|
|
||
| Run the respective `activate` script in your shell to use a compiler by default: |
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.
s/your shell/the shell/
Use the recently introduced on hover info button on the downloads page to show a link to the install.sh script documentation.
|
Okay addressed the feedback. |
install.dd
Outdated
| $(EXAMPLES | ||
| ~/dlang/install.sh uninstall dmd | ||
| /install.sh uninstall dmd-2.071.1 | ||
| /install.sh uninstall ldc-1.1.0-beta2 |
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.
Use ~/dlang/install.sh here too. It looks a bit confusing, otherwise.
install.dd
Outdated
| Run the respective `activate` script in a shell to use a compiler by default: | ||
|
|
||
| $(CONSOLE | ||
| source ~/dlang/<installed-compiler>/activate |
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.
You should also mention that for fish shell the command is:
source ~/dlang/<installed-compiler>/activate.fish
| ~/dlang/install.sh dmd | ||
| ~/dlang/install.sh install dmd | ||
| ~/dlang/install.sh install dmd-2.071.1 | ||
| ~/dlang/install.sh install ldc-1.1.0-beta2 |
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.
Just for completeness (and easy copy-pasting) can you mention also:
~/dlang/install.sh install dmd-beta
~/dlang/install.sh install dmd-nightly
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.
Ok. done
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.
My tweaks
install.dd
Outdated
|
|
||
| $(H2 Introduction) | ||
|
|
||
| The $(LINK2 https://dlang.org/install.sh, `dlang.org/install.sh`) script is the official D version manager for DMD, GDC and LDC on FreeBSD, Linux and macOS and provides a convenient way to fetch and install a D compiler without requiring administrative privileges nor external dependencies. |
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.
Sentence is too long, break it with macOS. It provides.
install.dd
Outdated
|
|
||
| $(UL | ||
| $(LI Maintaining one or more portable compiler installations in the user's home directory (`~/dlang`)) | ||
| $(LI Maintaining the latest stable version of $(LINK2 http://code.dlang.org/docs/commandline, `dub`)) |
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.
Introduce dub, don't assume they know it, the D package manager, dub.
install.dd
Outdated
| $(LI Maintaining one or more portable compiler installations in the user's home directory (`~/dlang`)) | ||
| $(LI Maintaining the latest stable version of $(LINK2 http://code.dlang.org/docs/commandline, `dub`)) | ||
| $(LI Self-updating via `~/dlang/install.sh update`) | ||
| $(LI Supporting nested activation of compilers. Activating a compiler, will setup the `PATH`, `LIBRARY_PATH`, `LD_LIBRARY_PATH`, `DMD`, `DC`, and `PS1` environment variables. After activation, user's can revert those variables to their old values by invoking the `deactivate` command, added to current shell session, by the activation command.) |
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.
Why is it "nested?" Can you activate a compiler inside another one's session?
Merge last sentence:
variables and a deactivate command, which reverts the variables to their old values.
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.
Can you activate a compiler inside another one's session?
Yes it's a stack.
install.dd
Outdated
| curl https://dlang.org/install.sh | bash -s | ||
| ) | ||
|
|
||
| $(P If no argument are provided, the latest DMD compiler will be installed.) |
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.
arguments
install.dd
Outdated
|
|
||
| $(P If no argument are provided, the latest DMD compiler will be installed.) | ||
|
|
||
| $(P The installer will also install a copy of itself to `~/dlang/install.sh`.) |
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.
also make a copy of itself at
install.dd
Outdated
| Installs the latest beta version of a compiler) | ||
| $(SWITCH $(SWNAME dmd-nightly), | ||
| Installs DMD nightly) | ||
| $(SWITCH $(SWNAME dmd-20170-02-10), |
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.
2017-
install.dd
Outdated
| ~/dlang/install.sh install ldc-1.1.0-beta2 | ||
| ) | ||
|
|
||
| $(P Once a compiler can be activated for the current session:) |
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.
Why put this in its own paragraph? Merge it with the next sentence instead session, run the
|
@ZombineDev @joakim-noah thanks a lot for your feedback! Addressed. |
install.dd
Outdated
| $(H2 $(LNAME2 get, Downloading the installer)) | ||
|
|
||
| $(CONSOLE | ||
| wget https://dlang.org/install.sh |
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.
How about:
mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.shThere 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.
Yes, better to have a consistent install location, if the curl method installs it differently.
install.dd
Outdated
| ~/dlang/<installed-ldc-compiler>/ldc2 | ||
| ) | ||
|
|
||
| Users of the $(LINK2 https://fishshell.com, Fish shell), can `activate.fish`: |
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 put the note about the FISH shell at the end of this section as AFAICT it's not a very popular shell and it stops the reading flow awkwardly if put in-between.
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.
No comma after shell),
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.
A few more tweaks
install.dd
Outdated
| $(LI Maintaining one or more portable compiler installations in the user's home directory (`~/dlang`)) | ||
| $(LI Maintaining the latest stable version of the D package manager, $(LINK2 http://code.dlang.org/docs/commandline, `dub`)) | ||
| $(LI Self-updating via `~/dlang/install.sh update`) | ||
| $(LI Supporting nested activation of compilers. Activating a compiler, will setup the `PATH`, `LIBRARY_PATH`, `LD_LIBRARY_PATH`, `DMD`, `DC`, and `PS1` environment variables, and a `deactivate` command, which reverts the modified variables to their old values.) |
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.
No comma needed after compiler, and variables,
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.
You are absolutely right about the first occurrence, but isn't the second one the Oxford comma?
I reworded it slightly:
will setup the
PATH,LIBRARY_PATH, ..PS1environment variables, and adeactivatecommand
install.dd
Outdated
| $(LI Maintaining the latest stable version of the D package manager, $(LINK2 http://code.dlang.org/docs/commandline, `dub`)) | ||
| $(LI Self-updating via `~/dlang/install.sh update`) | ||
| $(LI Supporting nested activation of compilers. Activating a compiler, will setup the `PATH`, `LIBRARY_PATH`, `LD_LIBRARY_PATH`, `DMD`, `DC`, and `PS1` environment variables, and a `deactivate` command, which reverts the modified variables to their old values.) | ||
| $(LI Supporting Fish shell, in addition to Bash-compatible shells.) |
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 Fish
install.dd
Outdated
| $(H2 $(LNAME2 get, Downloading the installer)) | ||
|
|
||
| $(CONSOLE | ||
| wget https://dlang.org/install.sh |
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.
Yes, better to have a consistent install location, if the curl method installs it differently.
install.dd
Outdated
| ~/dlang/<installed-ldc-compiler>/ldc2 | ||
| ) | ||
|
|
||
| Users of the $(LINK2 https://fishshell.com, Fish shell), can `activate.fish`: |
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.
No comma after shell),
install.dd
Outdated
| ) | ||
|
|
||
| Alternatively, it is also possible to directly use a compiler by calling its | ||
| binary directly. |
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.
Replace end with possible to call the compiler binary directly.
|
This is really good, but we are introducing a maintenance burden and a fragile synchronization between this file and install.sh. Would it not be better to add this documentation to the |
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.
Regardless, it's better to have it than not have it.
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.
No more tweaks, maybe linux shouldn't be capitalized, like macOS
Of course it would be better, but that's pretty difficult to do all the custom text, explanations and formatting. OTOH the compiler help page changes quite a lot and we are incredibly bad in keeping it up to date. So if we want to invest time in generating something automatically, I think the |
Hmm, I have only seen it written capitalized except for DMD's inconsistent version file. (Also I am terribly sorry for forgetting to squash this. We really need to re-enable auto-merge-squash.) |
Indeed figuring out how we can base those things on a common man-page like document would be helpful, but not that urgent as it's rarely changing. |

While this isn't perfect, it should provide a good basis for continuous improvements ;-)
I wasn't sure whether
~/dlang/install.shor./install.shshould be the recommended invocation.CC @MartinNowak @ZombineDev