Skip to content

Update CFS and other OneBranch tooling#1422

Merged
SteveL-MSFT merged 12 commits intoPowerShell:mainfrom
andyleejordan:fix-cfs
Mar 10, 2026
Merged

Update CFS and other OneBranch tooling#1422
SteveL-MSFT merged 12 commits intoPowerShell:mainfrom
andyleejordan:fix-cfs

Conversation

@andyleejordan
Copy link
Member

@andyleejordan andyleejordan commented Mar 5, 2026

In the course of debugging why we couldn't so much as cargo install tree-sitter-cli I discovered a number of issues resolved in this PR.

For the msrustup toolchain, ms-stable stopped being supported in 2024, meaning under the covers we've just been using ms-prod-1.88. I've updated the OneBranch pipelines to specifically use ms-prod-1.93. The OneBranch documentation recommends a specific pin, and not e.g. ms-prod. They also recommend using a rust-toolchain.toml file, but that gets a bit in the way of our existing logic which detects and uses msrustup only when available.

I've switched us from the mscodehub CFS feed to a new dedicated DSCCargoMirror CFS feed in msazure. By not being cross-org, we don't have to deal with complicated authentication with a service connection, and can just rely on the CargoAuthenticate task. I know of no compelling reason to stick to the mscodehub feed when we can eliminate a lot of headache here.

If and when as a dev you cannot update the feed, there is a very hidden button titled "Allow externally-sourced versions" available only after going to the feed and searching the upstream sources for a package. I've found it sometimes just gets turned off, which then prevents us from adding packages to the feed, and this will appear as an authentication failure. Authenticating locally with either artifacts-cargo-credprovider or msrustup does indeed work, but that setting must be toggled on.

I removed ob_restore_phase: true as that was an old workaround for accessing network resources that were not allow-listed, and it messed up the timing of the tasks. Seems like it was put there because we were errantly adding a second checkout: self task (it's an additional since the OneBranch template already does that). With that gone, ordering is fine and signing and CodeQL is happy.

We also weren't passing through -UseX64MakeAppx when we migrated the MSIX build function, and that needs to happen for one of the OneBranch builds.

@andyleejordan andyleejordan marked this pull request as ready for review March 6, 2026 05:19
@andyleejordan
Copy link
Member Author

andyleejordan commented Mar 6, 2026

Watching the OneBranch run, it failed on Windows only at the signing step due to the internal service timing out, so I think this is at least good to go for review.

Edit: found the reason for that, and for the previously added ob_restore_phase workaround. For some reason we had checkout: self on the Windows build, while the OneBranch template already does that. So we were checking out twice which trips up signing and CodeQL validation steps.

@andyleejordan
Copy link
Member Author

Last thing is symbols and uh, fixing the path highlighted that this wasn't working in the first place. Went back and looked at a "successful" build...

Linux

Source indexing is not supported on this OS.
Found 0 files.

macOS -- N/A

Windows

Found 0 files.
##[warning]No files selected for indexing.

@andyleejordan
Copy link
Member Author

Assigning reviewers now as that's a green build. I still don't think the Windows symbols are source mapped but that's a different investigation.

@andyleejordan
Copy link
Member Author

By the way this is a follow-up to #1410 as I needed the OneBranch pipeline to work again so I could get the MSIX, RPM, and DEB packages and verify them.

@andyleejordan
Copy link
Member Author

Nope, one more thing to fix. MSIX bundle is getting created under debug.

@andyleejordan
Copy link
Member Author

Bingo, MSIX bundle now exists too.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repo’s build/packaging and OneBranch pipeline configuration to use a pinned msrustup toolchain and a new Azure Artifacts Cargo mirror, simplifying authentication and fixing MSIX packaging behavior.

Changes:

  • Pin Rust toolchain to ms-prod-1.93 across scripts and OneBranch RustInstaller usage.
  • Switch Cargo source replacement to the DSCCargoMirror feed and use CargoAuthenticate@0 in pipelines (removing Azure CLI token plumbing / restore-phase workarounds).
  • Pass through -UseX64MakeAppx for MSIX builds and adjust MSIX bundle output pathing; include dsc-bicep-ext in the RPM file list.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packaging/rpm/dsc.spec Adds /usr/bin/dsc-bicep-ext to the RPM %files list to match the installed symlink.
packaging.ps1 Removes -UseCFSAuth flow and pins msrustup channel to ms-prod-1.93.
helpers.build.psm1 Pins msrustup channel, adds -UseX64MakeAppx plumbing for MSIX, and adjusts MSIX bundle output location.
build.ps1 Removes -UseCFSAuth usage and passes UseX64MakeAppx through to packaging.
.pipelines/DSC-Windows.yml Uses ms-prod-1.93 and CargoAuthenticate, removes token parameter and restore-phase/task ordering workarounds, and updates paths.
.pipelines/DSC-Official.yml Updates official pipeline jobs to use CargoAuthenticate and pinned toolchain; removes AzureCLI token acquisition and related variables.
.github/instructions/instructions.md Removes -UseCFSAuth from documented build parameters.
.cargo/config.toml Switches crates.io replacement to the DSCCargoMirror feed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 2164 to 2170
$buildParams = @{
BuildData = $BuildData
ArtifactDirectory = $artifactDirectory
Architecture = $Architecture
Release = $Release
UseX64MakeAppx = $UseX64MakeAppx
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

Build-DscPackage now adds UseX64MakeAppx into the splatted @buildParams hashtable, but Build-DscZipPackage and Build-DscTgzPackage don't accept that parameter. This will throw a runtime error when packaging zip or tgz. Consider only adding UseX64MakeAppx to the parameter set when calling Build-DscMsixPackage, or filter/remove the key before splatting into the other packaging functions.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@andyleejordan since this param is only used for MSIX, yo ucould just move it to line 2180

The crux of our problems was the cross-org feed permissions.
The version ms-stable stopped being supported in 2024 so we've been on an old toolchain.
Which removes the need to do complicated authentication.
The OneBranch template automatically checks out the repo,
doing it again is what messed up CodeQL and signing.
It never worked on Linux in the first place, so disable that.
On Windows it needs to be where we built,
not where we're packaging the MSIX
(and so have lost our sources and symbols).
We were assuming this was bin root (like in the old package script).
And update PSDesiredStateConfiguration to 2.0.8.

This feed is already dedicated to mirroring the PSGallery.
Importantly, it does not have NuGet.org as an upstream since doing so can cause package name conflicts.
While it is cross-org, we are not depending on automated write-access and it is purposely publicly-readable.
Comment on lines 2164 to 2170
$buildParams = @{
BuildData = $BuildData
ArtifactDirectory = $artifactDirectory
Architecture = $Architecture
Release = $Release
UseX64MakeAppx = $UseX64MakeAppx
}
Copy link
Member

Choose a reason for hiding this comment

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

@andyleejordan since this param is only used for MSIX, yo ucould just move it to line 2180

@andyleejordan
Copy link
Member Author

@SteveL-MSFT that change is applied, it's low risk but I'll still kick off a pipeline to test as that's the only way to verify it. Also opened #1425

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Mar 10, 2026
Merged via the queue into PowerShell:main with commit 01ed342 Mar 10, 2026
19 checks passed
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.

3 participants