Skip to content

Update outdated steps in macOS build documentation - #28413

Open
Usama (PSEUDO) (pseudo-usama) wants to merge 1 commit into
PowerShell:masterfrom
pseudo-usama:update-macos-build-doc
Open

Usama (PSEUDO) (pseudo-usama) wants to merge 1 commit into
PowerShell:masterfrom
pseudo-usama:update-macos-build-doc

Conversation

@pseudo-usama

@pseudo-usama Usama (PSEUDO) (pseudo-usama) commented Nov 13, 2026 •

Copy link
Copy Markdown

PR Summary

Update the outdated steps in docs/building/macos.md so they match the current build module and toolchain.

Fix #21005

  • Replace the .NET Core 2.x / macOS 10.13+ note with a link to the macOS versions supported by .NET
  • pwsh.exe -> pwsh
  • Add the -Scenario parameter to Start-PSBootstrap, since it is now mandatory. DotNet is enough on macOS, because the Package scenario only adds Linux/Windows packaging tools
  • Update the list of what Start-PSBootstrap does: it installs wget and openssl with brew/port and installs the SDK version from global.json to ~/.dotnet. It no longer uninstalls previous .NET versions (that only happens with Install-Dotnet -RemovePreviousVersion)
  • Remove the "Too many open files" section about a NuGet bug from 2016 (dotnet/cli#809)
  • Update the output path from net6.0/osx-x64 to net11.0/osx-arm64, and mention osx-x64 for Intel Macs

PR Context

The macOS build doc still described the .NET Core 2.x era. I followed it on an Apple silicon Mac (macOS 27.2) with a fresh clone of master:

  1. Installed PowerShell 7.7.0 from the osx-arm64 tarball
  2. Import-Module ./build.psm1; Start-PSBootstrap -Scenario DotNet installed wget via Homebrew and .NET SDK 11.0.100 to ~/.dotnet
  3. ulimit -n 256 (what launchctl limit maxfiles and a new Terminal.app window report on this Mac; other Macs report 2560, so this covers the lower value), then Start-PSBuild -UseNuGetOrg built successfully with no "too many open files" errors
  4. The output was at ./src/powershell-unix/bin/Debug/net11.0/osx-arm64/publish/pwsh and ran fine

I also ran markdownlint (with the repo's .markdownlint.json), textlint --rule terminology and markdown-link-check on the file. All of them passed.

PR Checklist

- Replace the outdated .NET Core 2.x / macOS 10.13+ note with a link to the supported macOS versions for .NET
- Use `pwsh` instead of `pwsh.exe` and pass the now mandatory `-Scenario DotNet` to `Start-PSBootstrap`
- Describe what `Start-PSBootstrap` currently does (it no longer uninstalls prior .NET versions)
- Remove the "Too many open files" workaround for a 2016 NuGet bug; the build succeeds with the default limit of 256
- Update the output path to `net11.0` and `osx-arm64`/`osx-x64`
Copilot AI balanced review requested due to automatic review settings November 13, 2026 17:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@pseudo-usama

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@brunnojob brunnodev (brunnojob) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The update removes two stale instructions that can block new macOS contributors: it uses Start-PSBootstrap -Scenario DotNet and points SDK selection to global.json, while removing the obsolete NuGet ulimit workaround. The arm64 publish path and Intel variant are now explicit. I did not run a macOS build in this review, so maintainer verification on both architectures remains useful.

Comment thread docs/building/macos.md
### error: Too many open files

Due to a [bug][809] in NuGet, the `dotnet restore` command will fail without the limit increased.
Run `ulimit -n 2048` to fix this in your session;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ulimit -n default is 2560 in all supported versions of macOS, so removing this instructions is correct

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a typo in the PR description though 256 -> 2560

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for checking! The 256 is intentional, not a typo. On my Mac (macOS 27.2.1), launchctl limit maxfiles reports a soft limit of 256, and a new Terminal.app window also gets ulimit -n = 256. Some terminal apps start shells with a higher limit, like the 2560 you're seeing. I ran the build at 256 on purpose to cover the lowest default, and it passed, so it works at 2560 too.

I've updated the PR description to say where the 256 comes from.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you sure about this? ulimit -n reports 2560 in Terminal.app.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I checked again in a new Terminal.app window just now:

$ sw_vers -productVersion
27.2.1
$ ulimit -n
256
$ ulimit -Hn
unlimited
$ launchctl limit maxfiles
	maxfiles    256            unlimited

Nothing on this Mac changes the limit: there's no ulimit in my shell startup files and no launchd plist that sets maxfiles. So the default seems to differ between Macs, 2560 on yours and 256 on mine.

Either way, the build passed at 256, so removing the section is right for both. I've reworded the PR description so it doesn't claim 256 is the default everywhere.

@pseudo-usama

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 28413 in repo PowerShell/PowerShell

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Review - Needed The PR is being reviewed label Nov 23, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update doc for building on MacOS

4 participants