File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -355,11 +355,22 @@ private void CreatePackageListJson(IReadOnlyCollection<UniversalPackage> package
355355 }
356356 else
357357 {
358- // This isn' quite right. Really we want to use "uname -m" since that's what the artifact tool uses.
359- artifactToolArch = Environment . GetEnvironmentVariable ( "HOSTTYPE" ) ? . ToLowerInvariant ( ) ;
358+ // Use "uname -m" which is equivalent to what the Azure DevOps CLI uses to determine the artifact tool arch.
359+ artifactToolArch = null ;
360+ int unameExitCode = ProcessHelper . Execute (
361+ "/bin/bash" ,
362+ "-c \" uname -m\" " ,
363+ processStdOut : message => artifactToolArch = message ,
364+ processStdErr : message => Log . LogError ( message ) ) ;
365+ if ( unameExitCode != 0 )
366+ {
367+ Log . LogError ( $ "Detecting architecture (\" uname -m\" ) failed with exit code: { unameExitCode } .") ;
368+ return null ;
369+ }
370+
360371 if ( string . IsNullOrEmpty ( artifactToolArch ) )
361372 {
362- Log . LogError ( "Environment variable 'HOSTTYPE' was unexpectedly null " ) ;
373+ Log . LogError ( "Unable to detect architecture. \" uname -m \" did not emit any output. " ) ;
363374 return null ;
364375 }
365376 }
You can’t perform that action at this time.
0 commit comments