Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

How to install native image on Windows #8

Closed
lispyclouds opened this issue Dec 26, 2020 · 6 comments · Fixed by #9
Closed

How to install native image on Windows #8

lispyclouds opened this issue Dec 26, 2020 · 6 comments · Fixed by #9

Comments

@lispyclouds
Copy link

Thanks a lot for this handy action! 😄

I have been happily using this for Mac and Linux but wanted to try out native images for Windows too but im running into the following issues when trying to run gu install native-image:

  • If the default shell(Powershell I think?) is used:
    Run gu install native-image
      gu install native-image
      shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
      env:
        JAVA_HOME: C:\hostedtoolcache\windows\GraalVM\20.3.0-java11\x64
        JAVA_HOME_20.3.0.java11: C:\hostedtoolcache\windows\GraalVM\20.3.0-java11\x64
        LEIN_HOME: C:\hostedtoolcache\windows\Leiningen\2.9.5\x64
    Get-Unique: D:\a\_temp\1a3e4b20-ff2e-4c1f-8c67-4f71f6a61b6e.ps1:2
    Line |
       2 |  gu install native-image
         |  ~~~~~~~~~~~~~~~~~~~~~~~
         | A positional parameter cannot be found that accepts argument 'install'.
    
    Error: Process completed with exit code 1.
    
  • If I use shell: bash
    Run gu install native-image
      gu install native-image
      shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
      env:
        JAVA_HOME: C:\hostedtoolcache\windows\GraalVM\20.3.0-java11\x64
        JAVA_HOME_20.3.0.java11: C:\hostedtoolcache\windows\GraalVM\20.3.0-java11\x64
        LEIN_HOME: C:\hostedtoolcache\windows\Leiningen\2.9.5\x64
    D:\a\_temp\9fd80673-7852-483b-9f69-b700b89aafdc.sh: line 1: gu: command not found
    Error: Process completed with exit code 127.
    

This is my YAML

- name: Setup GraalVM
  uses: DeLaGuardo/setup-graalvm@master
  with:
    graalvm-version: '20.3.0.java11'
- name: Setup Leiningen
  uses: DeLaGuardo/setup-clojure@master
    with:
      lein: 2.9.5
- name: Install native image toolchain
  shell: bash # Or without this
  run: gu install native-image # This is what fails
@lispyclouds
Copy link
Author

I tried setting up the PATH manually too but my limited Windows skills are failing me miserably 🙁

@DeLaGuardo
Copy link
Owner

I'll have a look. Probably you right and this is just misconfiguration so should be easy to fix

@DeLaGuardo
Copy link
Owner

To install additional components on windows you can use gu.cmd instead of gu
however, I don't know yet why there is a difference between windows and other platforms (they all should work the same) :(

@BlueSkunka
Copy link

By default, windows has an alias named 'gu' for Get-Unique command

@dermoritz
Copy link

what is "gu" and how to install it on windows?

@DeLaGuardo
Copy link
Owner

@dermoritz it is a command line tool called GraalVM updater - https://www.graalvm.org/latest/reference-manual/graalvm-updater/

I recommend using official action from graalvm and this is how you can use gu on windows - https://github.com/graalvm/setup-graalvm/blob/main/.github/workflows/test.yml#L119-L126

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants