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

Fix: CLI Windows Write exe Errors #3239

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

DogeDark
Copy link
Member

The CLI fails to write the new executable on Windows because the old one is still running during rebuilds.

This PR introduces a kill_all() method on the AppRunner. Ideally, the app would be killed right before the bundler starts, but I wasn't sure how to best get a handle down to the bundler. Instead, I opted for this simpler, but perhaps slightly less DX solution (since the app is closed during rebuilds and the dev can't admire their desktop app or interact with serverfns).

@DogeDark DogeDark added bug Something isn't working cli Related to the dioxus-cli program labels Nov 18, 2024
@jkelleyrtp
Copy link
Member

jkelleyrtp commented Nov 20, 2024

This is good for now, but a better solution to this problem might be:

  • to write the executables with a hash attached to the name that we save in the BuildArtifacts that gets removed
  • split apart build and bundle into two separate phases that only kills when we start bundling

When builds take a while it is nice to still have the app interactive. Hopefully one day our binary patching is good enough for most cases though.

It might be worth it to gate the killall only on windows since mac/linux seem okay (and I think technically end up doing hotreloading automatically...)

@DogeDark
Copy link
Member Author

@jkelleyrtp If it sounds good to you, I will gate this behind Windows and I'll add the preferred fix into Notion for a future patch release so that it's ready for 0.6, but can be properly fixed when there is more time.

@jkelleyrtp jkelleyrtp merged commit 3af7d34 into DioxusLabs:main Nov 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the dioxus-cli program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants