From b885210480ffc97092f1340e5e175d035ffdea3b Mon Sep 17 00:00:00 2001 From: Darius Neatu Date: Tue, 11 Jun 2024 17:48:09 +0300 Subject: [PATCH] Update Beman.Optional26 docs and do tree cleanup --- .github/CODEOWNERS | 2 + .gitignore | 12 ++--- .gitmodules | 3 -- CITATION.cff | 9 ++-- Dockerfile | 10 ---- README.md | 46 +++++++++++-------- bld | 1 - docker-compose.yml | 16 ------- docker-inf/docker-cxx-dev | 1 - papers/P2988/README.md | 12 +++++ .../P2988/presentation}/optional_ref.md | 0 11 files changed, 50 insertions(+), 62 deletions(-) delete mode 100644 Dockerfile delete mode 120000 bld delete mode 100644 docker-compose.yml delete mode 160000 docker-inf/docker-cxx-dev create mode 100644 papers/P2988/README.md rename {presentation => papers/P2988/presentation}/optional_ref.md (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2c228ab3..c5c4356e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,5 @@ # Codeowners for reviews on PRs +* @camio +* @neatudarius * @steve-downey diff --git a/.gitignore b/.gitignore index e5240de7..89944aa0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ cmake.bld -/papers/**/generated/ compile_commands.json -.update-submodules -.use-docker +/.build/ +/.cache/ +*.pyg +/.vscode/ +/papers/**/generated/ /papers/**/.venv/ /papers/**/_minted-*/ /papers/**/*.aux @@ -22,6 +24,4 @@ compile_commands.json /papers/**/.venv.work/ /papers/**/_minted-optional_ref/ /papers/**/_minted-optional_ref_wording/ -/.cache/ -*.pyg -/.build/ +.update-submodules diff --git a/.gitmodules b/.gitmodules index 807f4886..9c4e4556 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "extern/googletest"] path = extern/googletest url = https://github.com/google/googletest.git -[submodule "docker-inf/docker-cxx-dev"] - path = docker-inf/docker-cxx-dev - url = git@github.com:steve-downey/docker-cxx-dev.git diff --git a/CITATION.cff b/CITATION.cff index 03df4959..a75cc227 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,7 +1,4 @@ -cff-version: 1.2.0 +cff-version: 1.0.0 message: "If you use this software, please cite it as below." -authors: -- family-names: "Downey" - given-names: "Stephen" -title: "smd::optional::optional " -url: "https://github.com/steve-downey/optional_ref" +title: "Beman.Optional26" +url: "https://github.com/beman-project/Optional26" diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0b549de8..00000000 --- a/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -ARG BASE="steve-downey/cxx-dev:latest" -FROM ${BASE} - -USER root -RUN mkdir -p /home/luser/src/cmake.bld \ - && chown -R luser:luser /home/luser/src/cmake.bld - -USER luser - -RUN touch /tmp/.in_docker diff --git a/README.md b/README.md index 647c9c5d..452bcb61 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ -# OPTIONAL +# Beman.Optional26: C++26 Extensions for std::optional -![](https://github.com/steve-downey/view_maybe/actions/workflows/ci.yml/badge.svg) +This implementation incorporates the C++26 extensions added for `std::optional`. The `Beman.Optional26` library aims to evaluate the stability, the usability, and the performance of these proposed changes before they are officially adopted by WG21 into the C++ Working Draft. Additionally, it allows developers to use these new features before they are implemented in major standard library compilers. + +**Implements**: +* [`std::optional` (P2988R5)](https://wg21.link/P2988R5) +* [Give *std::optional* Range Support (P3168R1)](https://wg21.link/P3168R1). -A proof of concept for the std::optional proposal. Source is licensed with the Apache 2.0 license with LLVM exceptions @@ -18,24 +21,31 @@ The README itself is licesed with CC0 1.0 Universal. Copy the contents and incor // SPDX-License-Identifier: CC0-1.0 -## Building Optional +## How to Build ### Dependencies -This project is mainly tested on Ubuntu 22.04, but it should be as portable as CMake is. - -This project has zero C or C++ depenendencies. +This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it should be as portable as CMake is. This project has zero C or C++ dependencies. -It does require two tools as build-time dependencies: +It does require few tools as build-time dependencies: -- `cmake` +- `cmake` - `ninja`, `make`, or another CMake-supported build system - CMake defaults to "Unix Makefiles" on POSIX systems -Compiling the paper requires a working LaTeX installation. See instructions for configuring your system at [C++ Standard Draft Sources](https://github.com/cplusplus/draft/blob/main/README.rst) +Example of installation on `Ubuntu 24.04`: +```shell +# install tools +apt-get install -y cmake make ninja-build + +# example of toolchains +apt-get install g++-14 gcc-14 clang-18 clang++-18 +``` ### Instructions +Full set of supported toolchains can be found in [.github/workflows/ci.yml](#.github/workflows/ci.yml). + #### Basic Build This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will work, producing a static `example` library, ready to package: @@ -43,24 +53,22 @@ This project strives to be as normal and simple a CMake project as possible. Thi ```shell cmake --workflow --preset gcc-14 ``` + This should build and run the tests with GCC 14 with the address and undefined behavior sanitizers enabled. #### More complex cases + The CMake preset system suffers from combinitorial explosion. There is a makefile in the root of the repository to aid in running more configurations. ```shell make -k TOOLCHAIN=clang-18 CONFIG=Tsan VERBOSE=1 ``` -The makefile will use your system compiler, `c++`, if no toolchain name is provided, otherwise it will use the toolchain in the etc/ directory to perform the build. The Ninja multi config generator is used, with configurations for RelWithDebugInfo, Debug, Tsan, and Asan configured by default. - -#### Building P2988 +The makefile will use your system compiler, `c++`, if no toolchain name is provided, otherwise it will use the toolchain in the etc/ directory to perform the build. The Ninja multi config generator is used, with configurations for `RelWithDebugInfo`, `Debug`, `Tsan`, and `Asan` configured by default. -The papers/ subdirectory has the LaTeX souces for P2988 and the supporting macro definitions. To build, run -```shell -make papers -``` +## Papers -A working recent Python 3 is required to format the sources for the paper. A virtual env will be created in the papers subdirectory which the `minted` LaTeX package will use. +Latest revision(s) of the papers can be built / found at: +* [./papers/P2988/README.md](./papers/P2988/README.md) for `std::optional (P2988)`. +* [give-std-optional-range-support](https://github.com/neatudarius/give-std-optional-range-support/) for `Give *std::optional* Range Support (P3168)` -` diff --git a/bld b/bld deleted file mode 120000 index 33ceb8f0..00000000 --- a/bld +++ /dev/null @@ -1 +0,0 @@ -Makefile \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 8680129e..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -version: '3.7' -services: - dev: - build: - context: . - dockerfile: Dockerfile - volumes: - - .:/home/luser/src/$PROJECT - - cmake.bld:/home/luser/src/cmake.bld/ - - working_dir: /home/luser/src/$PROJECT -volumes: - cmake.bld: - external: true - build: diff --git a/docker-inf/docker-cxx-dev b/docker-inf/docker-cxx-dev deleted file mode 160000 index 451f0958..00000000 --- a/docker-inf/docker-cxx-dev +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 451f0958130ac2c800e7ed2dc8b255f270f173d6 diff --git a/papers/P2988/README.md b/papers/P2988/README.md new file mode 100644 index 00000000..a91cd07e --- /dev/null +++ b/papers/P2988/README.md @@ -0,0 +1,12 @@ +# P2988 + +## Building P2988 + +Compiling the paper requires a working LaTeX installation. See instructions for configuring your system at [C++ Standard Draft Sources](https://github.com/cplusplus/draft/blob/main/README.rst) + +The papers/ subdirectory has the LaTeX souces for P2988 and the supporting macro definitions. To build, run +```shell +make papers +``` + +A working recent Python 3 is required to format the sources for the paper. A virtual env will be created in the papers subdirectory which the `minted` LaTeX package will use. diff --git a/presentation/optional_ref.md b/papers/P2988/presentation/optional_ref.md similarity index 100% rename from presentation/optional_ref.md rename to papers/P2988/presentation/optional_ref.md