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

microsoft.git not respecting --disable-interactivity flag in winget #595

Closed
3 of 6 tasks
shalinikhare27 opened this issue Aug 7, 2023 · 5 comments · Fixed by microsoft/winget-pkgs#116034
Closed
3 of 6 tasks
Assignees

Comments

@shalinikhare27
Copy link

shalinikhare27 commented Aug 7, 2023

Setup

  • Which version of microsoft/git are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.40.1.vfs.0.2
cpu: x86_64
built from commit: 59bc9667c84164a4ad879d9b424687ca631f01b3
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon

Are you using Scalar or VFS for Git?

Scalar

If VFS for Git, then what version?

$ gvfs version

GVFS 1.0.18081.2
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.3208]
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

These operations were performed in an administrative CMD prompt.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD

winget install Microsoft.Git –disable-interactivity
  • What did you expect to occur after running these commands?

With the “—disable-interactivity” flag I expect no pop-ups.

  • What actually happened instead?

However, since I had multiple git background processes running, it still gave me a pop-up even though I set the “—disable-interactivity” flag. The prompt was The following process(es) use Git for Windows. Please terminate those processes and retry. I know this is expected; however, there shouldn't be a prompt if “—disable-interactivity” flag is set.

If you run winget --help, it mentions --disable-interactivity Disable interactive prompts.

  • If the problem was occurring with a specific repository, can you specify
    the repository?

    • Public repo: insert URL here
    • Windows monorepo
    • Office monorepo
    • Other Microsoft-internal repo: any silo repo
    • Other internal repo.
@derrickstolee
Copy link
Collaborator

derrickstolee commented Aug 8, 2023

Hi @shalinikhare27, thanks for the report!

This definitely seems like a case where the installer is not behaving the way that you expect. The microsoft/git fork inherits its installer from git-for-windows/git, so any change would need to happen in that project (and probably specifically in git-for-windows/build-extra).

One thing that would help us investigate this concern is how winget communicates the --disable-interactivity flag down to the installer. Somehow we know to not display the wizard, so some amount of integration already exists. It just hasn't been wired down to these kind of pop-up error messages.

It is important to note is that this prompt is communicating a failed installation procedure, so any integration to prevent the pop-up will still need to write an error to stderr and return a failure.

@shalinikhare27
Copy link
Author

@derrickstolee - yes, ideally we want it to respect the --disable-interactivity flag and write an error to stderr. This is important when we run certain installations in non-user context where prompts are meaningless. We want to just exit with a failure. Please let me know if I can provide any other data to debug this.

@derrickstolee
Copy link
Collaborator

I think I found the way to do it, but it will require some manual testing.

derrickstolee added a commit to derrickstolee/winget-pkgs that referenced this issue Aug 9, 2023
These arguments are intended to tell the installer to be as quiet as
possible.

* /SUPPRESSMSGBOXES indicates that the installer should not create
  pop-up windows when an issue arises. Instead, the installer will fail.
  This will resolve microsoft/git#595.

* "/enable-component windowsterminal" was added to the Git/Git manifest
  in microsoft#110011 to resolve microsoft#109915, which was creating some installation
  problems on Windows 10.

Signed-off-by: Derrick Stolee <[email protected]>
@derrickstolee derrickstolee self-assigned this Aug 9, 2023
@shalinikhare27
Copy link
Author

@derrickstolee How can I test this on my end?

@derrickstolee
Copy link
Collaborator

@shalinikhare27: Sorry for the delay in updating this issue, but the git-for-windows/build-extra fix ended up not being needed since there is a way to fix it via updating the winget manifest.

There are instructions in the PR description of how to test this locally, without needing any changes to the microsoft/git release assets. I've tested it myself and as soon as that PR is merged by the winget team this issue will be fixed.

microsoft-github-policy-service bot pushed a commit to microsoft/winget-pkgs that referenced this issue Aug 10, 2023
* microsoft/git: add custom installer arguments

These arguments are intended to tell the installer to be as quiet as
possible.

* /SUPPRESSMSGBOXES indicates that the installer should not create
  pop-up windows when an issue arises. Instead, the installer will fail.
  This will resolve microsoft/git#595.

* "/enable-component windowsterminal" was added to the Git/Git manifest
  in #110011 to resolve #109915, which was creating some installation
  problems on Windows 10.

Signed-off-by: Derrick Stolee <[email protected]>

* microsoft/git: match some format for Git/Git's manifest

The Git/Git manifest has some additional options that were created
directly by the Winget team, as opposed to microsoft/git which was
created by the Git team. Since the Winget team is likely better at this
sort of thing, adopt some of the choices made over there.

These are mostly innocuous, though there is one interesting difference
that still remains: the Git/Git manifest has two installers with
different 'Scope' values ('machine' and 'user') while microsoft/git is
only available via 'machine' scope. This is purposefully left alone
since there is no difference in how the installers are specified and we
are not sure we want to support user-only installs of microsoft/git.

Signed-off-by: Derrick Stolee <[email protected]>

---------

Signed-off-by: Derrick Stolee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants