Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b0bc4cb
Add symbol visibility armoring to all shared libraries (de novo on main)
Copilot Mar 9, 2026
826d5af
Apply ruff fixes
github-actions[bot] Mar 9, 2026
8a09630
Apply clang-format fixes
github-actions[bot] Mar 9, 2026
dff7b8a
Apply YAML formatter fixes
github-actions[bot] Mar 9, 2026
ac59b96
Export tag_invoke customization points in configuration.hpp
Copilot Mar 9, 2026
df6cf3e
Export missing symbols causing undefined-reference link failures
Copilot Mar 9, 2026
356a737
Export to_product_specifications, output_api, and product_store::more…
Copilot Mar 9, 2026
1f413c1
Apply clang-format fixes
github-actions[bot] Mar 9, 2026
3598df2
Add _internal companion libraries for test access and size/timing com…
Copilot Mar 9, 2026
12984fb
Move export headers from include/ to include/phlex/
Copilot Mar 9, 2026
fb2153b
Remove redundant INSTALL_INTERFACE from phlex_apply_symbol_visibility
Copilot Mar 9, 2026
bcffb4a
Apply cmake-format fixes
github-actions[bot] Mar 9, 2026
5fc99e6
Add PHLEX_HIDE_SYMBOLS option to toggle symbol visibility mode
Copilot Mar 10, 2026
a37cb2e
Make layer_generator_internal conditional on PHLEX_HIDE_SYMBOLS
Copilot Mar 10, 2026
4d4accd
Add PhlexOptimization.cmake: -fno-semantic-interposition, -fno-plt, P…
Copilot Mar 10, 2026
9821b54
Auto-enable PHLEX_ENABLE_IPO for Release/RelWithDebInfo build types
Copilot Mar 10, 2026
cb78d90
Default PHLEX_HIDE_SYMBOLS based on CMAKE_BUILD_TYPE
Copilot Mar 10, 2026
6512cc7
Auto-adjust PHLEX_HIDE_SYMBOLS default when PHLEX_ENABLE_IPO=ON
Copilot Mar 10, 2026
d3a57d9
Force PHLEX_HIDE_SYMBOLS=ON when PHLEX_ENABLE_IPO=ON (not just default)
Copilot Mar 10, 2026
ad2c0ab
Revert forced PHLEX_HIDE_SYMBOLS correction; make options fully indep…
Copilot Mar 10, 2026
421f4ca
Specify default opt/debug options for different `CMAKE_BUILD_TYPE`s
greenc-FNAL Mar 10, 2026
9ec4e66
Enable compile/link time profiling
greenc-FNAL Mar 10, 2026
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
15 changes: 8 additions & 7 deletions .github/workflows/clang-format-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ run-name: "${{ github.actor }} fixing C++ code format"
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string
workflow_call:
Expand Down Expand Up @@ -52,8 +54,7 @@ permissions:
contents: write

env:
local_checkout_path:
${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}
local_checkout_path: ${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}

jobs:
pre-check:
Expand All @@ -70,11 +71,11 @@ jobs:
# This covers repo owners, invited collaborators, and all org members.
outputs:
ref:
${{ inputs.ref || (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.ref || github.ref_name)) || steps.get_pr.outputs.ref }}
${{ inputs.ref || (github.event_name == 'workflow_dispatch' && (github.event.inputs.ref || github.ref_name)) ||
steps.get_pr.outputs.ref }}
repo:
${{ inputs.repo || (github.event_name == 'workflow_dispatch' &&
github.repository) || steps.get_pr.outputs.repo }}
${{ inputs.repo || (github.event_name == 'workflow_dispatch' && github.repository) || steps.get_pr.outputs.repo
}}

steps:
- name: Get PR Info
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/clang-tidy-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ name: Clang-Tidy Fix
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string
tidy-checks:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/cmake-format-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ run-name: "${{ github.actor }} fixing CMake format"
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string
workflow_call:
Expand Down Expand Up @@ -52,8 +54,7 @@ permissions:
contents: write

env:
local_checkout_path:
${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}
local_checkout_path: ${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}

jobs:
pre-check:
Expand All @@ -70,11 +71,11 @@ jobs:
# This covers repo owners, invited collaborators, and all org members.
outputs:
ref:
${{ inputs.ref || (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.ref || github.ref_name)) || steps.get_pr.outputs.ref }}
${{ inputs.ref || (github.event_name == 'workflow_dispatch' && (github.event.inputs.ref || github.ref_name)) ||
steps.get_pr.outputs.ref }}
repo:
${{ inputs.repo || (github.event_name == 'workflow_dispatch' &&
github.repository) || steps.get_pr.outputs.repo }}
${{ inputs.repo || (github.event_name == 'workflow_dispatch' && github.repository) || steps.get_pr.outputs.repo
}}

steps:
- name: Get PR Info
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,7 @@ jobs:
fi

determine-languages:
needs:
[
pre-check,
detect-changes-cpp,
detect-changes-python,
detect-changes-actions,
]
needs: [pre-check, detect-changes-cpp, detect-changes-python, detect-changes-actions]
if: always() && needs.pre-check.result == 'success'
runs-on: ubuntu-latest
outputs:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/header-guards-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ run-name: "${{ github.actor }} fixing header guards"
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string

Expand All @@ -52,8 +54,7 @@ permissions:
contents: write

env:
local_checkout_path:
${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}
local_checkout_path: ${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}

jobs:
pre-check:
Expand All @@ -70,11 +71,11 @@ jobs:
# This covers repo owners, invited collaborators, and all org members.
outputs:
ref:
${{ inputs.ref || (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.ref || github.ref_name)) || steps.get_pr.outputs.ref }}
${{ inputs.ref || (github.event_name == 'workflow_dispatch' && (github.event.inputs.ref || github.ref_name)) ||
steps.get_pr.outputs.ref }}
repo:
${{ inputs.repo || (github.event_name == 'workflow_dispatch' &&
github.repository) || steps.get_pr.outputs.repo }}
${{ inputs.repo || (github.event_name == 'workflow_dispatch' && github.repository) || steps.get_pr.outputs.repo
}}

steps:
- name: Get PR Info
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/jsonnet-format-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ run-name: "${{ github.actor }} fixing Jsonnet format"
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string
workflow_call:
Expand Down Expand Up @@ -52,8 +54,7 @@ permissions:
contents: write

env:
local_checkout_path:
${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}
local_checkout_path: ${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}

jobs:
pre-check:
Expand All @@ -70,11 +71,11 @@ jobs:
# This covers repo owners, invited collaborators, and all org members.
outputs:
ref:
${{ inputs.ref || (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.ref || github.ref_name)) || steps.get_pr.outputs.ref }}
${{ inputs.ref || (github.event_name == 'workflow_dispatch' && (github.event.inputs.ref || github.ref_name)) ||
steps.get_pr.outputs.ref }}
repo:
${{ inputs.repo || (github.event_name == 'workflow_dispatch' &&
github.repository) || steps.get_pr.outputs.repo }}
${{ inputs.repo || (github.event_name == 'workflow_dispatch' && github.repository) || steps.get_pr.outputs.repo
}}

steps:
- name: Get PR Info
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/markdown-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ run-name: "${{ github.actor }} fixing Markdown format"
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string

Expand All @@ -52,8 +54,7 @@ permissions:
contents: write

env:
local_checkout_path:
${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}
local_checkout_path: ${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}

jobs:
pre-check:
Expand All @@ -70,11 +71,11 @@ jobs:
# This covers repo owners, invited collaborators, and all org members.
outputs:
ref:
${{ inputs.ref || (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.ref || github.ref_name)) || steps.get_pr.outputs.ref }}
${{ inputs.ref || (github.event_name == 'workflow_dispatch' && (github.event.inputs.ref || github.ref_name)) ||
steps.get_pr.outputs.ref }}
repo:
${{ inputs.repo || (github.event_name == 'workflow_dispatch' &&
github.repository) || steps.get_pr.outputs.repo }}
${{ inputs.repo || (github.event_name == 'workflow_dispatch' && github.repository) || steps.get_pr.outputs.repo
}}

steps:
- name: Get PR Info
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/python-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ run-name: "${{ github.actor }} fixing Python code"
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string
workflow_call:
Expand Down Expand Up @@ -52,8 +54,7 @@ permissions:
contents: write

env:
local_checkout_path:
${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}
local_checkout_path: ${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}

jobs:
pre-check:
Expand All @@ -70,11 +71,11 @@ jobs:
# This covers repo owners, invited collaborators, and all org members.
outputs:
ref:
${{ inputs.ref || (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.ref || github.ref_name)) || steps.get_pr.outputs.ref }}
${{ inputs.ref || (github.event_name == 'workflow_dispatch' && (github.event.inputs.ref || github.ref_name)) ||
steps.get_pr.outputs.ref }}
repo:
${{ inputs.repo || (github.event_name == 'workflow_dispatch' &&
github.repository) || steps.get_pr.outputs.repo }}
${{ inputs.repo || (github.event_name == 'workflow_dispatch' && github.repository) || steps.get_pr.outputs.repo
}}
steps:
- name: Get PR Info
if: github.event_name == 'issue_comment' && inputs.ref == ''
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/yaml-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ name: YAML Fix
workflow_dispatch:
inputs:
ref:
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the repository's default branch."
description:
"The branch name to checkout and push fixes to (must be a branch, not a commit SHA). Defaults to the
repository's default branch."
required: false
type: string
workflow_call:
Expand Down Expand Up @@ -52,8 +54,7 @@ permissions:
contents: write

env:
local_checkout_path:
${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}
local_checkout_path: ${{ inputs.checkout-path || format('{0}-src', github.event.repository.name) }}

jobs:
pre-check:
Expand All @@ -70,11 +71,11 @@ jobs:
# This covers repo owners, invited collaborators, and all org members.
outputs:
ref:
${{ inputs.ref || (github.event_name == 'workflow_dispatch' &&
(github.event.inputs.ref || github.ref_name)) || steps.get_pr.outputs.ref }}
${{ inputs.ref || (github.event_name == 'workflow_dispatch' && (github.event.inputs.ref || github.ref_name)) ||
steps.get_pr.outputs.ref }}
repo:
${{ inputs.repo || (github.event_name == 'workflow_dispatch' &&
github.repository) || steps.get_pr.outputs.repo }}
${{ inputs.repo || (github.event_name == 'workflow_dispatch' && github.repository) || steps.get_pr.outputs.repo
}}

steps:
- name: Get PR Info
Expand Down
38 changes: 38 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ FetchContent_Declare(
FIND_PACKAGE_ARGS
)

# ##############################################################################
# Initial compilation flags for build types we care about
if(NOT CMAKE_CXX_FLAGS_DEBUG)
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE STRING "" FORCE)
endif()

if(NOT CMAKE_CXX_FLAGS_RELEASE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g0 -DNDEBUG" CACHE STRING "" FORCE)
endif()

if(NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -fno-omit-frame-pointer -g -DNDEBUG" CACHE STRING "" FORCE)
endif()
# ##############################################################################

# Make cetmodules available
FetchContent_MakeAvailable(cetmodules)
find_package(cetmodules 4.01.01 REQUIRED)
Expand All @@ -58,11 +73,34 @@ set(CTEST_TEST_TIMEOUT 90 CACHE STRING "Per-test timeout (s) for CTest")
FetchContent_MakeAvailable(Catch2 GSL mimicpp)

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PhlexOptimization.cmake derives default values for PHLEX_ENABLE_IPO / PHLEX_HIDE_SYMBOLS from CMAKE_BUILD_TYPE, but CMAKE_BUILD_TYPE is only defaulted later in this file (to RelWithDebInfo). As a result, when users don’t set a build type explicitly, these options will default as if the build type were empty (OFF) even though the project later forces RelWithDebInfo. Consider setting the default CMAKE_BUILD_TYPE before including PhlexOptimization.cmake, or reworking the option-default logic so it reflects the eventual default build type.

Suggested change
# Ensure a default build type is set before optimization options that depend on it.
# Only apply to single-config generators and when the user has not set a build type.
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(
CMAKE_BUILD_TYPE
RelWithDebInfo
CACHE STRING "Build type (defaulted to RelWithDebInfo if not set by user)"
)
endif()

Copilot uses AI. Check for mistakes.
include(Modules/private/CreateCoverageTargets.cmake)
include(Modules/private/PhlexSymbolVisibility.cmake)
include(Modules/private/PhlexOptimization.cmake)

option(ENABLE_TSAN "Enable Thread Sanitizer" OFF)
option(ENABLE_ASAN "Enable Address Sanitizer" OFF)
option(PHLEX_USE_FORM "Enable experimental integration with FORM" OFF)
option(ENABLE_COVERAGE "Enable code coverage instrumentation" OFF)
option(ENABLE_BUILD_PROFILING "Enable monitoring of compile and link operations" OFF)

# ##############################################################################
# Enable collection of compile/link statistics.
#
# If lld is available but not default for the current toolset, then use
# `-DCMAKE_LINKER_TYPE=LLD`
if (ENABLE_BUILD_PROFILING)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CMAKE_COMMAND} -E time")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options("-ftime-trace")
endif()
if(CMAKE_CXX_COMPILER_LINKER_ID STREQUAL "LLD")
message(STATUS "LLD detected (Phlex build) - Enabling tracing")
add_link_options("-Wl,--time-trace")
add_link_options("-Wl,--Map=phlex_link.map")
Comment on lines +96 to +99
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build-profiling linker options are added globally, and -Wl,--Map=phlex_link.map uses a fixed filename. With multiple targets (or parallel links), this map file will be repeatedly overwritten and can race, producing incomplete or misleading output. Consider making the map filename target-specific (or omitting the map by default), and also gating these -Wl,--* flags to ELF platforms where they’re supported (lld on macOS/Mach-O typically won’t accept the same options).

Suggested change
if(CMAKE_CXX_COMPILER_LINKER_ID STREQUAL "LLD")
message(STATUS "LLD detected (Phlex build) - Enabling tracing")
add_link_options("-Wl,--time-trace")
add_link_options("-Wl,--Map=phlex_link.map")
if(CMAKE_CXX_COMPILER_LINKER_ID STREQUAL "LLD" AND NOT APPLE)
message(STATUS "LLD detected (Phlex build) - Enabling tracing")
add_link_options("-Wl,--time-trace")

Copilot uses AI. Check for mistakes.
add_link_options("-Wl,--print-archive-stats=-")
endif()
endif()
# ##############################################################################

add_compile_options(
-Wall
Expand Down
Loading
Loading