-
Notifications
You must be signed in to change notification settings - Fork 14
Small fixes #548
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
Small fixes #548
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| # Using a recent compiler version and recent OS (better tooling) | ||
| # We'll implement libc version sanitization in the code itself | ||
| ARG UBUNTU_VERSION=22 | ||
| ARG COMPILER="gcc" | ||
|
|
||
| FROM ubuntu:${UBUNTU_VERSION}.04 as base | ||
| ARG UBUNTU_VERSION | ||
|
|
@@ -31,11 +30,7 @@ FROM base-${UBUNTU_VERSION} AS base-gcc | |
| ENV CC=gcc-${GCC_VERSION} | ||
| ENV CXX=g++-${GCC_VERSION} | ||
|
|
||
| FROM base-${UBUNTU_VERSION} AS base-clang | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we no longer need this ? I thought that CI relies on this part. No breaking changes on CI ?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this does impact CI, however we do not really use the default CC/CXX in the build. So the cleanup is trivial
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both gcc and clang are always installed in the image, |
||
| ENV CC=clang-${CLANG_VERSION} | ||
| ENV CXX=clang++-${CLANG_VERSION} | ||
|
|
||
| FROM base-${COMPILER} AS final | ||
| FROM base-gcc AS final | ||
|
|
||
| # Tell docker to use bash as the default | ||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,14 @@ GetDefaultAllocatorOptions() { | |
| } | ||
|
|
||
| GetDirectoryExtention() { | ||
| echo "_${DDPROF_EXTENSION_CC}_${DDPROF_EXTENSION_OS}_${1}" | ||
| # DebTidy is clang-only by design — force the clang segment of the build-dir | ||
| # name regardless of CC. The vendor extension is forced separately in | ||
| # DebTidyCMake (because CmakeWithOptions calls this with BUILD_TYPE=Debug). | ||
| local CC_SUFFIX=${DDPROF_EXTENSION_CC} | ||
| if [[ "$1" == "DebTidy" ]]; then | ||
| CC_SUFFIX=clang | ||
| fi | ||
| echo "_${CC_SUFFIX}_${DDPROF_EXTENSION_OS}_${1}" | ||
| } | ||
|
|
||
| COMMON_OPT="${COMPILER_SETTING} ${DEFAULT_ALLOCATOR_OPT} -DCMAKE_INSTALL_PREFIX=${DDPROF_INSTALL_PREFIX} -DCOLLATZ_INSTALL_PREFIX=${DDPROF_COLLATZ_INSTALL_PREFIX} -DBUILD_BENCHMARKS=${DDPROF_BUILD_BENCH}" | ||
|
|
@@ -89,7 +96,14 @@ DebCMake() { | |
|
|
||
| DebTidyCMake() { | ||
| local BUILD_TYPE=Debug | ||
| # VENDOR_EXTENSION uses BUILD_TYPE (Debug), so the DebTidy special-case in | ||
| # GetDirectoryExtention does not fire here — override locally so vendored | ||
| # deps land in _clang_*_Debug and are shared with CC=clang DebCMake builds | ||
| # rather than rebuilt for clang-tidy specifically. | ||
| local DDPROF_EXTENSION_CC=clang | ||
| if [[ ( -n "${CC:-}" && "${CC%-*}" != "clang" ) || ( -n "${CXX:-}" && "${CXX%-*}" != "clang++" ) ]]; then | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense to fail early on this
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not fail, but warns that CC/CXX are ignored. |
||
| echoerr "DebTidyCMake: forcing clang/clang++ (ignoring CC=${CC:-} CXX=${CXX:-} — clang-tidy requires clang)." | ||
| fi | ||
| CmakeWithOptions ${BUILD_TYPE} -DENABLE_CLANG_TIDY=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ $@ | ||
| } | ||
|
|
||
|
|
@@ -109,7 +123,7 @@ CovCMake() { | |
| } | ||
|
|
||
| ## Build a directory with a naming that reflects the OS / compiler we are using | ||
| ## Example : mkBuildDir Rel --> build_UB18_clang_Rel | ||
| ## Example: MkBuildDir Rel --> build_gcc_unknown-linux-2.39_Rel | ||
| MkBuildDir() { | ||
| local BUILD_DIR_EXTENSION=$(GetDirectoryExtention ${1}) | ||
| echo ${BUILD_DIR_EXTENSION} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, I like the else branch