Skip to content

runtime build fails with CS9368 (RequiresUnsafeAttribute is only valid under the updated memory safety rules) #5527

@DonnaChen888

Description

@DonnaChen888

Repro Pipeline:
20260323.13

Repro Branch:
main

Error Message:
##[error]repo-projects/Directory.Build.targets(600,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/runtime/build.sh --restore --build --pack --publish --sourceBuild --fromVMR --ci --configuration Release --verbosity minimal /p:TargetRid=centos.10-x64 /p:OfficialBuildId=20260323.113 /p:DotNetPackageVersionPropsPath=/__w/1/s/artifacts/obj/PackageVersions/PackageVersions.runtime.props /p:SourceBuiltAssetsDir=/__w/1/s/artifacts/assets/Release/ /p:SourceBuiltAssetManifestsDir=/__w/1/s/artifacts/obj/manifests/Release/runtime/ /p:RepositoryName=runtime /p:RepositoryUrl=https://github.com/dotnet/dotnet /p:PreviouslySourceBuiltNupkgCacheDir="/__w/_temp/previously-source-built-artifacts/" /p:ReferencePackageNupkgCacheDir="/__w/1/s/prereqs/packages/reference/" /p:TrackPrebuiltUsageReportDir="/__w/1/s/artifacts/log/Release/runtime/" /p:SourceBuiltShippingPackagesDir=/__w/1/s/artifacts/packages/Release/Shipping/runtime/ /p:SourceBuiltNonShippingPackagesDir=/__w/1/s/artifacts/packages/Release/NonShipping/runtime/ /p:SourceBuiltPdbArtifactsDir=/__w/1/s/artifacts/SymStore/Release/runtime/ /p:SourceBuiltArtifactsBasePath=/__w/1/s/ /p:UsingToolMicrosoftNetCompilers=false /p:PortableBuild=false /p:PortableTargetRid=linux-x64 /p:RepoOriginalSourceRevisionId=162722d0c4a242b6f8a183efbe4904a1f6b6d95e -bl --arch x64 --os linux --bootstrap /p:DotNetBuildAllRuntimePacks=true > /__w/1/s/artifacts/log/Release/runtime/runtime.log 2>&1" exited with code 1.
/__w/1/s/repo-projects/Directory.Build.targets(600,5): error MSB3073: The command "/__w/1/s/src/runtime/build.sh --restore --build --pack --publish --sourceBuild --fromVMR --ci --configuration Release --verbosity minimal /p:TargetRid=centos.10-x64 /p:OfficialBuildId=20260323.113 /p:DotNetPackageVersionPropsPath=/__w/1/s/artifacts/obj/PackageVersions/PackageVersions.runtime.props /p:SourceBuiltAssetsDir=/__w/1/s/artifacts/assets/Release/ /p:SourceBuiltAssetManifestsDir=/__w/1/s/artifacts/obj/manifests/Release/runtime/ /p:RepositoryName=runtime /p:RepositoryUrl=https://github.com/dotnet/dotnet /p:PreviouslySourceBuiltNupkgCacheDir="/__w/_temp/previously-source-built-artifacts/" /p:ReferencePackageNupkgCacheDir="/__w/1/s/prereqs/packages/reference/" /p:TrackPrebuiltUsageReportDir="/__w/1/s/artifacts/log/Release/runtime/" /p:SourceBuiltShippingPackagesDir=/__w/1/s/artifacts/packages/Release/Shipping/runtime/ /p:SourceBuiltNonShippingPackagesDir=/__w/1/s/artifacts/packages/Release/NonShipping/runtime/ /p:SourceBuiltPdbArtifactsDir=/__w/1/s/artifacts/SymStore/Release/runtime/ /p:SourceBuiltArtifactsBasePath=/__w/1/s/ /p:UsingToolMicrosoftNetCompilers=false /p:PortableBuild=false /p:PortableTargetRid=linux-x64 /p:RepoOriginalSourceRevisionId=162722d0c4a242b6f8a183efbe4904a1f6b6d95e -bl --arch x64 --os linux --bootstrap /p:DotNetBuildAllRuntimePacks=true > /__w/1/s/artifacts/log/Release/runtime/runtime.log 2>&1" exited with code 1. [/__w/1/s/repo-projects/runtime.proj]
Time Elapsed 00:01:52.52
e.CoreLib.csproj]
rivate.CoreLib/src/System/IO/UnmanagedMemoryStream.cs(154,10): error CS9368: RequiresUnsafeAttribute is only valid under the updated memory safety rules. [/__w/1/s/src/runtime/src/coreclr/nativeaot/System.Private.facts.Log;isSecret=false;isOutput=true]/__w/1/s/src/runtime/artifacts/log/Release
Build failed with exit code 1. Check errors above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ops-monitorIssues created/handled by the source build monitor roleuntriaged

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions