Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
25 changes: 10 additions & 15 deletions Formula/d/dotnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

stable do
# Source-build tag announced at https://github.com/dotnet/source-build/discussions
version "9.0.8"
url "https://github.com/dotnet/dotnet/archive/refs/tags/v9.0.109.tar.gz"
sha256 "42fdfe3733884a3f6ceb3b428ff346ccb92f95010c447e27f3b164f70145730c"
version "10.0.0"
url "https://github.com/dotnet/dotnet/archive/refs/tags/v10.0.100.tar.gz"
sha256 "e190b1f43a2230a7aa31a1075bf00dcd7f4f81d8ec250c1b858f2261cc27be53"

resource "release.json" do
version "9.0.8"
url "https://github.com/dotnet/dotnet/releases/download/v9.0.109/release.json"
sha256 "328388103bf81072b638984d05b9dff5b6520a366d6448abbc7b985539deb8f4"
version "10.0.0"
url "https://github.com/dotnet/dotnet/releases/download/v10.0.100/release.json"
sha256 "b3e85fc5226c1727afca22c04f7cce920988dd2c59e0cd273c6704cee9a0e6b4"

livecheck do
formula :parent
Expand All @@ -41,7 +41,7 @@
depends_on "pkgconf" => :build
depends_on "rapidjson" => :build
depends_on "brotli"
depends_on "icu4c@77"
depends_on "icu4c@78"
depends_on "openssl@3"

uses_from_macos "python" => :build
Expand All @@ -62,7 +62,10 @@
conflicts_with cask: "dotnet-sdk"
conflicts_with cask: "dotnet-sdk@preview"

def install

Check failure on line 65 in Formula/d/dotnet.rb

View workflow job for this annotation

GitHub Actions / Linux arm64

`brew install --verbose --formula --build-bottle dotnet` failed on Linux arm64!

[ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/__/__/gc/gcconfig.cpp.o In file included from /var/tmp/dotnet-20251117-7118-zo8kgh/dotnet-10.0.100/src/runtime/src/coreclr/jit/compiler.h:29, from /var/tmp/dotnet-20251117-7118-zo8kgh/dotnet-10.0.100/src/runtime/src/coreclr/jit/jitpch.h:44, from /var/tmp/dotnet-20251117-7118-zo8kgh/dotnet-10.0.100/src/runtime/artifacts/obj/coreclr/linux.arm64.Release/jit/static/CMakeFiles/clrjit_static.dir/cmake_pch.hxx:5, from <command-line>: /var/tmp/dotnet-20251117-7118-zo8kgh/dotnet-10.0.100/src/runtime/src/coreclr/jit/gentree.h:4394:33: error: declaration of ‘ExecutionContextHandling AsyncCallInfo::ExecutionContextHandling’ changes meaning of ‘ExecutionContextHandling’ [-fpermissive] 4394 | ExecutionContextHandling ExecutionContextHandling = ExecutionContextHandling::None; | ^~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/dotnet-20251117-7118-zo8kgh/dotnet-10.0.100/src/runtime/src/coreclr/jit/gentree.h:4338:12: note: ‘ExecutionContextHandling’ declared here as ‘enum class ExecutionContextHandling’ 4338 | enum class ExecutionContextHandling | ^~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/dotnet-20251117-7118-zo8kgh/dotnet-10.0.100/src/runtime/src/coreclr/jit/gentree.h:4395:33: error: declaration of ‘ContinuationContextHandling AsyncCallInfo::ContinuationContextHandling’ changes meaning of ‘ContinuationContextHandling’ [-fpermissive] 4395 | ContinuationContextHandling ContinuationContextHandling = ContinuationContextHandling::None; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/tmp/dotnet-20251117-7118-zo8kgh/dotnet-10.0.100/src/runtime/src/coreclr/jit/gentree.h:4350:12: note: ‘ContinuationContextHandling’ declared here as ‘enum class ContinuationContextHandling’ 4350 | enum class ContinuationContextHandling | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/__/__/gc/gcbridge.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/__/__/gc/gcload.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/__/__/gc/gcconfig.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/__/__/gc/gchandletable.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/__/__/gc/gccommon.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/__/__/gc/gchandletable.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/__/__/gc/gceewks.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/__/__/gc/gccommon.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/__/__/gc/gceewks.cpp.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/__/__/gc/gcwks.cpp.o make[2]: *** [jit/static/CMakeFiles/clrjit_static.dir/build.make:80: jit/static/CMakeFiles/clrjit_static.dir/cmake_pch.hxx.gch] Error 1 make[1]: *** [CMakeFiles/Makefile2:5381: jit/static/CMakeFiles/clrjit_static.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/__/__/gc/gcwks.cpp.o [ 28%] Building ASM object vm/wks/CMakeFiles/cee_wks_core.dir/__/arm64/AllocSlow.S.o [ 28%] Building CXX object nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/__/__/gc/gcscan.cpp.o [ 28%] Building ASM object vm/wks/CMakeFiles/cee_wks_core.dir/__/arm64/asmhelpers.S.o [ 28%] Building ASM object vm/wks/CMakeFiles/cee_wks_core.dir/__/arm64/CachedInterfaceDispatchCoreCLR.S.o [ 28%] Building ASM object vm/wks/CMakeFiles/cee_wks_cor

Check warning on line 65 in Formula/d/dotnet.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

`brew install --verbose --formula --build-bottle dotnet` failed on macOS Sonoma (14)!

::error::dotnet 10.0.0 did not build

Check failure on line 65 in Formula/d/dotnet.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew install --verbose --formula --build-bottle dotnet` failed on macOS Sonoma (14) on Apple Silicon!

::error::dotnet 10.0.0 did not build

Check failure on line 65 in Formula/d/dotnet.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

`brew install --verbose --formula --build-bottle dotnet` failed on macOS Sequoia (15) on Apple Silicon!

::error::dotnet 10.0.0 did not build
# Fix `unbound variable` error if an array is empty:
# ./prep-source-build.sh: line 254: positional_args[@]: unbound variable
inreplace "prep-source-build.sh", '"${positional_args[@]}"', '"${positional_args[@]:-}"'
if OS.mac?
# Need GNU grep (Perl regexp support) to use release manifest rather than git repo
ENV.prepend_path "PATH", Formula["grep"].libexec/"gnubin"
Expand All @@ -73,14 +76,6 @@
else
icu4c_dep = deps.find { |dep| dep.name.match?(/^icu4c(@\d+)?$/) }
ENV.append_path "LD_LIBRARY_PATH", icu4c_dep.to_formula.opt_lib

# Work around build script getting stuck when running shutdown command on Linux
# TODO: Try removing in the next release
# Ref: https://github.com/dotnet/source-build/discussions/3105#discussioncomment-4373142
inreplace "build.sh", '"$CLI_ROOT/dotnet" build-server shutdown', ""
inreplace "repo-projects/Directory.Build.targets",
'"$(DotnetTool) build-server shutdown --vbcscompiler"',
'"true"'
end

args = ["--clean-while-building", "--source-build", "--with-system-libs", "brotli+libunwind+rapidjson+zlib"]
Expand Down
156 changes: 156 additions & 0 deletions Formula/d/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
class DotnetAT9 < Formula
desc ".NET Core"
homepage "https://dotnet.microsoft.com/"
url "https://github.com/dotnet/dotnet/archive/refs/tags/v9.0.111.tar.gz"
sha256 "a18cbf9a48e58a516c1da3c58f0e46f66dcf1c5e7ef028e87101b1dc246e536a"
license "MIT"

livecheck do
url :stable
regex(/^v?(9(?:\.\d+)+)$/i)
end

keg_only :versioned_formula

# https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#lifecycle
deprecate! date: "2026-11-10", because: :unsupported

depends_on "cmake" => :build
depends_on "pkgconf" => :build
depends_on "rapidjson" => :build
depends_on "brotli"
depends_on "icu4c@78"
depends_on "openssl@3"

uses_from_macos "python" => :build
uses_from_macos "krb5"
uses_from_macos "zlib"

on_macos do
depends_on "grep" => :build # grep: invalid option -- P
end

on_linux do
depends_on "libunwind"
depends_on "lttng-ust"
end

resource "release.json" do
url "https://github.com/dotnet/dotnet/releases/download/v9.0.111/release.json"
sha256 "429d63f3d9d6d10921b6e0784f3343fe7a0676b888e726b1e4a20ff2ae9bbbf5"

livecheck do
formula :parent
end
end

def install
if OS.mac?
# Need GNU grep (Perl regexp support) to use release manifest rather than git repo
ENV.prepend_path "PATH", Formula["grep"].libexec/"gnubin"

# Avoid mixing CLT and Xcode.app when building CoreCLR component which can
# cause undefined symbols, e.g. __swift_FORCE_LOAD_$_swift_Builtin_float
ENV["SDKROOT"] = MacOS.sdk_path
else
icu4c_dep = deps.find { |dep| dep.name.match?(/^icu4c(@\d+)?$/) }
ENV.append_path "LD_LIBRARY_PATH", icu4c_dep.to_formula.opt_lib

# Work around build script getting stuck when running shutdown command on Linux
# TODO: Try removing in the next release
# Ref: https://github.com/dotnet/source-build/discussions/3105#discussioncomment-4373142
inreplace "build.sh", '"$CLI_ROOT/dotnet" build-server shutdown', ""
inreplace "repo-projects/Directory.Build.targets",
'"$(DotnetTool) build-server shutdown --vbcscompiler"',
'"true"'
end

args = ["--clean-while-building", "--source-build", "--with-system-libs", "brotli+libunwind+rapidjson+zlib"]
if build.stable?
args += ["--release-manifest", "release.json"]
odie "Update release.json resource!" if resource("release.json").version != version
buildpath.install resource("release.json")
end

system "./prep-source-build.sh"
# We unset "CI" environment variable to work around aspire build failure
# error MSB4057: The target "GitInfo" does not exist in the project.
# Ref: https://github.com/Homebrew/homebrew-core/pull/154584#issuecomment-1815575483
with_env(CI: nil) do
system "./build.sh", *args
end

libexec.mkpath
tarball = buildpath.glob("artifacts/*/Release/dotnet-sdk-*.tar.gz").first
system "tar", "--extract", "--file", tarball, "--directory", libexec
doc.install libexec.glob("*.txt")
(bin/"dotnet").write_env_script libexec/"dotnet", DOTNET_ROOT: libexec

bash_completion.install "src/sdk/scripts/register-completions.bash" => "dotnet"
zsh_completion.install "src/sdk/scripts/register-completions.zsh" => "_dotnet"
man1.install Utils::Gzip.compress(*buildpath.glob("src/sdk/documentation/manpages/sdk/*.1"))
man7.install Utils::Gzip.compress(*buildpath.glob("src/sdk/documentation/manpages/sdk/*.7"))
end

def caveats
<<~CAVEATS
For other software to find dotnet you may need to set:
export DOTNET_ROOT="#{opt_libexec}"
CAVEATS
end

test do
target_framework = "net#{version.major_minor}"

(testpath/"test.cs").write <<~CS
using System;

namespace Homebrew
{
public class Dotnet
{
public static void Main(string[] args)
{
var joined = String.Join(",", args);
Console.WriteLine(joined);
}
}
}
CS

(testpath/"test.csproj").write <<~XML
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>#{target_framework}</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>Homebrew</RootNamespace>
<PackageId>Homebrew.Dotnet</PackageId>
<Title>Homebrew.Dotnet</Title>
<Product>$(AssemblyName)</Product>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="test.cs" />
</ItemGroup>
</Project>
XML

system bin/"dotnet", "build", "--framework", target_framework, "--output", testpath, testpath/"test.csproj"
output = shell_output("#{bin}/dotnet run --framework #{target_framework} #{testpath}/test.dll a b c")
# We switched to `assert_match` due to progress status ANSI codes in output.
# TODO: Switch back to `assert_equal` once fixed in release.
# Issue ref: https://github.com/dotnet/sdk/issues/44610
assert_match "#{testpath}/test.dll,a,b,c\n", output

# Test to avoid uploading broken Intel Sonoma bottle which has stack overflow on restore.
# See https://github.com/Homebrew/homebrew-core/issues/197546
resource "docfx" do
url "https://github.com/dotnet/docfx/archive/refs/tags/v2.78.3.tar.gz"
sha256 "d97142ff71bd84e200e6d121f09f57d28379a0c9d12cb58f23badad22cc5c1b7"
end
resource("docfx").stage do
system bin/"dotnet", "restore", "src/docfx", "--disable-build-servers", "--no-cache"
end
end
end
3 changes: 2 additions & 1 deletion Formula/s/statesmith.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
url "https://github.com/StateSmith/StateSmith/archive/refs/tags/cli-v0.19.0.tar.gz"
sha256 "62eb44d15a978c82f1ad8a54506f750b76c3dd30ebd1087384366a939a118749"
license "Apache-2.0"
revision 1

bottle do
sha256 cellar: :any_skip_relocation, arm64_tahoe: "f9c19f657fbff70ad690d5b0910ab9b55559514f24f76661f078799f823f1a07"
Expand All @@ -16,10 +17,10 @@
end

depends_on "dotnet"
depends_on "icu4c@77"
depends_on "icu4c@78"
uses_from_macos "zlib"

def install

Check failure on line 23 in Formula/s/statesmith.rb

View workflow job for this annotation

GitHub Actions / Linux arm64

`brew install --verbose --formula --build-bottle statesmith` failed on Linux arm64!

::error::The bottle for dotnet has an invalid build provenance attestation.%0A%0AThis may indicate that the bottle was not produced by the expected%0Atap, or was maliciously inserted into the expected tap's bottle%0Astorage.%0A%0AAdditional context:%0A%0Ano attestation matches subject: dotnet--10.0.0.arm64_linux.bottle.tar.gz%0A
dotnet = Formula["dotnet"]
args = %W[
-c Release
Expand Down
Loading