Skip to content

Commit 0d20f9a

Browse files
authored
Test /etc/os-release existence before grepping (#115086)
1 parent ece8571 commit 0d20f9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The .NET Foundation licenses this file to you under the MIT license.
5454
</PropertyGroup>
5555

5656
<!-- alpine's gcc toolchain needs alpine-linux, see https://github.com/llvm/llvm-project/issues/89146 -->
57-
<Exec Command="grep -q ID=alpine &quot;$(SysRoot)/etc/os-release&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(CrossCompileArch)' != '' and '$(SysRoot)' != ''">
57+
<Exec Command="test -f &quot;$(SysRoot)/etc/os-release&quot; &amp;&amp; grep -q ID=alpine &quot;$(SysRoot)/etc/os-release&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(CrossCompileArch)' != '' and '$(SysRoot)' != ''">
5858
<Output TaskParameter="ExitCode" PropertyName="_IsAlpineExitCode" />
5959
</Exec>
6060

0 commit comments

Comments
 (0)