Skip to content
Snippets Groups Projects
Commit 7c074c1f authored by Constantin Christmann's avatar Constantin Christmann
Browse files

Upload of initial contribution from Vector.

parent 6403a38a
No related branches found
No related tags found
No related merge requests found
Showing
with 741 additions and 0 deletions
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
CommentPragmas: '^ (IWYU pragma:|VECTOR |VCA[_ ]|FETA[_ ]|COV_)|\\(trace|copydoc)[ ]+[^ ]'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
---
Checks: >
-*,
clang-diagnostic-*,
clang-analyzer-*,
vector-*,
readability-*,
bugprone-*,
modernize-*,
performance-*,
cert-*,
cppcoreguidelines-*,
hicpp-*,
portability-*,
-readability-uppercase-literal-suffix,
-cert-dcl16-c,
-hicpp-uppercase-literal-suffix,
-readability-named-parameter,
-hicpp-named-parameter,
-readability-redundant-member-init,
-readability-make-member-function-const,
FormatStyle: file
# warnings are NOT treated as errors
WarningsAsErrors: ""
# analyze all included headers (not system-headers)
HeaderFilterRegex: ".*"
CheckOptions:
########## readability-identifier-naming #########
# Class, structs, enums and unions
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase } # redundant with ClassCase
- { key: readability-identifier-naming.UnionCase, value: CamelCase }
# Functions and methods (all are treated equally, only FunctionCase needed)
- { key: readability-identifier-naming.FunctionCase, value: CamelCase }
# Non-static and static non-const variables and pointers
- { key: readability-identifier-naming.VariableCase, value: lower_case }
# static, global or constexpr constant variables
- { key: readability-identifier-naming.StaticConstantCase, value: CamelCase }
- { key: readability-identifier-naming.StaticConstantPrefix, value: k }
- { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase }
- { key: readability-identifier-naming.GlobalConstantPrefix, value: k }
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
- { key: readability-identifier-naming.ConstexprVariablePrefix, value: k }
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
- { key: readability-identifier-naming.EnumConstantPrefix, value: k }
# Class / Struct data members (including static members)
- { key: readability-identifier-naming.MemberCase, value: lower_case }
- { key: readability-identifier-naming.MemberSuffix, value: _ }
- { key: readability-identifier-naming.ClassMemberCase, value: lower_case }
- { key: readability-identifier-naming.ClassMemberSuffix, value: _ }
- { key: readability-identifier-naming.PublicMemberCase, value: lower_case } # public members dont require trailing _
# Parameters
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
# Templates
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.ValueTemplateParameterCase, value: aNy_CasE } # not clearly specified
# Miscellaneous
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
- { key: readability-identifier-naming.MacroDefinitionIgnoredRegexp, value: .*_H_ }
- { key: readability-identifier-naming.TypeAliasCase, value: CamelCase }
- { key: readability-identifier-naming.TypedefCase, value: CamelCase }
########## End of readability-identifier-naming ##########
- { key: vector-noexcept-special-functions.FunctionsToInclude, value: "Swap" }
- { key: hicpp-move-const-arg.CheckTriviallyCopyableMove, value: false }
- { key: performance-move-const-arg.CheckTriviallyCopyableMove, value: false }
...
ARG USER="eclipse"
ARG PDM_VERSION="2.22.4"
ARG CONAN_VERSION="2.13.0"
FROM ubuntu:24.04 AS vaf-base
ARG TZ="Europe/Berlin"
ARG USER
ARG CONAN_VERSION
ARG PDM_VERSION
ENV LC_ALL="C.UTF-8" \
LANG="C.UTF-8"
# Install common APT packages
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
ccache \
clangd \
cmake \
g++-12 \
gdb \
git \
pipx \
python3-pip \
python3.12 \
python3.12-venv \
rake \
sudo \
nano \
vim \
emacs \
ssh \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/* \
&& rm -rf /var/log/*
# Comment out and adapt the lines below to add SSL certificates if needed:
# ADD url-to-your-certificate-one /usr/local/share/ca-certificates/your-certificates-folder
# ADD url-to-your-certificate-two /usr/local/share/ca-certificates/your-certificates-folder
# RUN update-ca-certificates /usr/local/share/ca-certificates/
# ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# Build & install SilKit
RUN mkdir -p /tmp/silkit \
&& git clone -j4 https://github.com/vectorgrp/sil-kit.git /tmp/silkit \
&& git -C /tmp/silkit checkout tags/v4.0.55 \
&& git -C /tmp/silkit submodule update --init --recursive \
&& mkdir /tmp/silkit/build \
&& cmake -DSILKIT_BUILD_DEMOS=OFF -DSILKIT_BUILD_TESTS=OFF -DSILKIT_BUILD_DASHBOARD=OFF -DSILKIT_BUILD_STATIC=ON \
-S /tmp/silkit -B /tmp/silkit/build \
&& cmake --build /tmp/silkit/build --target install --parallel 12 \
# Workaround for broken installation when building statically linked libraries
&& cp /tmp/silkit/build/ThirdParty/_tp_spdlog/libspdlog.a /usr/local/lib/ \
&& cp /tmp/silkit/build/ThirdParty/_tp_yaml-cpp/libyaml-cpp.a /usr/local/lib/ \
&& cp /tmp/silkit/build/Release/libSilKit.a /usr/local/lib/ \
&& rm -rf /tmp/silkit
# Create working directory and add user
RUN mkdir -p /workspaces \
# Create a default user
&& userdel -r ubuntu \
&& useradd -m -s /bin/bash -u 1000 ${USER} --groups sudo \
# Allow usage of sudo without password
&& echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER}_all \
&& chown -R ${USER}:${USER} /workspaces
USER ${USER}
# Install common python dependencies
RUN pip3 install conan==${CONAN_VERSION} --break-system-packages \
&& pipx ensurepath \
&& pipx install pdm==${PDM_VERSION} \
&& pipx install pre-commit \
&& rm -rf /home/${USER}/.cache/*
# Pre-build conan packages
RUN --mount=type=bind,source=SwLibraries/vaf_core_library,target=/tmp/vafcpp/src,readwrite \
--mount=type=bind,source=Container/conan,target=/tmp/conan,readwrite \
--mount=type=bind,source=version.txt,target=/tmp/version.txt \
sudo chown -R 1000:1000 /tmp/vafcpp /tmp/conan \
&& export PATH="$PATH:/home/${USER}/.local/bin" \
&& cd /tmp/vafcpp/src \
&& conan create . --profile:all=./test_package/gcc12__x86_64-pc-linux-elf -s build_type=Release \
&& conan create . --profile:all=./test_package/gcc12__x86_64-pc-linux-elf -s build_type=Debug \
&& conan install /tmp/conan -pr:a=/tmp/conan/gcc12__x86_64-pc-linux-elf --build=missing \
&& conan install /tmp/conan -pr:a=/tmp/conan/gcc12__x86_64-pc-linux-elf --build=missing -s build_type=Debug \
&& conan cache clean
WORKDIR /workspaces
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/cpp
{
"name": "VAF",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"runArgs": [
"--sysctl=net.ipv6.conf.all.disable_ipv6=0"
],
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"[cpp]": {
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"editor.formatOnSave": true,
"json.format.keepLines": true,
"cmake.configureOnEdit": true,
"cmake.configureOnOpen": false,
"C_Cpp.intelliSenseEngine": "disabled",
"ruff.exclude": [
".pdm-build"
],
"ruff.nativeServer": true
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"charliermarsh.ruff",
"llvm-vs-code-extensions.vscode-clangd",
"eamodio.gitlens",
"ms-python.python",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"SanaAjani.taskrunnercode",
"tamasfe.even-better-toml",
"twxs.cmake",
"yzhang.markdown-all-in-one"
]
}
},
"containerEnv": {
"NODE_EXTRA_CA_CERTS": "/etc/ssl/certs/ca-certificates.crt",
"REQUESTS_CA_BUNDLE": "/etc/ssl/certs/ca-certificates.crt"
},
// Adjust the user in the Dockerfile if you're changing it here. Otherwise the prebuilt conan packages are unavailable.
// "remoteUser": "eclipse",
"mounts": [
// Uncomment the line below to mount your SSH keys into the container.
"source=${localEnv:HOME}/.ssh,target=/home/eclipse/.ssh,type=bind,consistency=cached",
// Uncomment the line below to mount your local SSL certificates into the container.
"source=/etc/ssl/certs/ca-certificates.crt,target=/etc/ssl/certs/ca-certificates.crt,type=bind,consistency=cached",
"source=vaf_bashhistory,target=/commandhistory,type=volume"
],
"postCreateCommand": "sudo chown -R eclipse /commandhistory && echo \"export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history\" >> \"/home/eclipse/.bashrc\"",
"postStartCommand": "pre-commit install",
"capAdd": [
"NET_ADMIN",
"NET_RAW"
]
}
\ No newline at end of file
.tmp/
*.bkp
.cache
build
.rake_tasks~
.pdm-python
_vafinstall
vafinstall.tar.gz
public
VAF/.python-version
**/__pycache__/
repos:
- repo: local
hooks:
- id: vaf-commit-hook-format
name: VAF - make format
entry: ./.pre-commit-hooks/perform-format.sh
language: script
pass_filenames: false
verbose: true
- id: vaf-commit-hook-lint
name: VAF - make lint
entry: ./.pre-commit-hooks/perform-lint.sh
language: script
pass_filenames: false
verbose: true
- id: vaf-commit-hook-test
name: VAF - make test
entry: ./.pre-commit-hooks/perform-test.sh
language: script
pass_filenames: false
verbose: true
- id: vaf-commit-hook-build
name: VAF - make build
entry: ./.pre-commit-hooks/perform-build.sh
language: script
pass_filenames: false
verbose: true
#!/bin/bash
CURRENT_DIR=$(pwd)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd $SCRIPT_DIR/../VAF
make build
cd $CURRENT_DIR
#!/bin/bash
CURRENT_DIR=$(pwd)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd $SCRIPT_DIR/../VAF
make format
cd $CURRENT_DIR
#!/bin/bash
CURRENT_DIR=$(pwd)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd $SCRIPT_DIR/../VAF
make lint
cd $CURRENT_DIR
#!/bin/bash
CURRENT_DIR=$(pwd)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd $SCRIPT_DIR/../VAF
make test PYTEST_FLAGS="--runslow"
cd $CURRENT_DIR
#!/bin/bash
#
# Search Makefiles recursively in a directory named VAF and run make(1) there, if one is found
#
DEPTH="$(pwd | tr -c -d / | wc -c)"
MOD=.
NPD="--no-print-directory"
if [[ "$*" == *"-w"* || "$*" == *"--print-directory"* ]]; then
NPD=
fi
while [[ $DEPTH -gt 0 ]]; do
if [[ -f $MOD/VAF/Makefile ]]; then
if [[ $MOD == "." ]]; then
make -C VAF "$@"
else
echo "make -C $MOD/VAF $*"
make $NPD -C $MOD/VAF "$@"
fi
exit $?
fi
MOD=$MOD/..
(( DEPTH-- )) || true
done
echo "No Makefile found in a directory named VAF." >&2
exit 1
#!/bin/bash
#
# Search dist folder recursively and installs containing *.whl files, if found
#
DEPTH="$(pwd | tr -c -d / | wc -c)"
MOD=.
while [[ $DEPTH -gt 0 ]]; do
if [[ -d $MOD/dist ]]; then
for file in $MOD/dist/*.whl; do
if [[ -f $file ]]; then
echo "Installing $file"
pip3 install "$file" --force-reinstall --no-deps --break-system-packages
fi
done
exit 0
fi
MOD=$MOD/..
(( DEPTH-- )) || true
done
echo "No wheels found." >&2
exit 1
{
"python.defaultInterpreterPath": "${workspaceFolder}/VAF/.venv/bin/python",
// testing
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"--no-cov", // when using 'pytest-cov' we need to disable coverage when debugging
"VAF/tests",
"-vv",
"--runslow"
],
"python.testing.unittestEnabled": false,
// misc
"window.zoomLevel": 0,
"terminal.integrated.allowChords": false
}
{
// See https://code.visualstudio.com/docs/editor/tasks
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "TestPythonPackage",
"type": "shell",
"command": "${workspaceFolder}/.vscode/scripts/mk.sh -w test",
"options": {
"cwd": "${fileDirname}"
},
"presentation": {
"reveal": "silent",
"clear": true,
}
},
{
"label": "TestSlowPythonPackage",
"type": "shell",
"command": "${workspaceFolder}/.vscode/scripts/mk.sh -w test PYTEST_FLAGS='--runslow'",
"options": {
"cwd": "${fileDirname}"
},
"presentation": {
"reveal": "silent",
"clear": true,
}
},
{
"label": "LintPythonPackage",
"type": "shell",
"command": "${workspaceFolder}/.vscode/scripts/mk.sh -w check-format lint",
"options": {
"cwd": "${fileDirname}"
},
"presentation": {
"reveal": "silent",
"clear": true,
}
},
{
"label": "LintTestPythonPackage",
"dependsOrder": "sequence",
"dependsOn": [
"LintPythonPackage",
"TestSlowPythonPackage",
],
},
{
"label": "UpdatePythonPackage",
"type": "shell",
"command": "${workspaceFolder}/.vscode/scripts/mk.sh -w clean build && ${workspaceFolder}/.vscode/scripts/reinstall_wheels.sh",
"group": "build",
"options": {
"cwd": "${fileDirname}"
},
"presentation": {
"reveal": "silent",
"clear": true,
}
},
{
"label": "Build TC",
"type": "shell",
"command": "cd TechnicalConcept && make html",
"group": "build",
"options": { },
"presentation": {
"reveal": "silent",
"clear": true,
}
},
]
}
# Container
Please use the provided build script `build.sh` to create the container image for further use in VAF
projects.
>**⚠️ Note**
>Several dependencies get downloaded during this process.
>Please make sure that an active internet connection is available.
#!/bin/bash
# When you modify the tags, be sure to also change the image parameter in the workspace devcontainer template.
docker build -t vaf:latest -t vaf:$(cat ../version.txt) -f eclipse.Dockerfile ..
[requires]
protobuf/5.27.0
gtest/1.13.0
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.version=12
compiler.cppstd=17
compiler.libcxx=libstdc++11
os=Linux
[options]
[buildenv]
CC=gcc-12
CXX=g++-12
ARG USER="eclipse"
ARG PDM_VERSION="2.22.4"
ARG CONAN_VERSION="2.13.0"
FROM ubuntu:24.04 AS vaf-base
ARG TZ="Europe/Berlin"
ARG USER
ARG CONAN_VERSION
ENV LC_ALL="C.UTF-8" \
LANG="C.UTF-8"
# Install common APT packages
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
ccache \
cmake \
g++-12 \
git \
pipx \
python3-pip \
python3.12 \
python3.12-venv \
sudo \
ssh \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/* \
&& rm -rf /var/log/*
# Comment out and adapt the lines below to add SSL certificates if needed:
# ADD url-to-your-certificate-one /usr/local/share/ca-certificates/your-certificates-folder
# ADD url-to-your-certificate-two /usr/local/share/ca-certificates/your-certificates-folder
# RUN update-ca-certificates /usr/local/share/ca-certificates/
# ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# Create working directory and add user
RUN mkdir -p /workspaces \
# Create a default user
&& userdel -r ubuntu \
&& useradd -m -s /bin/bash -u 1000 ${USER} --groups sudo \
# Allow usage of sudo without password
&& echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER}_all \
&& chown -R ${USER}:${USER} /workspaces
USER ${USER}
# Install common python dependencies
RUN pip3 install conan==${CONAN_VERSION} --break-system-packages\
&& rm -rf /home/${USER}/.cache/*
WORKDIR /workspaces
FROM vaf-base AS builder
ARG PDM_VERSION
# Install build dependencies
RUN pipx ensurepath \
&& pipx install pdm==${PDM_VERSION}
# Build SIL Kit
RUN mkdir -p /tmp/silkit \
&& git clone --recurse-submodules -j4 https://github.com/vectorgrp/sil-kit.git /tmp/silkit \
&& git -C /tmp/silkit checkout tags/v4.0.55 \
&& git -C /tmp/silkit submodule update --init --recursive \
&& mkdir /tmp/silkit/build \
&& cmake -DSILKIT_BUILD_DEMOS=OFF -DSILKIT_BUILD_TESTS=OFF -DSILKIT_BUILD_DASHBOARD=OFF -DSILKIT_BUILD_STATIC=ON \
-DCMAKE_INSTALL_PREFIX=/tmp/silkit/install -S /tmp/silkit -B /tmp/silkit/build \
&& cmake --build /tmp/silkit/build --target install --parallel 12
# Build conan packages
RUN --mount=type=bind,source=SwLibraries/vaf_core_library,target=/tmp/vafcpp/src,readwrite \
--mount=type=bind,source=Container/conan,target=/tmp/conan,readwrite \
--mount=type=bind,source=version.txt,target=/tmp/version.txt \
sudo chown -R 1000:1000 /tmp/vafcpp /tmp/conan \
&& export PATH="$PATH:/home/${USER}/.local/bin" \
&& cd /tmp/vafcpp/src \
&& conan create . --profile:all=./test_package/gcc12__x86_64-pc-linux-elf -s build_type=Release \
&& conan create . --profile:all=./test_package/gcc12__x86_64-pc-linux-elf -s build_type=Debug \
&& conan install /tmp/conan -pr:a=/tmp/conan/gcc12__x86_64-pc-linux-elf --build=missing \
&& conan install /tmp/conan -pr:a=/tmp/conan/gcc12__x86_64-pc-linux-elf --build=missing -s build_type=Debug \
&& conan cache clean
# Build vafcli
RUN --mount=type=bind,source=VAF,target=/tmp/vaf/src,readwrite \
--mount=type=bind,source=version.txt,target=/tmp/version.txt \
sudo chown -R 1000:1000 /tmp/vaf \
&& rm -f /tmp/vaf/.python-version \
&& export PATH="$PATH:/home/${USER}/.local/bin" \
&& export PDM_BUILD_SCM_VERSION=$(cat /tmp/version.txt) \
&& make -C /tmp/vaf/src clean build \
&& mv /tmp/vaf/src/dist/*.whl /tmp/vaf
FROM vaf-base AS devcontainer
# Install packages requiring root permissions
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash-completion \
clangd \
emacs \
gdb \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/* \
&& rm -rf /var/log/*
# Install SIL Kit
RUN --mount=type=bind,from=builder,source=/tmp/silkit,target=/tmp/silkit \
cp /tmp/silkit/install/bin/* /usr/local/bin/ \
&& cp -r /tmp/silkit/install/include/silkit /usr/local/include/ \
&& cp -r /tmp/silkit/install/lib/cmake /usr/local/lib/ \
# Workaround for broken installation when building statically linked libraries
&& cp /tmp/silkit/build/ThirdParty/_tp_spdlog/libspdlog.a /usr/local/lib/ \
&& cp /tmp/silkit/build/ThirdParty/_tp_yaml-cpp/libyaml-cpp.a /usr/local/lib/ \
&& cp /tmp/silkit/build/Release/libSilKit.a /usr/local/lib/
# Switch user and set environment variables
USER ${USER}
ENV PATH="$PATH:/home/${USER}/.local/bin"
# Install remaining artifacts from build stage
RUN --mount=type=bind,from=builder,source=/tmp/vaf,target=/tmp/vaf \
# Install vafcli
pip3 install /tmp/vaf/*.whl --break-system-packages \
&& rm -rf /home/${USER}/.cache/* \
&& _VAF_COMPLETE=bash_source vaf | sudo tee /usr/share/bash-completion/completions/vaf > /dev/null
COPY --from=builder /home/${USER}/.conan2 /home/${USER}/.conan2
# Add Demos
COPY Demo /opt/vaf/Demo
#!/bin/bash
set -e
usage() {
echo "Usage: $0"
echo -e "\t --get-package PKG_NAME VERSION BUILD_TYPE COMPILER_VERSION CPP_STD"
echo -e "\t --get-path PKG_NAME VERSION"
exit 1
}
function get_path {
json_data=$(conan list "$pkg_name/$version:*" --format json)
revision=$(echo "$json_data" | jq -r ".\"Local Cache\".\"$pkg_name/$version\".revisions | keys[0]")
package=$(echo "$json_data" | jq -r ".\"Local Cache\".\"$pkg_name/$version\".revisions.\"$revision\".packages | keys[0]")
conan cache path "$pkg_name/$version#$revision:$package"
}
if [ $# -lt 3 ]; then
usage
fi
func=$1
pkg_name=$2
version=$3
shift 3
case $func in
--get-path)
get_path "$@"
;;
--get-package)
get_package "$@"
;;
*)
usage
;;
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment