-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[bug] Building for Windows Fails as System User (e.g., on AWS EC2) #9895
Comments
Working backwards from the .msi build failure:
Also noting that this isn't just for the WiX toolset path, but also NSIS. The
and so on and so on for every directory. Given it is that crate's intent to provide paths to the user's directory, it is not a bug on their part that they are providing a user specific path. It's expected behavior for them to provide a path to the system if the system user is the one that kicks off this whole flow. As such, it seems to land more squarely on the Tauri bundler to handle this edge case. Ideally, the Tauri bundler detects if it is running as the system user on Windows. It could then handle that by installing and calling these toolchains somewhere else than the A simple solution may be install and reference it from the current project's workspace (the one being built). This would:
Would that approach be acceptable to the maintainers? (Also considered non-mutually exclusive approach of allowing user to customize path to WiX/NSIS, but above approach auto-fixes for the user without them needing to provide that custom path). |
Describe the bug
Near the end of a Tauri Windows build, when it comes to bundling, Tauri seems to rely on some toolsets it installs in the user's AppData. However, in the context of AWS EC2 instances, build workloads are run under the systemuser. This means that installing these toolsets (e.g., WiX, NSIS) in this directory makes them unusable/executable, due to system/security restriction. The result/error is manifested without clear meaning, whether bundling .exe (using NSIS) or .msi (using WiX).
Only got to this conclusion because if I run the build on the same code in the same place, but as any other user, then Tauri installs the bundling tools in that other user's AppData, and then those bundling tools work perfectly fine for the Tauri build to succeed.
Datapoints:
candle.exe
in that WiX toolset in the systemuser's AppData. In other words, it's not just Tauri that fails to launch it; no user can launch it either.Reproduction
On a Windows Machine where you can access as systemuser (e.g., the only option for AWS EC2 workloads)
Expected behavior
The bundling toolchains that Tauri installs are expected to be installed at a location where they are usable. This would result in the expected behavior of Tauri build and bundling success, regardless of whether the caller is a systemuser or a non-system user.
At the least, it is expected to be able to configure where the toolchains are installed/referenced.
Full
tauri info
outputStack trace
Initial build logs (e.g.,
TAURI_TARGET_TRIPLE
):Problem with NSIS for .exe bundling:
Note on above: the file does exist (just can't be run).
Problem with WiX for .msi bundling:
Additional context
I know that there are GitHub actions for cross-compilation, but that isn't an option for us. Besides, this problem is not necessarily restricted to AWS EC2, as it would apply to any Windows host where systemuser is used for building.
The text was updated successfully, but these errors were encountered: