Skip to content
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

quarkus:update fails on Windows with quarkus-cli #43473

Closed
codengine opened this issue Sep 24, 2024 · 9 comments · Fixed by #43536
Closed

quarkus:update fails on Windows with quarkus-cli #43473

codengine opened this issue Sep 24, 2024 · 9 comments · Fixed by #43536
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@codengine
Copy link

Describe the bug

I'm using the Quarkus CLI 3.14.4 that I installed through Chocolatey with PowerShell on Windows 10.
When I try to update my project through quarkus:update, the generated openrewrite recipe contains a non-escaped path to the recipe itself here:

configFile = project.getRootProject().file("C:\Users\xxx\AppData\Local\Temp\quarkus-project-recipe-8715019618984806815.yaml")

It should be

configFile = project.getRootProject().file("C:\\Users\\xxxx\\AppData\\Local\\Temp\\quarkus-project-recipe-8715019618984806815.yaml")

With that change, the recipe works fine when I invoke the upgrade through gradle manually.

Moreover, instead of reporting the error, the upgrade itself is stuck and does nothing.

Expected behavior

The upgrade is cancelled on errors and paths should be generated correctly on Windows environments.

Actual behavior

Process is stuck and silent, upgrade fails.

How to Reproduce?

  • Windows 10 (11 perhaps also)
  • Chocolatey
  • PowerShell 7
  • quarkus-cli 3.14.4
  • An upgradable project

Output of uname -a or ver

Windows 10 22H2

Output of java -version

openjdk version "22.0.1" 2024-04-16

Quarkus version or git rev

3.14.4

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.8

Additional information

No response

@codengine codengine added the kind/bug Something isn't working label Sep 24, 2024
@quarkus-bot quarkus-bot bot added area/cli Related to quarkus cli (not maven/gradle/etc.) env/windows Impacts Windows machines labels Sep 24, 2024
Copy link

quarkus-bot bot commented Sep 24, 2024

/cc @ebullient (cli), @maxandersen (cli)

@maxandersen
Copy link
Member

the bug is here https://github.com/quarkusio/quarkus/blob/main/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateCommand.java#L85

that is resulting in an unescaped string to be made.

up for try fix that and test on windows and make a pullrequest ?

@maxandersen
Copy link
Member

something like path.replace("\\", "\\\\"); should suffice.

@gsmet
Copy link
Member

gsmet commented Sep 26, 2024

Yeah so we usually replace them by / in other parts of the code. I was actually fixing it and saw your message when looking for the issue number.

@gsmet
Copy link
Member

gsmet commented Sep 26, 2024

@codengine if you can check / in the path works for you, #43536 should address the issue.

@codengine
Copy link
Author

@gsmet Is there an artifact that I can use for testing?

@gsmet
Copy link
Member

gsmet commented Sep 28, 2024

@codengine if you can confirm manually changing things to / works for you, I can merge and then you will have the snapshots available here: https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#using-snapshots

@codengine
Copy link
Author

@codengine if you can confirm manually changing things to / works for you, I can merge and then you will have the snapshots available here: https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#using-snapshots

I can confirm that it works with / on Windows.

@gsmet gsmet closed this as completed in b15f758 Oct 2, 2024
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Oct 2, 2024
@gsmet
Copy link
Member

gsmet commented Oct 2, 2024

Thanks for confirming! I merged the PR.

@gsmet gsmet modified the milestones: 3.16.0.CR1, 3.15.2 Oct 18, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue Oct 21, 2024
bschuhmann pushed a commit to bschuhmann/quarkus that referenced this issue Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants