210 Commits

Author SHA1 Message Date
Windows Console Service Bot
8b78be5f4a
PDP Localization Updates - main - 02/04/2025 00:49:01 (#18504) 2025-02-04 19:27:22 -06:00
Dustin L. Howett
a24fdaa7b2
Move the Preview release notes to Stable, add new Preview release notes (#18503) 2025-02-03 16:31:22 -08:00
Dustin L. Howett
8e4da6e938
build: change how we find the latest VC tools version (#18468)
Apparently, we were using the package containing the CRT _source code_
to determine the version of the tools.

Also apparently, VS does not guarantee that that package has the same
version as the tools package.

We should use the version of the tools package instead.
2025-01-28 13:33:50 -08:00
Dustin L. Howett
a3a4464667
build: add a couple more signing variables to ESRP (#18411)
This is in support of some identity changes we need to make.
2025-01-08 21:23:36 +00:00
Leonard Hecker
8bbf00e054
Remove Monarch/Peasant & Make UI single-threaded (#18215)
As before, a minor refactor:
* I started off by removing the Monarch/Peasant with the goal of moving
  it into and deduplicating its functionality with `WindowEmperor`.
* Since I needed a replacement for the Monarch (= ensures that there's
  a single instance), I wrote single-instance code with a NT mutex
  and by yeeting data across processes with `WM_COPYDATA`.
* This resulted in severe threading issues, because it now started up
  way faster. The more I tried to solve them the deeper I had to dig,
  because you can't just put a mutex around `CascadiaSettings`.
  I then tried to seeif WinUI can run multiple windows on a single
  thread and, as it turns out, it can.
  So, I removed the multi- from the window threading.
* At this point I had dig about 1 mile deep and brought no ladder.
  So, to finish it up, I had to clean up the entire eventing system
  around `WindowEmperor`, cleaned up all the coroutines,
  and cleaned up all the callbacks.

Closes #16183
Closes #16221
Closes #16487
Closes #16532
Closes #16733
Closes #16755
Closes #17015
Closes #17360
Closes #17420
Closes #17457
Closes #17799
Closes #17976
Closes #18057
Closes #18084
Closes #18169
Closes #18176
Closes #18191

## Validation Steps Performed
* It does not crash 
* New/close tab 
* New/close window 
* Move tabs between windows 
* Split tab into new window 
* Persist windows on exit / restore startup 
2024-12-12 22:21:24 +01:00
Dustin L. Howett
990ed187d6
ci: fix the code formatting job (#18059)
We started requiring PowerShell 7+ in #18021

We did not update the code formatting task.
2024-10-15 11:58:51 -05:00
Dustin L. Howett
2c97c0555d
build: fix the TSA configuration (#17929)
We are, quite literally, shipping the org chart.
2024-09-17 10:30:59 -05:00
Dustin L. Howett
4aa1624cd2
Remove PackageES in favor of our own versioning package (#17872)
PackageES is deprecated by known scourge-on-earth OneBranch, and is now
the cause of some non-compliance.

I got permission from them to open-source it, so that's coming next.

For now, we can just depend on a package based on our code based on
theirs.

Tested and working for C++ (DLL, EXE), C#, NuGet and MSIX.
2024-09-10 01:37:25 +02:00
Carlos Zamora
dbbc581154
Use WinGet API to improve Quick Fix results (#17614)
## Summary of the Pull Request
Improves Quick Fix's suggestions to use WinGet API and actually query
winget for packages based on the missing command.

To interact with the WinGet API, we need the
`Microsoft.WindowsPackageManager.ComInterop` NuGet package.
`Microsoft.WindowsPackageManager.ComInterop.Additional.targets` is used
to copy over the winmd into CascadiaPackage. The build variable
`TerminalWinGetInterop` is used to import the package properly.

`WindowsPackageManagerFactory` is used as a centralized way to generate
the winget objects. Long-term, we may need to do manual activation for
elevated sessions, which this class can easily be extended to support.
In the meantime, we'll just use the normal `winrt::create_instance` on
all sessions.

In `TerminalPage`, we conduct the search asynchronously when a missing
command was found. Search results are limited to 20 packages. We try to
retrieve packages with the following filters set, then fallback into the
next step:
1. `PackageMatchField::Command`,
`PackageFieldMatchOption::StartsWithCaseInsensitive`
2. `PackageMatchField::Name`,
`PackageFieldMatchOption::ContainsCaseInsensitive`
3. `PackageMatchField::Moniker`,
`PackageFieldMatchOption::ContainsCaseInsensitive`

This aligns with the Microsoft.WinGet.CommandNotFound PowerShell module
([link to relevant
code](9bc83617b9/src/WinGetCommandNotFoundFeedbackPredictor.cs (L165-L202))).

Closes #17378
Closes #17631
Support for elevated sessions tracked in #17677

## References
-
https://github.com/microsoft/winget-cli/blob/master/src/Microsoft.Management.Deployment/PackageManager.idl:
winget object documentation

## Validation Steps Performed
- [X] unelevated sessions --> winget query performed and presented
- [X] elevated sessions --> nothing happens (got rid of `winget install
{}` suggestion)
2024-08-23 19:20:29 +02:00
Dustin L. Howett
628e99f5d2
Disable PGO for Release builds (#17765)
Same justification as #17749.

We will revert this when either OneBranch Custom Pools become
fit-for-purpose or they upgrade to VS 17.11. Or the heat death of the
universe.
2024-08-21 16:21:05 -07:00
Dustin L. Howett
408f3e2bfd
Disable PGO for nightly builds (#17749)
Refs #17699
2024-08-20 14:15:27 -05:00
Windows Console Service Bot
37e2bc0caa
Localize PDP changelogs - main - 08/16/2024 23:36:05 (#17732) 2024-08-19 13:52:54 -05:00
Dustin L. Howett
9b21b78fee
pdp: add quick release notes to the store pages (#17730)
Now that the store displays changelogs, it seems unfair for us to not
put something in here.

These are intended to give a rough idea, not to be perfect, as they are
not the product of my hours of changelog writing (since I am lazy and
put that off until the day of release 🫣)
2024-08-16 18:25:40 -05:00
Dustin L. Howett
4c018efd64
chore: Update to TAEF 10.93.240607003 (#16595) 2024-08-16 22:50:19 +00:00
Dustin Howett
8207f26bcc Reapply "Reapply "build: switch back to the "latest" OneBranch build image (#17630)""
This reverts commit c0774dcda8bd831be1b42caafe06b7d47939a211.
2024-08-02 13:56:12 -05:00
Dustin L. Howett
c0774dcda8 Revert "Reapply "build: switch back to the "latest" OneBranch build image (#17630)""
This reverts commit 114c2b44d1c9e3035afd01849ad45610afff674b.
2024-08-02 12:09:49 -05:00
Dustin L. Howett
114c2b44d1 Reapply "build: switch back to the "latest" OneBranch build image (#17630)"
This reverts commit a8582978afa50ece88edc7eda9e182ced64876e2.
2024-08-01 15:52:32 -05:00
Dustin L. Howett
a8582978af Revert "build: switch back to the "latest" OneBranch build image (#17630)"
This reverts commit 39108a7a1b4328d88ce4fcbaf71b8b3894ecd704.
2024-07-31 18:33:05 -05:00
Dustin L. Howett
39108a7a1b
build: switch back to the "latest" OneBranch build image (#17630)
Thanks to a string of compiler bugs, we had to use an older container
image that shipped with VS 17.9.

Unfortunately, that container image is falling further and further out
of date. The build agents don't cache it any longer, so they spend 30-45
minutes of every build pulling it from the registry.

With the changes to ConPTY in #17510 removing the need for til::bitmap,
we no longer need to work around the compiler bugs it exposed.

Furthermore, 17.10.6+ has a much more robust and presumably "working"
compiler.
2024-07-31 01:26:28 +02:00
Dustin L. Howett
cbc8eed476
build: bootstrap vcpkg before nuget restore (#17592)
`nuget restore` actually runs through MSBuild! However, #15855 added a
dependency from our project on a system-installed _or locally detected_
`vcpkg.targets` (or `.props`).

Our build runs `nuget restore` before finding or installing vcpkg, so
the rules in our project file would try to import vcpkg before it had
been found (or installed).

On build agents with vcpkg installed via the VS workload, this was fine:
we would import the one that came with VS and go on our merry way. On
build agents where it needs to be installed locally, it could not be
imported.

The fix in this PR is to install/bootstrap vcpkg before running nuget.

I tried to isolate the vcpkg rules to only run _in the absence of
nuget_, but that didn't work.
2024-07-22 10:23:34 -07:00
Dustin L. Howett
3c5800f575
Move our big OSS dependencies to vcpkg (#15855)
This pull request removes the following vendored open source, in favor
of getting it from vcpkg:

- CLI11 2.4
- jsoncpp 1.9
- fmt 7.1.3
- gsl 3.1 (not vendored, but submoduled--arguably worse!)

Now that Visual Studio 2022 includes a built-in workload for vcpkg, the
onboarding process is much smoother. Terminal should only require the
vcpkg workload.

I've added some build rules that detect vcpkg via VS and via the user's
environment before falling back to a location in the source tree. The CI
pipeline will fall back to installing and bootstrapping vcpkg in
dep/vcpkg if necessary.

Some OSS has not been (and will not be) migrated:

- wyhash: ours is included directly in til/hash
- pcg_random: we have a stripped down copy compared to vcpkg
- stb_rect: vcpkg only ships *all of STB*; ours is a stripped down copy
- chromium numerics: vcpkg does not ship Chromium, especially not this
  tiny fraction of Chromium
- dynamic_bitset and libpopcnt: removing in #17510
- interval_tree: no vcpkg equivalent

To support the needs of the inbox Windows build, I've split up our vcpkg
manifest into dependencies for all projects and dependencies just for
Terminal. To support this, we now offer a `terminal` feature. The vcpkg
rules in `common.build.pre.props` are set up to turn it on, whereas the
build rules we eventually write for the OS will not be.

Most of the work is concentrated in `common.build.pre.props`.
2024-07-19 11:29:37 -07:00
Windows Console Service Bot
53841f7dd5
Localization Updates - main - 07/08/2024 20:47:05 (#17511) 2024-07-08 16:45:04 -07:00
Leonard Hecker
a2d7121489
Fix more PDP ploc related issues (#17530)
This fixes some more issues not properly covered by #17526:
* Fixed `_locComment_text` comments being effectively ignored.
* Fixed line splitting of comments (CRLF vs LF).
* Fixed BOM suppression.
* Fixed support for having multiple `{Locked=...}` comments.
2024-07-08 16:33:54 -07:00
Leonard Hecker
5bbd905ded
Fix qps-ploc generation for store translations (#17526)
* Modified `Generate-PseudoLocalizations.ps1` to find the .xml files.
  (As opposed to .resw for the other translations.)
* Added support for the new format by adding new XPath expressions,
  and stripping comments/attributes as needed.
* Fixed `PreserveWhitespace` during XML loading.
* Fixed compliance with PowerShell's strict mode.

## Validation Steps Performed
Ran it locally and compared the results. 
2024-07-08 17:26:16 -05:00
Dustin L. Howett
bc20225b08
onebranch: allow publish/package to run in :latest container (#17514)
We have to run in an older OneBranch Windows container image due to
compiler bugs.

This change prevents us from having to wait for the container image to
download for build legs that _aren't_ using the compiler.
2024-07-08 15:37:50 -05:00
Dustin L. Howett
e932d63a70
build: update the loc pipeline with the final locations of the PDPs (#17507)
This allows us to remove the dependency on the `Terminal.Internal`
repository.

I have also added some parameters to the build pipeline to ease testing.
2024-07-02 21:04:54 +00:00
Windows Console Service Bot
ee40166799
Check in all localized PDPs (#17500) 2024-07-02 12:18:35 -05:00
Dustin L. Howett
8009b53819
Check the PDPs and StoreBroker configs into the repo (#17476)
This also updates the localization pipeline to check in translations for
the PDPs.

Right now, the primary source for PDPs is the Terminal.Internal
repository. They are submitted from there, and pulled back in as though
they were destined for the internal repo. We rename them on disk prior
to loc check-in to pretend they live in this repo.

Once I submit a change request to the Touchdown team to update the paths
in their backend, I will follow up with another pull request that
updates the remaining build steps to account for that.
2024-07-01 12:23:05 -05:00
David Federman
613a539613
Add Microsoft.MSBuildCache (#17393)
Add Microsoft.MSBuildCache

This change adds a new pipeline which enables caching in the build. This
is added as a separate pipeline for now with the eventual goal of
enabling for PR and/or CI builds.

Documentation for Microsoft.MSBuildCache can be found in the GitHub
repo: https://github.com/microsoft/MSBuildCache

Preliminary numbers below.

*
[Baseline](https://dev.azure.com/ms/terminal/_build/results?buildId=579399&view=results):
12 min
* [0% Cache
hits](https://dev.azure.com/ms/terminal/_build/results?buildId=579419&view=results):
16 mins
* [100% cache
hits](https://dev.azure.com/ms/terminal/_build/results?buildId=579427&view=results):
3 mins
2024-06-20 14:02:26 -07:00
Dustin L. Howett
a80539c2f7
build: make the agent pool selection more robust (#17440) 2024-06-19 10:13:52 -05:00
Dustin L. Howett
f1079be854
ci: Remove GitHub Rich Code Nav Indexer (#17438)
It's been throwing deprecation warnings for a while, and now I can't
install the task on our new Azure Organization
2024-06-18 08:40:15 -07:00
Dustin L. Howett
523af87e34
build: add a caching copy of the CI pipeline (#17392)
This is a place for @dfederm to work, but I couldn't create the pipeline
definition without first creating the yml file _in main_. Thanks SFI.
2024-06-07 13:13:32 -05:00
Dustin L. Howett
5ce7fb7403
build: move ESRP to a parameterized subtask which takes signingId (#17216)
This centralized all our ESRP calls in one file, which will make it
easier in the future when we are invariable required to change how we
call it again.
2024-05-10 13:54:56 -07:00
Dustin L. Howett
3996806503
build: switch to TouchdownBuildTask v3, which supports a new type of auth (#17189) 2024-05-03 14:08:32 -07:00
Dustin L. Howett
2f52f27197
build: switch to ESRP v5, which supports managed identities (#17134)
This required me to push a bunch more parameters through the build
pipeline, but it gave me the opportunity to define them as variables
that can be set at queue time.
2024-05-01 20:17:49 +00:00
Dustin L. Howett
5d2d3856a7
build: force the latest VCToolsVersion; see DD-1541167 for more (#17156)
Stolen from PowerToys.

BODGY
2024-04-29 17:52:00 +00:00
Dustin L. Howett
19f43f70bd
build: disable CheckCFlags for now, as it is blowing up the build (#17116)
OneBranch no likey. A test build is running now.
2024-04-24 13:00:57 -05:00
Dustin L. Howett
3a63832c31
[REPLAY] Move to AzureFileCopy@6 for Managed Identity support (#17121)
This is required for us to move off Entra ID Application identity.

(cherry picked from commit 2e7c3fa3132fa3bff23255480c593cbd3432eee5)

This was approved in #16957, so I will merge with one signoff.
2024-04-24 12:28:02 -05:00
Dustin L. Howett
2bcbe6b492
ci/rel: publish symbols using the internal symbol request API instead (#16991)
Work is ongoing to remove individually-authenticated service accounts
from some pipelines. This moves us closer to that goal.

Tested in Nightly 2403.28002.
2024-04-02 22:52:29 +00:00
Dustin L. Howett
b0b7e50ec5 Revert "Move to AzureFileCopy@6 for Managed Identity support (#16957)"
This reverts commit 2e7c3fa3132fa3bff23255480c593cbd3432eee5.
2024-03-27 18:12:50 -05:00
Dustin L. Howett
2e7c3fa313
Move to AzureFileCopy@6 for Managed Identity support (#16957)
This is required for us to move off Entra ID Application identity.
2024-03-27 16:05:56 -07:00
Dustin L. Howett
e8f18ea92c
ci: trigger builds for gh-readonly-queue/* merge queue branches (#16941)
We may try a thing!
2024-03-26 12:55:14 -05:00
Leonard Hecker
77d5e23ef2
Make ploc translations predictable (#16924) 2024-03-25 13:42:22 -05:00
Dustin L. Howett
ff47e0c257
build: roll back to a build container with the 14.38 compiler (#16907)
The 14.39 compiler seems pretty busted.

Refs #16794
2024-03-20 15:52:53 -05:00
Dustin L. Howett
ab4b140aa4
Check the localizations into the project nightly (#16835)
Right now, the localization submission pipeline runs every night and
sends our localizable resources over to Touchdown. Later, release builds
pick up the localizations directly from Touchdown, move them into place,
and consume them.

This allowed us to avoid having localized content in the repository, but
it came with too many downsides:

- Users could not contribute additional localizations very easily
- We use the same release pipeline and Touchdown configuration for every
  branch, so strings needed to either slightly match or _entirely match_
  across an entire set of active release branches
- Building from day to day can pull in different strings, making the
  product not reproduceable
- Calling TDBuild during release builds requires network access from the
  build machine (so does restoring NuGet packages, but that's neither
  here nor there)
- Local developers and users could not test out other languages

This pull request moves all localization processing into the nightly
build phase and introduces support for checking loc in and submitting a
pull request. The pull request will not be created anew if one already
exists which has not been merged.

Anything we needed to do on release is now done overnight. This includes
moving loc files into the right places and merging the Cascadia
resources with the Context Menu resources (so that we can work around a
relatively lower amount of translations being chosen for the app versus
the context menu; see #12491 for more info.)

There are some smaller downsides to this approach and its
implementation:

- The first commit is going to be huge
- Right now, it only manages a single branch and uses a force push; if a
  PR is not reviewed timely, it will be force-pushed and you cannot see
  the day-to-day changes in the strings. Hopefully there won't be any.

I've taken great care to ensure that repeated runs of this new pipeline
will not result in unnecessary whitespace changes. This required
changing how we merge ContextMenu.resw into CascadiaPackage to always
use the .NET XmlWriter with specific flags.

NOTE that this does not allow users to _contribute_ translation fixes
for the 10 languages which we are importing. We will still need to pull
changes out of those files and submit them as bugs to the localization
team separately, and hope they come back around in another nightly
build. However, there is no reason users cannot contribute
_non-Touchdown_ languages.
2024-03-08 14:22:11 -06:00
Mike Griese
338c5047d7
Fix the velocity script to actually support canary (#16810)
Welp, would you look at that? We never actually supported "canary"
feature settings. Canary's been defaulting to the "Dev" config since
inception.

There's a couple things that are supposed to only be on in Dev and not
Canary. They clearly haven't mattered, but better safe than sorry!
2024-03-04 14:03:27 -06:00
Dustin L. Howett
30dbd3b554
Make the Settings Model tests into proper CI tests (#16773)
This pull request removes the need for the SettingsModel tests to run in
a UAP harness and puts them into the standard CI rotation.

This required some changes to `Run-Tests.ps1` to ensure that the right
`te.exe` is selected for each test harness. It's a bit annoying, but for
things that depend on a `resources.pri`, that file must be in the same
directory as the EXE that is hosting the test. Not the DLL, mind you,
the EXE. In our case, that's `TE.ProcessHost.exe`

The bulk of the change is honestly namespace tidying.

Co-authored-by: Mike Griese <migrie@microsoft.com>
Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
2024-02-29 09:00:04 -08:00
Dustin L. Howett
6b29ef51e3
build: switch to NuGetAuthenticate@1 (#16752)
It keeps warning us that v0 has been deprecated.
2024-02-23 05:34:02 -06:00
Dustin L. Howett
e3ff44bb82
build: add a tsa configuration for asyncSdl (#16728) 2024-02-18 23:22:41 -06:00
Dustin L. Howett
bcca7aac1b
build: remove symbols' dependency on the Package phase (#16625)
Due to things outside our control, sometimes the Package phase fails
when VPack publication is enabled. Because of this, symbols won't be
published. We still want these builds to be considered "golden" and we
are still shipping them, so we *must* publish symbols.
2024-01-30 15:34:27 -08:00