Skip to content

Add toolchain files and beman-submodule#13

Merged
ednolan merged 38 commits intomainfrom
enolan_bemanmodule4
Jun 9, 2025
Merged

Add toolchain files and beman-submodule#13
ednolan merged 38 commits intomainfrom
enolan_bemanmodule4

Conversation

@ednolan
Copy link
Member

@ednolan ednolan commented May 12, 2025

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-repo.

bretbrownjr and others added 30 commits April 6, 2024 12:33
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>
ednolan and others added 4 commits March 16, 2025 12:05
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.
@ednolan ednolan requested review from a team, JeffGarland and RaduNichita May 12, 2025 08:19
@ednolan ednolan mentioned this pull request May 12, 2025
1 task
@ednolan ednolan force-pushed the enolan_bemanmodule4 branch 5 times, most recently from 75c5ba3 to 8410ea2 Compare May 19, 2025 15:51
@ednolan ednolan force-pushed the enolan_bemanmodule4 branch 6 times, most recently from 7e2925c to 5e4e966 Compare June 9, 2025 15:28
@ednolan ednolan changed the title Add toolchain files and beman_module.py Add toolchain files and beman-submodule Jun 9, 2025
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.
@ednolan ednolan force-pushed the enolan_bemanmodule4 branch from 5e4e966 to e20ede7 Compare June 9, 2025 15:47
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.
@ednolan ednolan force-pushed the enolan_bemanmodule4 branch from e20ede7 to 316ad3f Compare June 9, 2025 15:48
@ednolan ednolan merged commit 3dc3acd into main Jun 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants