graal icon indicating copy to clipboard operation
graal copied to clipboard

PowerShell and PowerShell Core gu built-in allias - please add a notice to Getting started guide.

Open nlhnt opened this issue 5 years ago • 1 comments
trafficstars

Edit:

Sorry about the bug label, I didn't add it, and it seems I am not able to change it for some reason.

I just found out about #2565 , very nice.

Describe the issue Windows PowerShell and PowerShell Core have a built-in allias "gu" for Get-Unique. Trying to run GraalVM Updater from this shell will lead to the result provided below. It works with cmd, because it doesn't use that built-in allias. A notice in getting started guide about this would be appreciated, took me 10 minutes to actually read that trace and to realize I have to use a different shell or remove the built-in allais. It took so long, because I assumed I set the env-variables wrong with having the basic functionality not functional.

Steps to reproduce the issue Please include both build steps as well as run steps

  1. Install GraalVM
  2. Set up environmental variables, both %PATH% and %JAVA_HOME%
  3. Open up PowerShell or PowerShell Core
  4. Try to run gu -h

Describe GraalVM and your environment:

  • GraalVM version (latest snapshot builds can be found here), or commit id if built from source: [e.g. EE 19.3, CE 20.0, CE 20.1.0-dev-20200304_0848]
  • JDK major version: [e.g.:8]
  • OS: [e.g. macOS Catalina]
  • Architecture: [e.g.: AMD64]

More details Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary. Result:

gu -h
Get-Unique : A parameter cannot be found that matches parameter name 'h'.
At line:1 char:4
+ gu -h
+    ~~
+ CategoryInfo          : InvalidArgument: (:) [Get-Unique], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetUniqueCommand

Expected:

gu -h
GraalVM Component Updater v2.0.0

Usage:
        gu info [-cClLnprstuvV] <param>         prints info about specific component (from file, URL or catalog)
        gu available [-aClvV] <expr>            lists components available in catalog
        gu install [-0CcDfiLMnosruvyxY] <param> installs a component package
        gu list [-clv] <expression>             lists installed components, or components from catalog
        gu remove [-0DfMxv] <id>                uninstalls a component
        gu update [-cCnLsux] [<ver>] [<param>]  upgrades to recent GraalVM
        gu rebuild-images                       rebuilds native images. Use -h for detailed usage

Common options:
  -A, --auto-yes            say YES or ACCEPT to all questions.
  -c, --catalog             treat parameters as component IDs from catalog of GraalVM components. This is the default.
  -d, --debug               debugging. Prints stacktraces, ...
  -E, --no-catalog-errors   do not stop, if at least one catalog is working.
  -h, --help                print help.
  -L, --local-file, --file  treat parameters as local filenames of packaged components.
  -n, --no-progress         do not display download progress.
  -N, --non-interactive     noninteractive mode. Fail when input is required.
  --show-version            print version information and continue.
  -u, --url                 interpret parameters as URLs of packaged components.
  -v, --verbose             be verbose. Prints versions and dependency info.
  --version                 print version.

Use
        gu <command> -h
to get specific help.

Runtime options:
  --native                                     Run using the native launcher with limited Java access (default).
  --jvm                                        Run on the Java Virtual Machine with Java access.
  --vm.[option]                                Pass options to the host VM. To see available options, use '--help:vm'.
  --log.file=<String>                          Redirect guest languages logging into a given file.
  --log.[logger].level=<String>                Set language log level to OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL.
  --help                                       Print this help message.
  --help:vm                                    Print options for the host VM.

See http://www.graalvm.org for more information.

nlhnt avatar Jun 24 '20 09:06 nlhnt

2 years later, zero movement... you need to use "x64 Native Tools Command Prompt" instead.

youcangetme avatar Jul 17 '22 05:07 youcangetme

It seems that this is an unfortunate name clash. @nlhnt what happens if you use gu.exe -h instead?

fniephaus avatar Feb 02 '23 07:02 fniephaus

It seems that this is an unfortunate name clash. @nlhnt what happens if you use gu.exe -h instead?

Nope, but gu.cmd -h works, there's no gu.exe in graalvm-ce-java<version>/bin

nlhnt avatar Feb 02 '23 10:02 nlhnt

Oh right, I meant gu.cmd -h. Thanks for confirming this works! Changing the name of the tool is too difficult at this point. I hope you don't mind that I'm closing this now.

fniephaus avatar Feb 02 '23 10:02 fniephaus