Fix bunch of small blockers for stage3-sysroot

This commit is contained in:
Sameer Rahmani 2023-05-08 18:01:34 +01:00
parent 1820e1f46a
commit 2e1c5f6dd1
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
8 changed files with 42 additions and 13 deletions

3
.gitignore vendored
View File

@ -17,4 +17,5 @@ build
packages/stage1-sysroot/sysroot/ packages/stage1-sysroot/sysroot/
packages/stage2-sysroot/sysroot/ packages/stage2-sysroot/sysroot/
packages/stage3-sysroot/sysroot/ packages/stage3-sysroot/sysroot/
*.zstd *.zstd
tests/1/main

16
builder
View File

@ -37,8 +37,8 @@ set -e
command=$1 command=$1
VERSION="0.9.0" VERSION="0.9.0"
LLVM_VERSION="0e0db0a4d7fd606ee58595f997142f7f2476cbe6" LLVM_VERSION="da3cd333bea572fb10470f610a27f22bcb84b08c"
LLVM_MAJOR_VERSION="17" LLVM_MAJOR_VERSION="16"
CMAKE_VERSION="3.26.0" CMAKE_VERSION="3.26.0"
NINJA_VERSION="1.11.1" NINJA_VERSION="1.11.1"
ZLIB_VERSION="1.2.13" ZLIB_VERSION="1.2.13"
@ -46,6 +46,7 @@ ZSTD_VERSION="1.5.4"
KERNEL_VERSION="6.0" KERNEL_VERSION="6.0"
MUSL_VERSION="1.2.3" MUSL_VERSION="1.2.3"
IWYU_VERSION="14e9b208914a84fcdf49bf9f5d08897a4b3dc4b8" IWYU_VERSION="14e9b208914a84fcdf49bf9f5d08897a4b3dc4b8"
BOEHMGC_VERSION="8.2.2"
TARGET=x86_64-pc-linux-musl TARGET=x86_64-pc-linux-musl
@ -58,7 +59,8 @@ export LLVM_VERSION \
LLVM_MAJOR_VERSION \ LLVM_MAJOR_VERSION \
MUSL_VERSION \ MUSL_VERSION \
TARGET \ TARGET \
IWYU_VERSION IWYU_VERSION \
BOEHMGC_VERSION
ME=$(cd "$(dirname "$0")/." >/dev/null 2>&1 ; pwd -P) ME=$(cd "$(dirname "$0")/." >/dev/null 2>&1 ; pwd -P)
@ -212,6 +214,14 @@ function build-toolchain() { ## Build the entire thing
build-tarball build-tarball
} }
function test-container() { ## Run an alpine container to test the toolchain in the .tmp dir
# Make sure to run the build-stage3 first so the .tmp/2/stage3-sysroot/ exist
docker run --rm -it -v "$ME/.tmp/2/stage3-sysroot/":/sysroot \
-v "$ME/tests/":/tests \
alpine:latest /bin/sh
}
function help() { ## Print out this help message function help() { ## Print out this help message
echo "Commands:" echo "Commands:"
grep -E '^function [a-zA-Z0-9_-]+\(\) \{ ## .*$$' "$0" | \ grep -E '^function [a-zA-Z0-9_-]+\(\) \{ ## .*$$' "$0" | \

View File

@ -62,15 +62,20 @@ def copy_tree(src, dst, preserve_symlinks=True, ignore=None):
if skip_this: if skip_this:
continue continue
if item.is_dir(): if item.is_dir():
shutil.copytree( copy_tree(
item, item,
dst / item.name, dst / item.name,
dirs_exist_ok=True, preserve_symlinks,
symlinks=preserve_symlinks, ignore,
copy_function=shutil.copy2,
) )
elif item.is_file() or item.is_symlink: elif item.is_file() or item.is_symlink:
shutil.copy2(item, dst / item.name, follow_symlinks=not preserve_symlinks) try:
shutil.copy2(
item, dst / item.name, follow_symlinks=not preserve_symlinks
)
except Exception as e:
if not item.is_symlink:
raise e
def with_static_flags(cmake_vars={}): def with_static_flags(cmake_vars={}):

View File

@ -28,7 +28,7 @@ from conf.utils import get_version, with_musl_toolchain, copy_dependency_tree
class BoehmGC(ConanFile): class BoehmGC(ConanFile):
name = "boehmgc" name = "boehmgc"
settings = "os", "arch", "build_type", "compiler" settings = "os", "arch", "build_type", "compiler"
version = "8.2.2" version = get_version("boehmgc")
options = { options = {
"stage": [1, 2], "stage": [1, 2],
} }

View File

@ -21,7 +21,7 @@ from conan import ConanFile
from conan.tools.files import get from conan.tools.files import get
from conan.tools.cmake import CMakeToolchain from conan.tools.cmake import CMakeToolchain
from conf.utils import get_version, copy_template, copy_tree, copy_dependency_tree from conf.utils import get_version, copy_template, copy_dependency_tree
class Stage3(ConanFile): class Stage3(ConanFile):
@ -40,11 +40,20 @@ class Stage3(ConanFile):
self.requires(f"zlib/{get_version('zlib')}@{self.user}/{self.channel}") self.requires(f"zlib/{get_version('zlib')}@{self.user}/{self.channel}")
self.requires(f"zstd/{get_version('zstd')}@{self.user}/{self.channel}") self.requires(f"zstd/{get_version('zstd')}@{self.user}/{self.channel}")
self.requires(f"musl/{get_version('musl')}@{self.user}/{self.channel}") self.requires(f"musl/{get_version('musl')}@{self.user}/{self.channel}")
# self.requires(f"cmake-musl/{get_version('cmake')}@{self.user}/{self.channel}")
# self.requires(f"ninja-musl/{get_version('ninja')}@{self.user}/{self.channel}")
self.requires(f"boehmgc/{get_version('boehmgc')}@{self.user}/{self.channel}")
def build(self): def build(self):
copy_dependency_tree( copy_dependency_tree(
self, self,
["toolchain", "musl", "zlib", "zstd"], [
"toolchain",
"musl",
"zlib",
"zstd",
"boehmgc",
],
self.package_folder, self.package_folder,
) )

View File

@ -17,7 +17,9 @@ set(CMAKE_SYSTEM_NAME Linux)
set(triple @TRIPLE@) set(triple @TRIPLE@)
set(CMAKE_SYSROOT @SYSROOT@) # You need to set SERENE_TOOLCHAIN_PATH before pointing to this toolchain
# file
set(CMAKE_SYSROOT ${SERENE_TOOLCHAIN_PATH})
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_C_COMPILER "clang") set(CMAKE_C_COMPILER "clang")

View File

@ -71,6 +71,7 @@ class Zlib(ZlibBase):
"BUILD_SHARED_LIBS": False, "BUILD_SHARED_LIBS": False,
"CMAKE_POSITION_INDEPENDENT_CODE": "ON", "CMAKE_POSITION_INDEPENDENT_CODE": "ON",
"CMAKE_SYSROOT": sysroot, "CMAKE_SYSROOT": sysroot,
"CMAKE_FIND_ROOT_PATH": sysroot,
}, },
build_script_folder=f"zlib-{self.version}", build_script_folder=f"zlib-{self.version}",
) )

View File

@ -77,6 +77,7 @@ class Zstd(ZstdBase):
"ZSTD_BUILD_SHARED": False, "ZSTD_BUILD_SHARED": False,
"CMAKE_POSITION_INDEPENDENT_CODE": "ON", "CMAKE_POSITION_INDEPENDENT_CODE": "ON",
"CMAKE_SYSROOT": sysroot, "CMAKE_SYSROOT": sysroot,
"CMAKE_FIND_ROOT_PATH": sysroot,
}, },
build_script_folder=f"zstd-{self.version}/build/cmake/", build_script_folder=f"zstd-{self.version}/build/cmake/",
) )