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

Respect interactive option when evaluation projects in static graph-based restore #5453

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Oct 3, 2023

Bug

Fixes: NuGet/Home#12907

Regression? Last working version:

Description

Previous versions of MSBuild did not accept an Interactive flag when evaluating projects. This can lead to the user not being prompted for credentials in static graph-based restore even if the user has specified the /interactive command-line argument.

This pull request contains two commits:

  • Updated to MSBuild 17.7.2 so that the new API is available
  • Pass the interactive option to the project load settings during project evaluation in static graph-based restore

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception - There is no abstraction currently to test this effectively
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@jeffkl jeffkl requested a review from a team as a code owner October 3, 2023 16:57
@jeffkl jeffkl self-assigned this Oct 3, 2023
@jeffkl
Copy link
Contributor Author

jeffkl commented Oct 3, 2023

/cc @MichaelSimons and @NikolaMilosavljevic for the source build changes, please let me know if those are good. 67975d0

Copy link
Member

@zivkan zivkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I'm confused how this works. Does NuGet.Build.Tasks.Console.exe capture stdin when our MSBuild task launches it as a child process? I was assuming no, and that there'd need to be some IPC, but I don't see any code changes for that. 🤷 Well, I'm assuming you tested and it worked, but it's entirely possible that child processes do automatically capture stdin. It's just not intuitive, because if a console app launches two child processes, which one gets stdin? Anyway, I'm rambling and getting out of scope of this PR.

@jeffkl
Copy link
Contributor Author

jeffkl commented Oct 5, 2023

Honestly, I'm confused how this works. Does NuGet.Build.Tasks.Console.exe capture stdin when our MSBuild task launches it as a child process? I was assuming no, and that there'd need to be some IPC, but I don't see any code changes for that. 🤷 Well, I'm assuming you tested and it worked, but it's entirely possible that child processes do automatically capture stdin. It's just not intuitive, because if a console app launches two child processes, which one gets stdin? Anyway, I'm rambling and getting out of scope of this PR.

This flag only ends up being passed to the NuGet-based MSBuild project SDK resolver which does not prompt during authentication. It either emits a message with device flow or pops up a dialog. Prompting the user for credentials via STDIN would not work at all in this scenario.

@jeffkl jeffkl merged commit 8295523 into dev Oct 5, 2023
15 of 16 checks passed
@jeffkl jeffkl deleted the dev-jeffkl-static-graph-projectinstance-interactive branch October 5, 2023 17:16
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 this pull request may close these issues.

Static graph-based restore does not respect Interactive option when loading projects
3 participants