mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 08:55:42 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8af547085d |
@@ -3,14 +3,14 @@ name: Build Linux Sysroot
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
create_release:
|
||||
description: 'Create a GitHub release with the sysroot'
|
||||
version:
|
||||
description: 'Sysroot version (e.g., v2, v3)'
|
||||
required: true
|
||||
default: 'true'
|
||||
type: boolean
|
||||
default: 'v2'
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-sysroot:
|
||||
@@ -28,23 +28,36 @@ jobs:
|
||||
name: ubuntu-noble-sysroot
|
||||
path: tools/sysroot/output/
|
||||
|
||||
- name: Create Release
|
||||
if: ${{ inputs.create_release }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: sysroot-noble-v1
|
||||
name: Ubuntu 24.04 Noble Sysroot
|
||||
body: |
|
||||
Ubuntu 24.04 (Noble) sysroot for cross-compilation from macOS to Linux.
|
||||
- name: Install AWS CLI
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y awscli
|
||||
|
||||
Contains:
|
||||
- libstdc++-13 (C++23 support)
|
||||
- libc6-dev
|
||||
- linux-libc-dev
|
||||
- zlib1g-dev
|
||||
- libssl-dev
|
||||
- name: Upload to DigitalOcean Spaces
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_KEY }}
|
||||
run: |
|
||||
# Upload sysroot tarball to DO Spaces
|
||||
aws s3 cp tools/sysroot/output/ubuntu_noble_amd64_sysroot.tar.xz \
|
||||
s3://eagle0/sysroot/${{ inputs.version }}/ubuntu_noble_amd64_sysroot.tar.xz \
|
||||
--endpoint-url https://sfo3.digitaloceanspaces.com \
|
||||
--acl public-read
|
||||
|
||||
Use with toolchains_llvm sysroot rule.
|
||||
files: |
|
||||
tools/sysroot/output/ubuntu_noble_amd64_sysroot.tar.xz
|
||||
tools/sysroot/output/ubuntu_noble_amd64_sysroot.sha256
|
||||
# Upload sha256 file
|
||||
aws s3 cp tools/sysroot/output/ubuntu_noble_amd64_sysroot.sha256 \
|
||||
s3://eagle0/sysroot/${{ inputs.version }}/ubuntu_noble_amd64_sysroot.sha256 \
|
||||
--endpoint-url https://sfo3.digitaloceanspaces.com \
|
||||
--acl public-read
|
||||
|
||||
echo ""
|
||||
echo "=== Sysroot uploaded ==="
|
||||
echo "URL: https://eagle0.sfo3.digitaloceanspaces.com/sysroot/${{ inputs.version }}/ubuntu_noble_amd64_sysroot.tar.xz"
|
||||
echo "SHA256: $(cat tools/sysroot/output/ubuntu_noble_amd64_sysroot.sha256)"
|
||||
echo ""
|
||||
echo "Update MODULE.bazel with:"
|
||||
echo "sysroot("
|
||||
echo " name = \"linux_sysroot\","
|
||||
echo " sha256 = \"$(cat tools/sysroot/output/ubuntu_noble_amd64_sysroot.sha256)\","
|
||||
echo " urls = [\"https://eagle0.sfo3.digitaloceanspaces.com/sysroot/${{ inputs.version }}/ubuntu_noble_amd64_sysroot.tar.xz\"],"
|
||||
echo ")"
|
||||
|
||||
+4
-3
@@ -68,12 +68,13 @@ use_repo(llvm, "llvm_toolchain", "llvm_toolchain_linux")
|
||||
|
||||
# Download the Linux sysroot (Ubuntu 24.04 Noble for C++23 support)
|
||||
# Built by: .github/workflows/build_sysroot.yml
|
||||
# To rebuild: Run the "Build Linux Sysroot" workflow and update sha256
|
||||
# To rebuild: Run the "Build Linux Sysroot" workflow with a new version, then update sha256 and URL
|
||||
sysroot = use_repo_rule("@toolchains_llvm//toolchain:sysroot.bzl", "sysroot")
|
||||
sysroot(
|
||||
name = "linux_sysroot",
|
||||
sha256 = "3812d376beba78a301eb64dfe2ad01d5896500826054ebb6aa4e00607fa0e347",
|
||||
urls = ["https://github.com/nolen777/eagle0/releases/download/sysroot-noble-v1/ubuntu_noble_amd64_sysroot.tar.xz"],
|
||||
# TODO: Update sha256 after running sysroot build workflow with version v2
|
||||
sha256 = "PLACEHOLDER_RUN_SYSROOT_WORKFLOW_FIRST",
|
||||
urls = ["https://eagle0.sfo3.digitaloceanspaces.com/sysroot/v2/ubuntu_noble_amd64_sysroot.tar.xz"],
|
||||
)
|
||||
|
||||
#
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#
|
||||
# This creates a minimal sysroot containing headers and libraries needed
|
||||
# to cross-compile C++ code targeting Linux x86_64.
|
||||
#
|
||||
# Key requirement: Clang needs to find GCC's installation to locate libstdc++
|
||||
# headers. It looks for /usr/lib/gcc/<triple>/<version>/ in the sysroot.
|
||||
|
||||
FROM ubuntu:24.04
|
||||
|
||||
@@ -10,6 +13,9 @@ FROM ubuntu:24.04
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# C++ standard library with C++23 support (GCC 13)
|
||||
libstdc++-13-dev \
|
||||
# GCC 13 (needed for Clang to find C++ headers via GCC detection)
|
||||
gcc-13 \
|
||||
g++-13 \
|
||||
# C library
|
||||
libc6-dev \
|
||||
# Linux kernel headers
|
||||
@@ -20,11 +26,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# Clean up
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create a script to extract the sysroot
|
||||
# Create sysroot directory
|
||||
RUN mkdir -p /sysroot
|
||||
|
||||
# Copy the essential directories for cross-compilation
|
||||
# Note: We preserve the exact directory structure that clang expects
|
||||
RUN cp -a /usr/include /sysroot/ && \
|
||||
cp -a /usr/lib/x86_64-linux-gnu /sysroot/usr_lib && \
|
||||
mkdir -p /sysroot/lib && \
|
||||
cp -a /lib/x86_64-linux-gnu /sysroot/lib/
|
||||
cp -a /lib/x86_64-linux-gnu /sysroot/lib/ && \
|
||||
# Copy GCC installation directory - Clang uses this to find libstdc++ headers
|
||||
mkdir -p /sysroot/usr/lib/gcc && \
|
||||
cp -a /usr/lib/gcc/x86_64-linux-gnu /sysroot/usr/lib/gcc/
|
||||
|
||||
@@ -39,6 +39,10 @@ docker cp "${CONTAINER_ID}:/sysroot/include" "${SYSROOT_DIR}/usr/"
|
||||
docker cp "${CONTAINER_ID}:/sysroot/usr_lib" "${SYSROOT_DIR}/usr/lib/x86_64-linux-gnu"
|
||||
docker cp "${CONTAINER_ID}:/sysroot/lib/x86_64-linux-gnu" "${SYSROOT_DIR}/lib/"
|
||||
|
||||
# Copy GCC installation directory - Clang uses this to find libstdc++ headers
|
||||
# The path /usr/lib/gcc/x86_64-linux-gnu/13 is where clang looks for GCC
|
||||
docker cp "${CONTAINER_ID}:/sysroot/usr/lib/gcc" "${SYSROOT_DIR}/usr/lib/"
|
||||
|
||||
# Also need lib64 symlink for some builds
|
||||
ln -sf lib "${SYSROOT_DIR}/lib64"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user