Merged
Conversation
Use an empty commit for the first commit. This makes simplifies: * Review workflows for the first files in the repo * Rebasing operations that might include the first commit
This reverts commit 6456fad.
Add Basic CMake Config File Package Creation and Installation
Problem ------- **Given**: A sandbox environment is an environment where dependencies are all provided but access to the internet is not. Also take as a given that the build for this project happens in an environment that meets that description. **When**: Configuring this project with any of the provided approaches. For instance: ``` cmake -B build -S . ``` **Then**: The configuration step hangs or fails, depending on the nature of the sandboxed environment. Solution -------- Move to a `find_package` first implementation for the `CMakeLists.txt` of this project. Using `FetchContent` is still trivial, using the new functionality in `cmake/use-fetch-content.cmake` as documented in the updates to `README.md` included in this commit. Signed-off-by: Bret Brown <mail@bretbrownjr.com>
Previously, the following implementation of identity would pass all
tests under MaxSan:
```
struct identity {
// Returns `t`.
template <class T>
constexpr T&& operator()(T&& t) const noexcept {
int x = std::numeric_limits<int>::max();
++x;
return std::forward<T>(t);
}
using is_transparent = __is_transparent;
};
```
This is because UndefinedBehaviorSanitizer would diagnose the integer
overflow by printing, but would not abort the program:
```
[ RUN ] IdentityTest.check_is_transparent
bemanproject/exemplar/include/beman/exemplar/identity.hpp:37:7: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
[ OK ] IdentityTest.check_is_transparent (0 ms)
```
After this change, the test correctly fails, with SIGILL:
```
The following tests FAILED:
1 - IdentityTest.call_identity_with_int (ILLEGAL)
```
Improve the Fetch gtest workflow docs
Problem
-------
Using the parameters to describe the project in
`project()` is misleading. It happens to be that the name
`beman.exemplar` is used as the name of the project and as
the CMake export name, but those are two different concepts that
do not necessarily align.
Also, the variable dereferencing in CMakeLists.txt is no less
error prone than typing beman.exemplar. That's because it is not
difficult to type things like ${PROJET_SOURCE_DIR}, which CMake
will expand to an empty string.
Instead, the readability of the install logic improves because it
looks like a file with a specific name is being specifically
created and referenced, which is the intention of the relevant
installation logic.
Solution
--------
* Remove references to PROJECT_NAME, PROJECT_SOURCE_DIR,
and PROJECT_BINARY_DIR. Prefer relative paths to
CMAKE_CURRENT_SOUCE_DIR and CMAKE_CURRENT_BINARY_DIR
instead.
* Rename the install COMPONENT for beman.exemplar to
"beman.exemplar" instead of "development".
* Add the install COMPONENT to the installation of the
beman.exemplar library target itself.
* Move FetchContent include to use-fetch-content.cmake.
1 task
75c5ba3 to
8410ea2
Compare
neatudarius
reviewed
May 19, 2025
camio
approved these changes
May 23, 2025
7e2925c to
5e4e966
Compare
This merge commit adds all the CMake toolchain files developed as part of beman.exemplar, and preserves rewritten copies of all the commits that updated the toolchain files by applying a git filter-repo command.
5e4e966 to
e20ede7
Compare
This pull request adds a new script, beman-submodule, which provides some of the features of git submodule but without git submodule's disadvantage that users need to be aware of it to clone the repository. More information can be found in tools/beman-submodule/README.md. It also pulls in the toolchain files from exemplar, preserving history, using a git filter-branch.
e20ede7 to
316ad3f
Compare
neatudarius
approved these changes
Jun 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a new script,
beman-submodule, which provides some of the features ofgit submodulebut withoutgit submodule's disadvantage that users need to be aware of it to clone the repository. More information can be found intools/beman-submodule/README.md.It also pulls in the toolchain files from exemplar, preserving history, using a
git filter-repo.