Repository navigation
Update outdated steps in macOS build documentation - #28413
Usama (PSEUDO) (pseudo-usama) wants to merge 1 commit into
Conversation
- 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`
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
@microsoft-github-policy-service agree |
brunnodev (brunnojob)
left a comment
There was a problem hiding this comment.
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.
| ### 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; |
There was a problem hiding this comment.
ulimit -n default is 2560 in all supported versions of macOS, so removing this instructions is correct
There was a problem hiding this comment.
There is a typo in the PR description though 256 -> 2560
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Are you sure about this? ulimit -n reports 2560 in Terminal.app.
There was a problem hiding this comment.
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 unlimitedNothing 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.
|
/azp run |
|
Commenter does not have sufficient privileges for PR 28413 in repo PowerShell/PowerShell |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
PR Summary
Update the outdated steps in
docs/building/macos.mdso they match the current build module and toolchain.Fix #21005
.NET Core 2.x/macOS 10.13+note with a link to the macOS versions supported by .NETpwsh.exe->pwsh-Scenarioparameter toStart-PSBootstrap, since it is now mandatory.DotNetis enough on macOS, because thePackagescenario only adds Linux/Windows packaging toolsStart-PSBootstrapdoes: it installswgetandopensslwithbrew/portand installs the SDK version fromglobal.jsonto~/.dotnet. It no longer uninstalls previous .NET versions (that only happens withInstall-Dotnet -RemovePreviousVersion)net6.0/osx-x64tonet11.0/osx-arm64, and mentionosx-x64for Intel MacsPR 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:osx-arm64tarballImport-Module ./build.psm1; Start-PSBootstrap -Scenario DotNetinstalledwgetvia Homebrew and .NET SDK 11.0.100 to~/.dotnetulimit -n 256(whatlaunchctl limit maxfilesand a new Terminal.app window report on this Mac; other Macs report 2560, so this covers the lower value), thenStart-PSBuild -UseNuGetOrgbuilt successfully with no "too many open files" errors./src/powershell-unix/bin/Debug/net11.0/osx-arm64/publish/pwshand ran fineI also ran
markdownlint(with the repo's.markdownlint.json),textlint --rule terminologyandmarkdown-link-checkon the file. All of them passed.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header