Skip to content

Conversation

@echesakov
Copy link
Contributor

No description provided.

@echesakov
Copy link
Contributor Author

echesakov commented Sep 17, 2020

@dotnet/jit-contrib PTAL

For some reason macOS Azure DevOps hosted pool is super-slow today, so I don't expect the macOS job to succeed. (It was working fine yesterday and the day before).

I will open a meta-issue to track down the remaining work, but this PR should a major un-blocker - the binaries are built for all target platforms and all the host platforms that .NET Core supports.

@echesakov echesakov mentioned this pull request Sep 17, 2020
29 tasks
Copy link
Contributor

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I only had minor suggestions for improving the scripts (which I realized after writing the comments would probably only be invoked by the YML, not manually, but still...)

@@ -0,0 +1,66 @@
@echo off
setlocal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's useful to use: setlocal EnableDelayedExpansion EnableExtensions

@@ -0,0 +1,66 @@
@echo off
setlocal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to see a usage message at the top, which can double as the documentation for what the script does. E.g.,:

@echo off
setlocal

goto start
:usage
echo Usage: build-coredistools.cmd ^<TargetOSArchitecture^>
echo where ^<TargetOSArchitecture^> is one of: windows-arm, windows-arm64, windows-x64, windows-x86.
goto :eof

:start
set RootDirectory=%~dp0
set SourcesDirectory=%RootDirectory%src
set BinariesDirectory=%RootDirectory%obj
set TargetOSArchitecture=%1

if /i "%TargetOSArchitecture%" == "windows-arm" (
    set GeneratorPlatform=ARM
) else if /i "%TargetOSArchitecture%" == "windows-arm64" (
    set GeneratorPlatform=ARM64
) else if /i "%TargetOSArchitecture%" == "windows-x64" (
    set GeneratorPlatform=x64
) else if /i "%TargetOSArchitecture%" == "windows-x86" (
    set GeneratorPlatform=Win32
) else (
    echo "Unknown target OS and architecture: %TargetOSArchitecture%"
    goto usage ///********
)

set BinariesDirectory=%RootDirectory%obj
set TargetOSArchitecture=%1

if /i "%TargetOSArchitecture%" == "windows-arm" (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this default to using PROCESSOR_ARCHITECTURE?

-DLLVM_TABLEGEN="%LLVMTableGen%" ^
-DLLVM_TARGETS_TO_BUILD=AArch64;ARM;X86 ^
-DLLVM_TOOL_COREDISTOOLS_BUILD=ON ^
"%SourcesDirectory%\llvm-project\llvm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should check the ERRORLEVEL return for all 3 cmake invocations, not just one.

;;

*)
echo "Unknown target OS and architecture: $TargetOSArchitecture"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A similar comment applies here about it being useful to have a "help" / usage comment and, if necessary and separate, a "what does this script do" header comment.


pushd "%BinariesDirectory%"

cmake.exe ^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check all the cmake exit codes?

@@ -0,0 +1,45 @@
@echo off
setlocal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a "what does this script do?" header comment?

You could also have:

if not "%1"=="" echo Error: no arguments expected&goto :eof

@echesakov
Copy link
Contributor Author

Thanks @BruceForstall for code review! I will have a follow-up PR when I address some of the issues with Arm32 I am working on and all of your suggestions here.

However, I would like to have a working build pipeline at the moment when I open that PR, so I am merging these changes.

@echesakov echesakov merged commit c0b8a85 into master Sep 18, 2020
@echesakov echesakov deleted the dev/coredistools branch September 18, 2020 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants