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

Experimental QNX Support #544

Merged
merged 34 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fae1351
Experimental QNX Support
Hoverbear Apr 22, 2024
c7d186a
Fix doc alignment
Hoverbear Apr 22, 2024
12f4879
Use correct s3 path and fix targets.rs
Hoverbear Apr 25, 2024
86c0dd0
Add QNX to self-test
Hoverbear Apr 25, 2024
50c35be
Add QNX specific configure.sh settings and use instance-id again for now
Hoverbear Apr 26, 2024
bdbc706
Fix QNX compiler references
Hoverbear Apr 29, 2024
907e056
Add AWS SSM Plugin to Docker container
Hoverbear May 1, 2024
9e8251d
Add QNXLM_LICENSE_FILE var
Hoverbear May 1, 2024
6f2b6ab
Update qnx location
Hoverbear Jun 5, 2024
1be76b1
Add J flag to tar
Hoverbear Jun 6, 2024
9dc06de
Fix instance id
Hoverbear Jun 6, 2024
b4cbcf5
Bump
Hoverbear Jun 10, 2024
2b8ea3f
Improve tarball
Hoverbear Jun 10, 2024
4f0bec7
Add qcc debugging
Hoverbear Jun 11, 2024
8e208cd
Fixup QNX build flags
Hoverbear Jun 11, 2024
385fed9
Env vars need underscores, not dashes
Hoverbear Jun 13, 2024
c6f1f93
Turn off profiler on aarch64 qnx as it is broken
Hoverbear Jun 13, 2024
40d5c41
Also flag off the x86_64 profiler
Hoverbear Jun 14, 2024
5417268
Now with 100% less AWS SSM and port forwarding
Hoverbear Jun 14, 2024
a283238
Tidy up
Hoverbear Jun 14, 2024
54884b9
Document how to produce a deployment (incomplete)
Hoverbear Jun 14, 2024
d44dfe6
qnx is a yes-std target
Hoverbear Jun 17, 2024
7362098
Exclude QNX from Mac self-test (It doesn't support aarch64)
Hoverbear Jun 17, 2024
353a6a0
Install Windows deps in self-test step
Hoverbear Jun 17, 2024
8cf80bc
Expand instructions to be more correct for Windows
Hoverbear Jun 17, 2024
9d94fad
Tidy figure
Hoverbear Jun 17, 2024
ebd3fff
Reflect feedback and untar qnx verbosely to give Circle some output
Hoverbear Jun 18, 2024
cdc1e36
Add QNX targets to um
Hoverbear Jun 18, 2024
b7cc118
Further touchup
Hoverbear Jun 18, 2024
d1790da
Add more prereq docs
Hoverbear Jun 18, 2024
03449f0
Further tuning
Hoverbear Jun 18, 2024
c5a2fd5
Trim out qnx deployment
Hoverbear Jun 19, 2024
7ad1993
Fix s3 url
Hoverbear Jun 19, 2024
179f1ea
Remove Windows from self-test for now
Hoverbear Jun 20, 2024
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
23 changes: 15 additions & 8 deletions .circleci/calculate-parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@
# How long should it take before an image is rebuilt.
REBUILD_IMAGES_OLDER_THAN_DAYS = 7

# QNX targets only work on x86_64 Windows, x86_64 Linux, and x86_64 Mac
# They must be excluded on, for example, aarch64 Mac
QNX_TARGETS = [
"aarch64-unknown-nto-qnx710",
"x86_64-pc-nto-qnx710",
]

# Targets only built (and self-tested!) on Linux.
LINUX_ONLY_TARGETS = ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
# x86_64-unknown-linux-gnu builds a number of cross compilation targets
# for us and is special cased somewhat.
LINUX_BUILT_CROSS_TARGETS = [
X86_64_LINUX_BUILT_CROSS_TARGETS = [
"aarch64-unknown-none",
"thumbv7em-none-eabi",
"thumbv7em-none-eabihf",
Expand All @@ -47,15 +54,15 @@
"armv7r-none-eabihf",
"armebv7r-none-eabihf",
]
LINUX_ALL_TARGETS = LINUX_ONLY_TARGETS + LINUX_BUILT_CROSS_TARGETS
X86_64_LINUX_ALL_TARGETS = LINUX_ONLY_TARGETS + X86_64_LINUX_BUILT_CROSS_TARGETS + QNX_TARGETS

# Targets only built (and tested!) on Mac
MAC_ONLY_TARGETS = ["aarch64-apple-darwin", "x86_64-apple-darwin"]
MAC_ALL_TARGETS = MAC_ONLY_TARGETS + LINUX_BUILT_CROSS_TARGETS
AARCH64_MAC_ALL_TARGETS = MAC_ONLY_TARGETS + X86_64_LINUX_BUILT_CROSS_TARGETS

# Tagets only built (and tested!) on Windows
WINDOWS_ONLY_TARGETS = ["x86_64-pc-windows-msvc"]
WINDOWS_ALL_TARGETS = WINDOWS_ONLY_TARGETS + LINUX_BUILT_CROSS_TARGETS
X86_64_WINDOWS_ALL_TARGETS = WINDOWS_ONLY_TARGETS + X86_64_LINUX_BUILT_CROSS_TARGETS

s3 = boto3.client("s3", region_name=S3_REGION)
ecr = boto3.client("ecr", region_name=ECR_REGION)
Expand Down Expand Up @@ -158,16 +165,16 @@ def calculate_targets(host_plus_stage: str):
raise Exception(f"Host {host} not supported at this time, please add support")
elif stage == "std-only":
if host == "x86_64-unknown-linux-gnu":
targets = LINUX_ALL_TARGETS
targets = X86_64_LINUX_ALL_TARGETS
else:
raise Exception("Only the `x86_64-unknown-linux-gnu` currently runs the `std-only` stage.")
elif stage == "self-test":
if host == "x86_64-unknown-linux-gnu":
targets = LINUX_ALL_TARGETS
targets = X86_64_LINUX_ALL_TARGETS
elif host == "aarch64-apple-darwin":
targets = MAC_ALL_TARGETS
targets = AARCH64_MAC_ALL_TARGETS
elif host == "x86_64-pc-windows-msvc":
targets = WINDOWS_ALL_TARGETS
targets = X86_64_WINDOWS_ALL_TARGETS
else:
raise Exception(f"Host {host} not supported at this time, please add support")
else:
Expand Down
30 changes: 27 additions & 3 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ jobs:
./x.py --stage 2 dist rust-std
steps:
- ferrocene-job-dist:
qnx: true
restore-from-job: x86_64-linux-build

x86_64-linux-dist-src:
Expand Down Expand Up @@ -321,9 +322,10 @@ jobs:
FERROCENE_HOST: x86_64-unknown-linux-gnu
FERROCENE_TARGETS: << pipeline.parameters.targets--x86_64-unknown-linux-gnu--self-test >>
steps:
- aws-oidc-auth
- ferrocene-git-shallow-clone:
depth: 1
- aws-oidc-auth
- setup-qnx-toolchain: {}
- run:
name: Download dist artifacts and run the self-test tool
command: ferrocene/ci/scripts/run-self-test.sh
Expand Down Expand Up @@ -412,6 +414,7 @@ jobs:
depth: 1
- ferrocene-setup-darwin # Darwin does not come with awscli, setup it before aws steps
- aws-oidc-auth
- setup-qnx-toolchain: {}
- run:
name: Download dist artifacts and run the self-test tool
command: ferrocene/ci/scripts/run-self-test.sh
Expand Down Expand Up @@ -477,9 +480,10 @@ jobs:
FERROCENE_HOST: x86_64-pc-windows-msvc
FERROCENE_TARGETS: << pipeline.parameters.targets--x86_64-pc-windows-msvc--self-test >>
steps:
- aws-oidc-auth
- ferrocene-git-shallow-clone:
depth: 1
- aws-oidc-auth
- ferrocene-setup-windows
- run:
name: Download dist artifacts and run the self-test tool
command: ferrocene/ci/scripts/run-self-test.sh
Expand Down Expand Up @@ -783,6 +787,9 @@ commands:
llvm-subset:
type: boolean
default: true
qnx:
type: boolean
default: false
steps:
- ferrocene-checkout:
llvm-subset: << parameters.llvm-subset >>
Expand All @@ -803,7 +810,11 @@ commands:
- run:
name: Restore files from the << parameters.restore-from-job >> job
command: ferrocene/ci/scripts/persist-between-jobs.sh restore << parameters.restore-from-job >>

- when:
condition:
equal: [<<parameters.qnx>>, true]
steps:
- setup-qnx-toolchain: {}
- ferrocene-ci

ferrocene-job-test-container:
Expand Down Expand Up @@ -1009,6 +1020,19 @@ commands:
path: /tmp/metrics
destination: metrics

setup-qnx-toolchain:
description: Setup QNX Toolchain
steps:
- run:
name: Fetch QNX710 toolchain
command: aws s3 cp s3://ferrocene-ci-mirrors/manual/qnx/qnx710-deployment.tar.xz - | tar -v -x --zstd -f-
- run:
name: Set PATH to include QNX710 tools
command: echo 'source $(pwd)/qnx710/qnxsdp-env.sh' >> "$BASH_ENV"
- run:
name: Test qcc
command: qcc -v || true

aws-oidc-auth:
description: Authenticate with AWS using OIDC
steps:
Expand Down
15 changes: 15 additions & 0 deletions ferrocene/ci/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,21 @@ if [[ is_internal && "${FERROCENE_BUILD_HOST:-}" = "x86_64-pc-windows-msvc" ]];
add --set target.wasm32-unknown-unknown.ar=lld-ar
fi

if [[ is_internal ]]; then
# QNX toolchains aren't automatically inferred, set them explicitly.
#
# Assumes `qnxsdp-env.sh` has been sourced or the binaries are otherwise
# already on path
add --set target.aarch64-unknown-nto-qnx710.cc=qcc
add --set target.aarch64-unknown-nto-qnx710.cxx=q++
add --set target.aarch64-unknown-nto-qnx710.ar=ntoaarch64-ar
add --set target.aarch64-unknown-nto-qnx710.profiler=false # Build failures were noted if this is enabled.
add --set target.x86_64-pc-nto-qnx710.cc=qcc
add --set target.x86_64-pc-nto-qnx710.cxx=q++
add --set target.x86_64-pc-nto-qnx710.ar=ntox86_64-ar
add --set target.x86_64-pc-nto-qnx710.profiler=false # Build failures were noted if this is enabled.
fi

# Set the host platform to build. The environment variable is set from the CI
# configuration (see the .circleci directory).
#
Expand Down
2 changes: 2 additions & 0 deletions ferrocene/ci/docker-images/ubuntu-20/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ ENV CC_aarch64_unknown_ferrocenecoretest=aarch64-linux-gnu-gcc
ENV CXX_aarch64_unknown_ferrocenecoretest=aarch64-linux-gnu-g++
ENV CC_armv8r_none_eabihf=arm-none-eabi-gcc
ENV CXX_armv8r_none_eabihf=arm-none-eabi-g++
ENV CFLAGS_aarch64_unknown_nto_qnx710=-Vgcc_ntoaarch64le_cxx
ENV CFLAGS_x86_64_pc_nto_qnx710=-Vgcc_ntox86_64_cxx

# Automatic CFLAGs do not work for some targets.
ENV CFLAGS_armv8r_none_eabihf="-march=armv8-r -mfpu=fp-armv8"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ferrocene/doc/internal-procedures/src/figures/qnx.png.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-License-Identifier: MIT OR Apache-2.0
SPDX-FileCopyrightText: The Ferrocene Developers
1 change: 1 addition & 0 deletions ferrocene/doc/internal-procedures/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ based on software engineering best practices.
:caption: Partnerships

partners/oxidos
partners/qnx

.. appendices::
:caption: Appendices
Expand Down
Loading
Loading