mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-06-08 10:54:55 +08:00
build system simplifications (#2359)
* buidl system simplifications * less j * fix that
This commit is contained in:
14
.github/workflows/test.yaml
vendored
14
.github/workflows/test.yaml
vendored
@@ -23,12 +23,10 @@ jobs:
|
||||
- run: ./setup.sh
|
||||
- name: Test python package installer
|
||||
run: ${{ env.RUN }} "pip install --break-system-packages .[dev]"
|
||||
- name: Build panda images and bootstub
|
||||
run: ${{ env.RUN }} "scons -j4"
|
||||
- name: Build with UBSan
|
||||
run: ${{ env.RUN }} "scons -j4 --ubsan"
|
||||
- name: Build panda in release mode
|
||||
run: ${{ env.RUN }} "CERT=certs/debug RELEASE=1 scons -j4"
|
||||
- name: Build debug FW
|
||||
run: ${{ env.RUN }} "scons"
|
||||
- name: Build release FW
|
||||
run: ${{ env.RUN }} "CERT=certs/debug RELEASE=1 scons"
|
||||
|
||||
test:
|
||||
name: ./test.sh
|
||||
@@ -65,8 +63,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: ./setup.sh
|
||||
- name: Build FW
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: Run MISRA C:2012 analysis
|
||||
run: ${{ env.RUN }} "cd tests/misra && ./test_misra.sh"
|
||||
|
||||
@@ -77,7 +73,5 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: ./setup.sh
|
||||
- name: Build FW
|
||||
run: ${{ env.RUN }} "scons -j$(nproc)"
|
||||
- name: MISRA mutation tests
|
||||
run: ${{ env.RUN }} "cd tests/misra && pytest test_mutation.py"
|
||||
|
||||
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -6,7 +6,7 @@ def docker_run(String step_label, int timeout_mins, String cmd) {
|
||||
--volume /var/run/dbus:/var/run/dbus \
|
||||
--net host \
|
||||
${env.DOCKER_IMAGE_TAG} \
|
||||
bash -c 'scons -j8 && ${cmd}'", \
|
||||
bash -c 'scons && ${cmd}'", \
|
||||
label: step_label
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ pipeline {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("panda-cuatro", [
|
||||
["build", "scons -j4"],
|
||||
["build", "scons"],
|
||||
["flash", "cd scripts/ && ./reflash_internal_panda.py"],
|
||||
["flash jungle", "cd board/jungle && ./flash.py --all"],
|
||||
["test", "cd tests/hitl && pytest --durations=0 2*.py [5-9]*.py"],
|
||||
@@ -123,7 +123,7 @@ pipeline {
|
||||
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
||||
steps {
|
||||
phone_steps("panda-tres", [
|
||||
["build", "scons -j4"],
|
||||
["build", "scons"],
|
||||
["flash", "cd scripts/ && ./reflash_internal_panda.py"],
|
||||
["flash jungle", "cd board/jungle && ./flash.py --all"],
|
||||
["test", "cd tests/hitl && pytest --durations=0 2*.py [5-9]*.py"],
|
||||
|
||||
@@ -163,5 +163,4 @@ build_project("panda_jungle_h7", base_project_h7, "./board/jungle/main.c", flags
|
||||
build_project("body_h7", base_project_h7, "./board/body/main.c", ["-DPANDA_BODY"])
|
||||
|
||||
# test files
|
||||
if GetOption('extras'):
|
||||
SConscript('tests/libpanda/SConscript')
|
||||
SConscript('tests/libpanda/SConscript')
|
||||
|
||||
12
SConstruct
12
SConstruct
@@ -1,18 +1,12 @@
|
||||
AddOption('--minimal',
|
||||
action='store_false',
|
||||
dest='extras',
|
||||
default=True,
|
||||
help='the minimum build. no tests, tools, etc.')
|
||||
|
||||
AddOption('--ubsan',
|
||||
action='store_true',
|
||||
help='turn on UBSan')
|
||||
import os
|
||||
|
||||
env = Environment(
|
||||
COMPILATIONDB_USE_ABSPATH=True,
|
||||
tools=["default", "compilation_db"],
|
||||
)
|
||||
|
||||
SetOption('num_jobs', max(1, int((os.cpu_count() or 1)-1)))
|
||||
|
||||
env.CompilationDatabase("compile_commands.json")
|
||||
|
||||
# panda fw & test files
|
||||
|
||||
2
test.sh
2
test.sh
@@ -8,7 +8,7 @@ cd $DIR
|
||||
source ./setup.sh
|
||||
|
||||
# *** build ***
|
||||
scons -j8
|
||||
scons
|
||||
|
||||
# *** lint ***
|
||||
ruff check .
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
import opendbc
|
||||
import platform
|
||||
|
||||
CC = 'gcc'
|
||||
system = platform.system()
|
||||
mac_ver = platform.mac_ver()
|
||||
|
||||
# gcc installed by homebrew has version suffix (e.g. gcc-12) in order to be
|
||||
# distinguishable from system one - which acts as a symlink to clang
|
||||
# clang works on macOS 15 and greater but has issues on earlier macOS versions.
|
||||
# see: https://github.com/commaai/openpilot/issues/35093
|
||||
if system == 'Darwin' and mac_ver[0] and mac_ver[0] < '15':
|
||||
CC += '-13'
|
||||
|
||||
env = Environment(
|
||||
CC=CC,
|
||||
CFLAGS=[
|
||||
'-nostdlib',
|
||||
'-fno-builtin',
|
||||
@@ -23,16 +10,6 @@ env = Environment(
|
||||
],
|
||||
CPPPATH=[".", "../../", "../../board/", opendbc.INCLUDE_PATH],
|
||||
)
|
||||
if system == "Darwin":
|
||||
env.PrependENVPath('PATH', '/opt/homebrew/bin')
|
||||
|
||||
if GetOption('ubsan'):
|
||||
flags = [
|
||||
"-fsanitize=undefined",
|
||||
"-fno-sanitize-recover=undefined",
|
||||
]
|
||||
env['CFLAGS'] += flags
|
||||
env['LINKFLAGS'] += flags
|
||||
|
||||
panda = env.SharedObject("panda.os", "panda.c")
|
||||
libpanda = env.SharedLibrary("libpanda.so", [panda])
|
||||
|
||||
@@ -24,7 +24,7 @@ fi
|
||||
|
||||
cd $PANDA_DIR
|
||||
if [ -z "${SKIP_BUILD}" ]; then
|
||||
scons -j8
|
||||
scons
|
||||
fi
|
||||
|
||||
CHECKLIST=$DIR/checkers.txt
|
||||
|
||||
Reference in New Issue
Block a user