@@ -139,6 +139,11 @@ stdenv.mkDerivation rec {
139139 ]
140140 ++ lib . optionals ( lib . versionOlder version "9" ) [
141141 ./fix-aspnetcore-portable-build.patch
142+ ]
143+ ++ lib . optionals ( lib . versionAtLeast version "10" ) [
144+ # src/repos/projects/Directory.Build.targets(106,5): error MSB4018: The "AddSourceToNuGetConfig" task failed unexpectedly.
145+ # src/repos/projects/Directory.Build.targets(106,5): error MSB4018: System.Xml.XmlException->Microsoft.Build.Framework.BuildException.GenericBuildTransferredException: There are multiple root elements. Line 9, position 2.
146+ ./source-build-externals-overwrite-rather-than-append-.patch
142147 ] ;
143148
144149 postPatch =
@@ -178,7 +183,7 @@ stdenv.mkDerivation rec {
178183 xmlstarlet ed \
179184 --inplace \
180185 -u //_:Project/_:PropertyGroup/_:BuildNumber -v 0 \
181- src/source-build-externals/src/application-insights/.props/_GlobalStaticVersion.props
186+ src/source-build-externals/src/${ lib . optionalString ( lib . versionAtLeast version "10" ) "repos/src/" } application-insights/.props/_GlobalStaticVersion.props
182187
183188 # this fixes compile errors with clang 15 (e.g. darwin)
184189 substituteInPlace \
@@ -193,53 +198,56 @@ stdenv.mkDerivation rec {
193198 -s \$prev -t elem -n KeepNativeSymbols -v false \
194199 src/runtime/Directory.Build.props
195200 ''
196- + lib . optionalString ( lib . versionAtLeast version "9" ) ''
197- # repro.csproj fails to restore due to missing freebsd packages
198- xmlstarlet ed \
199- --inplace \
200- -s //Project -t elem -n PropertyGroup \
201- -s \$prev -t elem -n RuntimeIdentifiers -v ${ targetRid } \
202- src/runtime/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
203-
204- # https://github.com/dotnet/runtime/pull/98559#issuecomment-1965338627
205- xmlstarlet ed \
206- --inplace \
207- -s //Project -t elem -n PropertyGroup \
208- -s \$prev -t elem -n NoWarn -v '$(NoWarn);CS9216' \
209- src/runtime/Directory.Build.props
201+ + lib . optionalString ( lib . versionAtLeast version "9" ) (
202+ ''
203+ # repro.csproj fails to restore due to missing freebsd packages
204+ xmlstarlet ed \
205+ --inplace \
206+ -s //Project -t elem -n PropertyGroup \
207+ -s \$prev -t elem -n RuntimeIdentifiers -v ${ targetRid } \
208+ src/runtime/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
210209
211- # patch packages installed from npm cache
212- xmlstarlet ed \
213- --inplace \
214- -s //Project -t elem -n Import \
215- -i \$prev -t attr -n Project -v " ${ ./patch-npm-packages.proj } " \
216- src/aspnetcore/eng/DotNetBuild .props
210+ # https://github.com/dotnet/runtime/pull/98559#issuecomment-1965338627
211+ xmlstarlet ed \
212+ --inplace \
213+ -s //Project -t elem -n PropertyGroup \
214+ -s \$prev -t elem -n NoWarn -v '$(NoWarn);CS9216' \
215+ src/runtime/Directory.Build .props
217216
218- # https://github.com/dotnet/source-build/issues/3131#issuecomment-2030215805
219- substituteInPlace \
220- src/aspnetcore/eng/Dependencies.props \
221- --replace-fail \
222- "'\$(DotNetBuildSourceOnly)' == 'true'" \
223- "'\$(DotNetBuildSourceOnly)' == 'true' and \$(PortableBuild) == 'false'"
217+ # https://github.com/dotnet/source-build/issues/3131#issuecomment-2030215805
218+ substituteInPlace \
219+ src/aspnetcore/eng/Dependencies.props \
220+ --replace-fail \
221+ "'\$(DotNetBuildSourceOnly)' == 'true'" \
222+ "'\$(DotNetBuildSourceOnly)' == 'true' and \$(PortableBuild) == 'false'"
224223
225- # https://github.com/dotnet/source-build/issues/4325
226- xmlstarlet ed \
227- --inplace \
228- -r '//Target[@Name="UnpackTarballs"]/Move' -v Copy \
229- eng/init-source-only.proj
224+ # https://github.com/dotnet/source-build/issues/4325
225+ xmlstarlet ed \
226+ --inplace \
227+ -r '//Target[@Name="UnpackTarballs"]/Move' -v Copy \
228+ eng/init-source-only.proj
230229
231- # error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings]
232- substituteInPlace \
233- src/runtime/src/coreclr/ilasm/CMakeLists.txt \
234- --replace-fail 'set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" )' ""
230+ # error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings]
231+ substituteInPlace \
232+ src/runtime/src/coreclr/ilasm/CMakeLists.txt \
233+ --replace-fail 'set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" )' ""
235234
236- # https://github.com/dotnet/source-build/issues/4444
237- xmlstarlet ed \
238- --inplace \
239- -s '//Project/Target/MSBuild[@Targets="Restore"]' \
240- -t attr -n Properties -v "NUGET_PACKAGES='\$(CurrentRepoSourceBuildPackageCache)'" \
241- src/aspnetcore/eng/Tools.props
242- ''
235+ # https://github.com/dotnet/source-build/issues/4444
236+ xmlstarlet ed \
237+ --inplace \
238+ -s '//Project/Target/MSBuild[@Targets="Restore"]' \
239+ -t attr -n Properties -v "NUGET_PACKAGES='\$(CurrentRepoSourceBuildPackageCache)'" \
240+ src/aspnetcore/eng/Tools.props
241+ ''
242+ + lib . optionalString ( lib . versionOlder version "10" ) ''
243+ # patch packages installed from npm cache
244+ xmlstarlet ed \
245+ --inplace \
246+ -s //Project -t elem -n Import \
247+ -i \$prev -t attr -n Project -v "${ ./patch-npm-packages.proj } " \
248+ src/aspnetcore/eng/DotNetBuild.props
249+ ''
250+ )
243251 + lib . optionalString isLinux (
244252 ''
245253 substituteInPlace \
0 commit comments