[Bug 289022] lang/dotnet: build fails, "MSBuild server failed to shut down"

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 23 Aug 2025 23:14:23 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289022

            Bug ID: 289022
           Summary: lang/dotnet: build fails, "MSBuild server failed to
                    shut down"
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: arrowd@FreeBSD.org
          Reporter: bob@vesterman.com
          Assignee: arrowd@FreeBSD.org
             Flags: maintainer-feedback?(arrowd@FreeBSD.org)

For a while now (a week? two? not sure exactly) my nightly ports build has been
failing for lang/dotnet (specifically; lang/dotnet-host builds just fine). I
don't know enough of the details of the build process to say for sure, but it
*seems* like it might be more of an incidental failure rather than a "real"
failure: The build log makes a lot of noises that sure make it seem like it has
essentially completed successfully, but then dies while trying to clean up
after itself:

=============================

===>  Building for dotnet-9.0.6
cd /construction/xports/lang/dotnet/work/dotnet-9.0.6 && /usr/bin/env
OPENSSLBASE=/usr OPENSSLDIR=/etc/ssl OPENSSLINC=/usr/include
OPENSSLLIB=/usr/lib XDG_DATA_HOME=/construction/xports/lang/dotnet/work 
XDG_CONFIG_HOME=/construction/xports/lang/dotnet/work 
XDG_CACHE_HOME=/construction/xports/lang/dotnet/work/.cache 
HOME=/construction/xports/lang/dotnet/work TMPDIR="/tmp"
PATH=/usr/local/libexec/ccache:/construction/xports/lang/dotnet/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
PKG_CONFIG_LIBDIR=/construction/xports/lang/dotnet/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig
MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES
DEFAULT_AUTOCONF=2.72 PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc"
CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp"
CPPFLAGS=""  LDFLAGS=" -Wl,-rpath,/usr/local/lib:/usr/lib  " LIBS=""  CXX="c++"
CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "
CCACHE_DIR="/ccache" BSD_INSTALL_PROGRAM="install  -s -m 555" 
BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555" 
BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444"
PYTHON=/usr/local/bin/python3.11 ./build.sh  --release-manifest release.json 
--clean-while-building  --with-sdk
/construction/xports/lang/dotnet/work/bootstrap_sdk  --with-packages
/construction/xports/lang/dotnet/work/packages  --source-build  -- 
-maxcpucount:4
Using custom bootstrap SDK from
'/construction/xports/lang/dotnet/work/bootstrap_sdk', version '9.0.103'
Found bootstrap versions: SDK 9.0.103, Arcade 9.0.0-beta.25065.2, NoTargets
3.7.0 and Traversal 3.4.0

Welcome to .NET 9.0!
---------------------
SDK Version: 9.0.103

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, run 'dotnet dev-certs https --trust'
Learn about HTTPS: https://aka.ms/dotnet-https

----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit:
https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Shutting down MSBuild server...
Shutting down VB/C# compiler server...
MSBuild server failed to shut down: sysctl 1 failed with 3 error.
VB/C# compiler server shut down successfully.
*** Error code 1

Stop.
make: stopped in /xports/lang/dotnet

=============================

Now, I should mention that this or at least something very, very like this has
occasionally happened to me for a LONG time now; I think pretty much ever since
the port was first published. But this is different:

In the past, the next time the build ran (no matter whether via my automated
nightly builds or manually), it would work just fine (at least the vast
majority of the time). I always just attributed it (without any additional
evidence) to the idea that the amount of time it waits for the server to shut
down is not *quite* long enough for it to be 100% reliable.

But now, it always fails. Or, at the very least, I haven't ever seen it
succeed, in a lot of attempts.

-- 
You are receiving this mail because:
You are the assignee for the bug.