Skip to content

Commit

Permalink
change TARGET_ARCHITECTURE to EPICS_TARGET_ARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Mar 18, 2024
1 parent 7b2fb9d commit 9728e8f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"target": "developer",
"args": {
// Native target development settings ==============================
"TARGET_ARCHITECTURE": "linux-x86_64",
"EPICS_TARGET_ARCH": "linux-x86_64",
"BASE_IMAGE": "ubuntu:22.04"
// Local cross compilation settings ================================
// "TARGET_ARCHITECTURE": "RTEMS-beatnik",
// "EPICS_TARGET_ARCH": "RTEMS-beatnik",
// "BASE_IMAGE": "ghcr.io/epics-containers/rtems-beatnik-runtime"
}
},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
platforms: ${{ matrix.platform }}
target: ${{ matrix.target }}
build-args: |
TARGET_ARCHITECTURE=${{ matrix.epics-target }}
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
BASE_IMAGE=${{ matrix.base_image }}
cache-from: type=gha,scope=${{ matrix.epics-target }}
Expand All @@ -81,7 +81,7 @@ jobs:
platforms: ${{ matrix.platform }}
target: developer
build-args: |
TARGET_ARCHITECTURE=${{ matrix.epics-target }}
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
BASE_IMAGE=${{ matrix.base_image }}
tags: ${{ env.TAG }}-developer:${{ github.ref_name }}
Expand All @@ -95,7 +95,7 @@ jobs:
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
TARGET_ARCHITECTURE=${{ matrix.epics-target }}
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
BASE_IMAGE=${{ matrix.base_image }}
tags: ${{ env.TAG }}-runtime:${{ github.ref_name }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# EPICS 7 Base Dockerfile

# build args
# TARGET_ARCHITECTURE: the epics cross compile target platform
# EPICS_TARGET_ARCH: the epics cross compile target platform
# note that linux-x86_64 is shortened to linux and is the default
# EPICS_HOST_ARCH: the epics host architecture name
# BASE_IMAGE: can be used to bring in cross compilation tools
Expand All @@ -11,10 +11,10 @@ ARG BASE_IMAGE=ubuntu:22.04
##### shared environment stage #################################################
FROM ${BASE_IMAGE} AS environment

ARG TARGET_ARCHITECTURE=linux-x86_64
ARG EPICS_TARGET_ARCH=linux-x86_64
ARG EPICS_HOST_ARCH=linux-x86_64

ENV TARGET_ARCHITECTURE=${TARGET_ARCHITECTURE}
ENV EPICS_TARGET_ARCH=${EPICS_TARGET_ARCH}
ENV EPICS_HOST_ARCH=${EPICS_HOST_ARCH}
ENV EPICS_ROOT=/epics
ENV EPICS_BASE=${EPICS_ROOT}/epics-base
Expand Down
6 changes: 3 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

set -e

# set TARGET_ARCHITECTURE to rtems for RTEMS based targets
T_A=${TARGET_ARCHITECTURE:-linux_x86_64}
# set EPICS_TARGET_ARCH to rtems for RTEMS based targets
T_A=${EPICS_TARGET_ARCH:-linux_x86_64}
# set TARGET to runtime for runtime images
TARGET=${TARGET:-developer}
# set TAG to override the default tag
Expand All @@ -31,7 +31,7 @@ if [ ! -d ibek-support ] ; then git submodule update --init ; fi
# build and developer images
set -x
$docker build $buildx -t ${TAG} "${@}" $load \
--build-arg TARGET_ARCHITECTURE=$T_A \
--build-arg EPICS_TARGET_ARCH=$T_A \
--build-arg BASE_IMAGE=$base \
--target $TARGET .

2 changes: 1 addition & 1 deletion epics/scripts/get-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# get the version of epics-base indicated by the environment unless we
# are building for RTEMS6 which is temporarily in a forked version

if [[ ${TARGET_ARCHITECTURE} == "RTEMS-beatnik" ]] ; then
if [[ ${EPICS_TARGET_ARCH} == "RTEMS-beatnik" ]] ; then
git clone https://github.com/kiwichris/epics-base.git \
--branch rtems-legacy-net-support -q \
--recursive ${EPICS_BASE}
Expand Down
8 changes: 4 additions & 4 deletions epics/scripts/patch-epics-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ sed -i -E 's/(^[^#].*+= test.*$)/# \1/' \
/epics/epics-base/Makefile \
/epics/epics-base/modules/*/Makefile

if [[ $TARGET_ARCHITECTURE == "RTEMS-beatnik" ]]; then
if [[ $EPICS_TARGET_ARCH == "RTEMS-beatnik" ]]; then
echo "Configuring epics-base to build RTEMS beatnik"

cp ${THIS_DIR}/rtems/CONFIG_SITE.local ${EPICS_BASE}/configure/CONFIG_SITE.local
elif [[ $TARGET_ARCHITECTURE != "linux-x86_64" ]]; then
echo "Configuring epics-base for target ${TARGET_ARCHITECTURE}"
elif [[ $EPICS_TARGET_ARCH != "linux-x86_64" ]]; then
echo "Configuring epics-base for target ${EPICS_TARGET_ARCH}"

touch ${EPICS_BASE}/configure/CONFIG_SITE.local
echo CROSS_COMPILER_TARGET_ARCHS=${TARGET_ARCHITECTURE} >> \
echo CROSS_COMPILER_TARGET_ARCHS=${EPICS_TARGET_ARCH} >> \
${EPICS_BASE}/configure/CONFIG_SITE.local
fi

0 comments on commit 9728e8f

Please sign in to comment.