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
Change install context of windows terminal profile to per-user
#9322
Change install context of windows terminal profile to per-user
#9322
Conversation
I'm so greatly appreciative of you and your work on this. Thanks so much! I'm hoping this fixes the issue.
I'd be ok with this in the future as long as our winget_pkgs submissions knows to use the -user one and it works. |
We're getting close to a release. Let's land this and see if it works. |
Welp, it failed but for a different reason. I'm not sure what's going on. It didn't even get submitted to the winget repo. |
I don't have much knowledge about the tool (winget-releaser github action), but looking at the error message and comparing it to the previous job from v0.80, it looks like the number of installer urls is causing the problem.
|
Good catch. I wonder where that's coming from? |
I think @sitiom helped with that CI change. Maybe they can help? |
The winget_pkgs failed again. Surprise! Here's the latest thread. @wolimst Any thoughts on the two options listed here? microsoft/winget-pkgs#109445 (comment) |
@fdncred Sorry it didn't work.
I think what they are suggesting is related to the winget manifest, not directly related to the installer msi. From Winget Manifest Schema for
About the value for *edit: |
oh, ok. Is this |
I think we are using the ci tools (Winget Releaser and Komac) for submitting winget PR, is that right? I don't have much knowledge about those tools, but I think the winget manifest is automatically generated by Komac. If Komac supports Best if we can get some help from the contributors who helped with the winget submission ci. |
Yup, I think that's right. It happened here #8070 @sitiom any ideas about this |
Yes, any changes to the manifest would require a manual PR. Winget Releaser is just used for auto-updating the manifest. Also, it seems like the installer is failing to install again in a Sandbox? You might want to resolve this first, as this may be connected to the Winget issue. Related: #8070 (comment) |
Thanks. Good tip about the sandbox but I have no clue how to resolve that at all. Manually rerunning the CI routines to generate a new MSI, like I did in the prior comment, isn't really an option. We have to figure this out one way or the other. |
Thanks for the info! I was able to reproduce the failure in a sandbox. The error message in the installation log is same with that one of the winget moderator found in their ci system.
I don't know it for sure, but maybe they are running the ci in a sandbox. So, resolving this might solve the issue we are having in the winget ci. I'll look into this further when I have some free time. @fdncred In #8070 (comment), it seems like the manually created installer had no install error. Can you share any details when you manually re-created the installer? |
That's great news! Yup, 1603 is that same error code.
Oh, that's awesome news. I hope you can find time and figure out exactly what is going on and how to fix it. That would be a huge win and relief to me!
Sure, but it's a non-trivial manual task, so much so that I tried to document it to match my Windows system here nushell/.github/workflows/release-pkg.nu Lines 9 to 40 in 7d301c7
There's no doubt that you'll have to change the paths and such to make it work for you but I tried to list the requirements and exactly how to set all the variables it needs. I usually just end copy copy-n-pasting and running these lines one-by-one. |
I think I found the cause of the problem, and after all, it seems like neither windows terminal profile feature nor permission issue are not the main cause. (TLDR is at the bottom of the comment.) Currently, an installer created by github actions ci for release fails to install in a windows sandbox instance, with 1603 error code when executing custom action for windows terminal profile feature. I was able to install without an error by changing the installer to ignore the result of the wt profile feature and recreated it from the release ci. But at this point, executing It looks like this error is the cause of the installation failure on wt profile feature, since it executes nushell to update the wt profile configuration. On the other hand, an installer that is manually created by a user does not have this problem. Looking here and there, I found that nushell is already statically linking the MSVC runtime as below. Lines 1 to 4 in 64319ad
However, these build configurations are abandoned on the ci, because nushell/.github/workflows/release.yml Lines 73 to 74 in 64319ad
By removing the Finally, looking at the history of PRs for winget submission, I found that the verification failure is occurring since v0.73 (winget PR). The wt profile feature was added in v0.65 (release note, winget PR) and had no problem on the verification until v0.73. On the other hand, nushell started using TLDR:
|
So, I think I'll make a PR to remove Also, if it's ok, I would like to revert the changes made by this PR (that changed install context of wt profile to per-user) back to per-system, since the installer is based on per-system installation and having different installation context among the features creates unnecessary inconsistency. @fdncred Does this sound good to you? |
First of all, wow, big wow! I'm so impressed and thankful that you were able to figure out exactly what is going on. Thank you so much!
Yes, it does. I'm excited to see it work. |
Thanks. Happy to help! I just created two PRs discussed in the previous comments. I'm hopeful that it will finally resolve the verification failure in the winget PRs since it looks quite promising, but let's wait for the next release to see if it works..! |
…9513) # Description Prevent `rustflags` build configuration from being ignored in github actions ci workflows. [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain/) used in ci workflows sets `RUSTFLAGS="-D warnings"` env variable by default. It has priority over some other sources of `rustflags` as described in [the cargo reference](https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags). Nushell is using `target.x86_64-pc-windows-msvc.rustflags` to statically link MSVC runtime in windows platform, but this config is being ignored in ci workflows. By unsetting `RUSTFLAGS` env variable, `rustflags` build configurations will be properly used in ci workflows. I assume that this was the cause of the installer verification failures on the recent winget submission PRs. For more details, refer discussions in microsoft/winget-pkgs#106977 and #9322 (comment). # User-Facing Changes Pre-built releases for windows that are created by the release ci workflow will now contain statically linked MSVC runtime. # Tests + Formatting Confirmed successful installation in a windows sandbox instance, which was failing before. It also contains changes made in #9514. Release ci workflow: https://github.com/wolimst/nushell/actions/runs/5357440849 Installer: https://github.com/wolimst/nushell/releases/tag/0.81.0-test # After Submitting Need to check the installer verification result in a winget submission PR for the next release, if this PR gets merged.
# Description Revert installation context of windows terminal profile to per-system, since installation context of other features are per-system, and having different installation context creates unnecessary inconsistency. Installation context change of windows terminal profile to per-user (#9322) was made to resolve the recent installer verification failure on winget submission PRs, but the cause of this problem seems to be in another place (#9513). For more details, refer discussions in #5812 and #9322. # User-Facing Changes Windows terminal profile for nushell will be installed in system context. Installation path will be changed as below: - before: `C:\Users\<user>\AppData\Local\Microsoft\Windows Terminal\Fragments\nu\nu.json` - to: `C:\ProgramData\Microsoft\Windows Terminal\Fragments\nu\nu.json` # Tests + Formatting Confirmed successful installation of nushell and windows terminal profile file in windows using below installer that created by release ci workflow. It also contains changes made in #9513. Release ci workflow: https://github.com/wolimst/nushell/actions/runs/5357440849 Installer: https://github.com/wolimst/nushell/releases/tag/0.81.0-test
Seems like it's fixed now 🎉: microsoft/winget-pkgs#110786 |
great work here! our winget create pr action failed for some reason, but after the winget pr got created, it was totally successful! i'm just not sure how the pr got created. |
Welp, winget is broke again. I just went through and all the |
Added comment in #5812 (comment). |
Thanks @wolimst. You can see here where i checked for |
@wolimst Any time to help diagnose our latest winget + sandbox failures? I have two suspicions:
Any help here would be greatly appreciated. I think this is what the guid should be
|
Description
Change installation context of the windows terminal profile to
per-user
fromper-system
.This change is made because installation validation fails in winget ci while executing custom action to replace the installation path of
nu.exe
andnu.ico
in the windows terminal profile file.Refer discussions in #5812 and microsoft/winget-pkgs#106977
C:\ProgramData\Microsoft\Windows Terminal\Fragments\nu\nu.json
C:\Users\<user>\AppData\Local\Microsoft\Windows Terminal\Fragments\nu\nu.json
nu.exe
andnu.ico
in the json file will be executed without privilege escalationThis change is expected to eliminate the validation failure in winget ci (need to wait until next release to be sure about it), however, it creates some inconsistency in installation context.
per-user
context, other files / PATH env variable are installed inper-system
context.warning LGHT1076 : ICE91: The file 'WindowsTerminalProfileFile' will be installed to the per user directory 'WindowsTerminalProfileAppFolder' that doesn't vary based on ALLUSERS value. This file won't be copied to each user's profile even if a per machine installation is desired.
which means: WT profile will be installed only for the user that executed the installer and it won't be installed for other users in the system. However, the installer is configured to use
per-system
context, therefore, other files (such as nushell binarynu.exe
) will be installed for all users.It might be better if we provide options for installation context (
per-user
orper-system
) as requested in #5927 in the future, if that doesn't cause problems in winget ci.User-Facing Changes
Tests + Formatting
No test is added since this change is related to installation process in Windows and does not contain source code changes.
Following checks are done manually.
Environment
.github/workflows/release-pkg.nu
scriptChecks
Install: WT profile should be created in
C:\Users\<user>\AppData\Local\Microsoft\Windows Terminal\Fragments\nu\nu.json
and it should contain correct path fornu.exe
andnu.ico
.Uninstall: WT profile should be removed.
After Submitting
No relevant documentation to update.