diff --git a/Aliases/dotnet@9 b/Aliases/dotnet@10 similarity index 100% rename from Aliases/dotnet@9 rename to Aliases/dotnet@10 diff --git a/Formula/d/dotnet.rb b/Formula/d/dotnet.rb index af793f12c546..e758ae70b5ef 100644 --- a/Formula/d/dotnet.rb +++ b/Formula/d/dotnet.rb @@ -7,14 +7,14 @@ class Dotnet < Formula 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 @@ -41,7 +41,7 @@ class Dotnet < Formula 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 @@ -63,6 +63,9 @@ class Dotnet < Formula conflicts_with cask: "dotnet-sdk@preview" def install + # 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" @@ -73,14 +76,6 @@ def install 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"] diff --git a/Formula/d/dotnet@9.rb b/Formula/d/dotnet@9.rb new file mode 100644 index 000000000000..d4517c6a5956 --- /dev/null +++ b/Formula/d/dotnet@9.rb @@ -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 + + + Exe + #{target_framework} + AnyCPU + Homebrew + Homebrew.Dotnet + Homebrew.Dotnet + $(AssemblyName) + false + + + + + + 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 diff --git a/Formula/s/statesmith.rb b/Formula/s/statesmith.rb index 47026c3737a7..3597114b1dfd 100644 --- a/Formula/s/statesmith.rb +++ b/Formula/s/statesmith.rb @@ -4,6 +4,7 @@ class Statesmith < Formula 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" @@ -16,7 +17,7 @@ class Statesmith < Formula end depends_on "dotnet" - depends_on "icu4c@77" + depends_on "icu4c@78" uses_from_macos "zlib" def install