Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test m1 mac #14

Draft
wants to merge 65 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
3e86c73
Test m1 mac
krisukox Feb 16, 2023
f44abed
Fix
krisukox Feb 16, 2023
6a66387
Test
krisukox Feb 16, 2023
e52c8f6
Test
krisukox Feb 16, 2023
0461e29
Try default
krisukox Feb 16, 2023
056c372
Test
krisukox Feb 16, 2023
ced2c00
Test
krisukox Feb 16, 2023
9e78882
Try fix
krisukox Feb 16, 2023
52ff640
Test
krisukox Feb 17, 2023
706c0d5
Single branch
krisukox Feb 17, 2023
f720a7b
Test
krisukox Feb 17, 2023
b19f937
Fix
krisukox Feb 17, 2023
69118c0
Test
krisukox Feb 17, 2023
9cfc6b0
Test
krisukox Feb 17, 2023
56c9941
Test
krisukox Feb 17, 2023
a40c20f
Try 15.0.0
krisukox Feb 17, 2023
97e4ccd
Build all needed components
krisukox Feb 17, 2023
1435d95
Disable lld
krisukox Feb 17, 2023
9168f92
Try enable lld
krisukox Feb 17, 2023
22fcbb9
Build only lld
krisukox Feb 17, 2023
8205a31
Build only stage2 lld
krisukox Feb 17, 2023
96676d3
Try with clang
krisukox Feb 17, 2023
1972468
Fix
krisukox Feb 17, 2023
ea977d8
Try 15
krisukox Feb 20, 2023
0b24986
Fix
krisukox Feb 20, 2023
1fd80c2
Try older
krisukox Feb 20, 2023
274b02d
Try older
krisukox Feb 20, 2023
ca4ac5d
Try 14.0.0-rc1
krisukox Feb 20, 2023
3b942c2
Try merge base
krisukox Feb 20, 2023
0fa9c0e
Test
krisukox Feb 20, 2023
0c92502
Test
krisukox Feb 20, 2023
208c98d
Test
krisukox Feb 20, 2023
b4b3297
Test
krisukox Feb 20, 2023
22e0b84
Test
krisukox Feb 20, 2023
8cbf931
Test
krisukox Feb 20, 2023
1bdd479
Test
krisukox Feb 20, 2023
2b751cd
Test
krisukox Feb 20, 2023
027dd4e
Test
krisukox Feb 20, 2023
a919786
Test
krisukox Feb 20, 2023
0961d13
Test
krisukox Feb 20, 2023
2b01068
Try patch
krisukox Feb 20, 2023
ed2b525
Fix
krisukox Feb 20, 2023
c881964
Build all components
krisukox Feb 20, 2023
d218742
Test tar
krisukox Feb 20, 2023
7253a51
Fix
krisukox Feb 20, 2023
2b24def
Fix
krisukox Feb 21, 2023
e471201
Fix
krisukox Feb 21, 2023
dd4b391
Try shortert stage2
krisukox Feb 21, 2023
b6e73b6
Try shorter stage1
krisukox Feb 21, 2023
cf9ebcf
Fix
krisukox Feb 21, 2023
11a4df9
Build 15.0.0 without lld
krisukox Mar 2, 2023
8295e70
build 14.0.0
krisukox Mar 2, 2023
bd273a6
Make 2 stage shorter
krisukox Mar 2, 2023
e65dce1
Enable more components
krisukox Mar 2, 2023
3cc16ed
Enable runtimes
krisukox Mar 2, 2023
583a793
Disable clang-tidy
krisukox Mar 2, 2023
95d33f2
get bug fixes
jungleraptor Apr 6, 2023
ca45c05
try disabling arch flag
jungleraptor Apr 7, 2023
7b6c8df
upload build to s3
jungleraptor Apr 7, 2023
4a11a01
fix
jungleraptor Apr 7, 2023
5c19499
try again
jungleraptor Apr 7, 2023
c371266
one more time
jungleraptor Apr 7, 2023
b4b0f2a
add another clean
jungleraptor Apr 7, 2023
55b1d72
try to build clang tools
jungleraptor Apr 7, 2023
2aaa362
skip clang tidy
jungleraptor Apr 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile.llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:jammy
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for commenting on a draft, but do we need this if we're building on the macOS nodes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we don't need it. I took it from my Linux PR and forgot to remove it.


RUN apt-get update
RUN apt-get install -y \
build-essential \
clang-14 \
clang++-14 \
cmake \
libc6-dev-i386 \
python3-pip \
python3-distutils \
vim \
ninja-build \
git
85 changes: 85 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!groovy

/**
* This Jenkinsfile will only work in a Swift Navigation build/CI environment, as it uses
* non-public docker images and pipeline libraries.
*/

// Use 'ci-jenkins@somebranch' to pull shared lib from a different branch than the default.
// Default is configured in Jenkins and should be from "stable" tag.
@Library("ci-jenkins") import com.swiftnav.ci.*

def context = new Context(context: this)
context.setRepo("swift-toolchains")

/**
* - Mount the refrepo to keep git operations functional on a repo that uses ref-repo during clone
**/
String dockerMountArgs = "-v /mnt/efs/refrepo:/mnt/efs/refrepo"

pipeline {
// Override agent in each stage to make sure we don't share containers among stages.
agent any
options {
// Make sure job aborts after 2 hours if hanging.
timeout(time: 4, unit: 'HOURS')
timestamps()
// Keep builds for 7 days.
buildDiscarder(logRotator(daysToKeepStr: '7'))
}

stages {
stage('Build') {
parallel {
stage('llvm aarch64 darwin') {
agent {
node('macos-arm64')
}
steps {
sh('''
git clone https://github.com/llvm/llvm-project --branch=llvmorg-14.0.0 --single-branch
cd llvm-project

mkdir build
cd build

cmake -GNinja ../llvm \
-DCMAKE_INSTALL_PREFIX=../out/ \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_OSX_ARCHITECTURES='arm64' \
-DCMAKE_C_COMPILER=`which clang` \
-DCMAKE_CXX_COMPILER=`which clang++` \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=../out \
-DLLVM_ENABLE_PROJECTS='clang' \
-DLLVM_DISTRIBUTION_COMPONENTS='clang' \
-C ../../llvm/Apple-stage1.cmake
ninja help
ninja stage2-install-distribution
''')
uploadDistribution("clang+llvm-14.0.0-arm64-apple-darwin", context)
}
post {
cleanup {
cleanWs()
}
}
}
}
}
}
post {
always {
cleanWs()
}
}
}

def uploadDistribution(name, context) {
sh("""
mkdir -p tar/${name}/
cp -rH llvm-project/out/* tar/${name}/
""")
tar(file: "${name}.tar.gz", dir: 'tar', archive: true)
}
62 changes: 62 additions & 0 deletions llvm/Apple-stage1.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This file sets up a CMakeCache for Apple-style bootstrap builds. It can be
# used on any Darwin system to approximate Apple Clang builds.

if($ENV{DT_TOOLCHAIN_DIR})
set(CMAKE_INSTALL_PREFIX $ENV{DT_TOOLCHAIN_DIR}/usr/)
else()
set(CMAKE_INSTALL_PREFIX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.toolchain/usr/)
endif()

set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra" CACHE STRING "")

set(LLVM_TARGETS_TO_BUILD AArch64 CACHE STRING "")
set(CLANG_VENDOR Apple CACHE STRING "")
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
set(LLVM_INCLUDE_UTILS OFF CACHE BOOL "")
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "")
set(COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "")
set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
set(CLANG_SPAWN_CC1 ON CACHE BOOL "")
set(CLANG_BOOTSTRAP_PASSTHROUGH
CMAKE_OSX_ARCHITECTURES
CACHE STRING "")

# Disabling embedded darwin compiler-rt on stage1 builds is required because we
# don't build stage1 to support arm code generation.
set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")

set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")

set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")

set(CLANG_BOOTSTRAP_TARGETS
generate-order-file
check-all
check-llvm
check-clang
llvm-config
test-suite
test-depends
llvm-test-depends
clang-test-depends
distribution
install-distribution
install-xcode-toolchain
install-distribution-toolchain
clang CACHE STRING "")

#bootstrap
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
set(CLANG_BOOTSTRAP_CMAKE_ARGS
-C ${CMAKE_CURRENT_LIST_DIR}/Apple-stage2.cmake
CACHE STRING "")
6 changes: 6 additions & 0 deletions llvm/Apple-stage2-ThinLTO.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file sets up a CMakeCache for Apple-style stage2 ThinLTO bootstrap. It is
# specified by the stage1 build.


set(LLVM_ENABLE_LTO THIN CACHE BOOL "")
include(${CMAKE_CURRENT_LIST_DIR}/Apple-stage2.cmake)
46 changes: 46 additions & 0 deletions llvm/Apple-stage2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file sets up a CMakeCache for Apple-style stage2 bootstrap. It is
# specified by the stage1 build.

set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra" CACHE STRING "")
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")

set(LLVM_TARGETS_TO_BUILD AArch64 CACHE STRING "")
set(PACKAGE_VENDOR Apple CACHE STRING "")

set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")

set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")

# Generating Xcode toolchains is useful for developers wanting to build and use
# clang without installing over existing tools.
# set(LLVM_CREATE_XCODE_TOOLCHAIN ON CACHE BOOL "")

# setup toolchain
set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
set(LLVM_TOOLCHAIN_TOOLS
llvm-ar
llvm-cov
llvm-dwp
llvm-nm
llvm-objcopy
llvm-objdump
llvm-profdata
llvm-strip
llvm-symbolizer
CACHE STRING "")

set(LLVM_DISTRIBUTION_COMPONENTS
clang
clang-format
builtins
runtimes
clang-resource-headers
# clang-tidy
${LLVM_TOOLCHAIN_TOOLS}
CACHE STRING "")

# test args

set(LLVM_LIT_ARGS "--xunit-xml-output=testresults.xunit.xml -v" CACHE STRING "")
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 4904e853130825d1c6fa93faf289e1ccf2f01c68 Mon Sep 17 00:00:00 2001
From: Adrian Prantl <[email protected]>
Date: Wed, 2 Feb 2022 09:08:11 -0800
Subject: [PATCH] Add missing include diagnosed by the modules build.

---
llvm/include/llvm/Transforms/InstCombine/InstCombine.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
index 6dee38c83b36..35a3a8c3218b 100644
--- a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
+++ b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
@@ -18,6 +18,7 @@

#include "llvm/IR/Function.h"
#include "llvm/IR/PassManager.h"
+#include "llvm/Pass.h"

#define DEBUG_TYPE "instcombine"
#include "llvm/Transforms/Utils/InstructionWorklist.h"
--
2.34.1