scalameta / sbt-native-image

Plugin to generate native-image binaries with sbt
252 stars 22 forks source link

Native image for windows not working using github actions #46

Closed tonivade closed 2 years ago

tonivade commented 2 years ago

Describe the bug Trying to generate a native image for windows using github actions I get this error:

Run "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && sbt nativeImage
  "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && sbt nativeImage
  shell: C:\Windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "{0}""
  env:
    CI: true
    JAVA_HOME: C:\Users\runneradmin\.jabba\jdk\openjdk@1.17.0
The system cannot find the path specified.
Error: Process completed with exit code 1.

Link to the job: https://github.com/tonivade/scala-bricks/runs/5173939939?check_suite_focus=true

I used the example from your project .github/workflows/native.yml

To Reproduce Steps to reproduce the behavior:

  1. Create a clone of my project: https://github.com/tonivade/scala-bricks
  2. Run github actions
  3. You get the error I described

Expected behavior

I expect to generate native image for windows, the same way it's working in your project. https://github.com/scalameta/sbt-native-image/runs/4599915745?check_suite_focus=true

Screenshots

N/A

Installation:

N/A

Additional context

N/A

Search terms

N/A

tonivade commented 2 years ago

Finally I found the way to fix this, the path has changed, since windows-latest now is based on windows-2022.

Now the path is C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat.