Skip to content
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

Rewrite README file #111

Merged
merged 25 commits into from
Feb 28, 2025
Merged

Rewrite README file #111

merged 25 commits into from
Feb 28, 2025

Conversation

wusatosi
Copy link
Member

@wusatosi wusatosi commented Feb 2, 2025

Fix #97 .

Please squash merge.

Major painpoints in current README:

  • Current README is full of TODOs
  • Not all of our developer tools have been documented (pre-commit, CMake preset, codespace)
  • A lot of replacement needed to bootstrap a new project

This PR aim to fix these issues.

Major TODOs

  • Address all current TODOs, mostly left out explicitly to @neatudarius
  • Define minimal C++ version
  • Define minimal CMake version
  • Define tested range of compiler support
  • Document that cmake config requires internet access due to testing
  • Document CMake config flags: Disable Tests
  • Document CMake config flags: Disable examples
  • Document codespace support as rapid development
  • Document CMake preset as one-line configuration
  • Document developer facing tool: pre-commit
  • Document developer facing tool: Current GitHub Action workflow and how to update them.

Developer facing tool would be moved to docs/, see #120 .

This PR also adds spell checks.

Copy link
Contributor

@bretbrownjr bretbrownjr left a comment

Choose a reason for hiding this comment

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

Made a few suggestions. I like the notes you left to yourself.

I am definitely looking forward to the docs on pre-commit and how to run GitHub Actions locally. If our Spaces environment comes already prepared for those workflows, even better.

One suggestion: it's probably true that more users will just want to consume and build Beman libraries than make changes to them. Let's consider creating a CONTRIBUTING.md file and putting instructions in there that you wouldn't need if you were happy just building a release of this repo.

README.md Outdated
Comment on lines 94 to 96
This project pulls [Google Test](https://github.com/google/googletest)
from GitHub as a development dependency,
you can disable this behavior by setting `BEMAN_EXEMPLAR_BUILD_TESTS` to `OFF`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remind me to update this section of the README whenever we decide on an approach to make the http-based dependency resolution optional.

@wusatosi
Copy link
Member Author

wusatosi commented Feb 3, 2025

One suggestion: it's probably true that more users will just want to consume and build Beman libraries than make changes to them. Let's consider creating a CONTRIBUTING.md file and putting instructions in there that you wouldn't need if you were happy just building a release of this repo.

Yeah one of the main goal is to minimize the amount of replacement we need for the initial setup. We don't have to be exhaustive with those.

@wusatosi
Copy link
Member Author

I am definitely looking forward to the docs on pre-commit and how to run GitHub Actions locally. If our Spaces environment comes already prepared for those workflows, even better.

@bretbrownjr Unfortunately it's really tricky to run GitHub Actions locally, you have to setup docker and cross-platform emulation if you want to test windows/ macos based workflows, there's only community maintained solutions.

See: https://github.com/nektos/act

I do get this question a lot, maybe I should document this.

@wusatosi wusatosi changed the title Improve README file Rewrite README file Feb 16, 2025
@wusatosi wusatosi marked this pull request as ready for review February 16, 2025 23:09
Copy link
Contributor

@bretbrownjr bretbrownjr left a comment

Choose a reason for hiding this comment

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

I have some grammatical tweaks to suggest in this review.

Overall, I think this change is a net improvement on the documentation, so it passes my bar for acceptance. I'm happy to see it merged once the comments I made are addressed one way or another.

README.md Outdated
Comment on lines 343 to 318
```shell
# Assume /opt/beman.exemplar staging directory.
$ c++ -o identity_usage examples/identity_usage.cpp \
-I /opt/beman.exemplar/include/ \
-L/opt/beman.exemplar/lib/ -lbeman.exemplar
### Produce beman.exemplar static library locally

You can include exemplar's headers locally
by producing a static `libbeman.exemplar.a` library.

```bash
cmake --workflow --preset gcc-release
cmake --install build/gcc-release --prefix /opt/beman.exemplar
```

</details>
This will generate such project structure at `/opt/beman.exemplar`.

<details>
<summary> Use beman.exemplar directly from CMake </summary>
```txt
/opt/beman.exemplar
├── include
│ └── beman
│ └── exemplar
│ └── identity.hpp
└── lib
└── libbeman.exemplar.a
```
Copy link
Contributor

Choose a reason for hiding this comment

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

We should just remove this section. We don't want to support arbitrary -lbeman.exemplar and such. This is especially true for libraries that will actually have link time dependencies for release builds.

Install instructions are good to document, but that would be for people maintaining these packages in Conan, vcpkg, Debian, or a similar project. They would go in a packaging guide, if we wanted to support one of those.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with this, I will go ahead and remove this section.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I am not sure, cmake --install is a command we maintain, should I document this differently?

You will also need to add `beman::exemplar`
to the link libraries of any libraries or executables that include `beman/exemplar/*.hpp` in their source or header file.
You will also need to add `beman::exemplar` to the link libraries of
any libraries or executables that include beman.exemplar's header file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good.

Note that it would be a little tricky to get the pluralization of "header file" versus "header files" correct if a project template contained this text. Some projects would be one header like beman.exemplar, but many would not.

README.md Outdated
Comment on lines 337 to 345
### Linking your project to beman.exemplar with compiler options

Build systems that support `pkg-config` by providing a `beman.exemplar.pc` file.
Build systems that support interoperation via `pkg-config` should be able to detect `beman.exemplar` for you automatically.
Compile your project so that it links to the header and library correctly.

</details>
```bash
c++ -I/opt/beman.exemplar/include \
-L/opt/beman.exemplar/lib -lbeman.exemplar \
your_project.cpp -o your_project
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, I don't think we should bother documenting how to support direct compiler invocations. I suggest we remove this section.

@bretbrownjr
Copy link
Contributor

To the concerns of @wusatosi about how much work is required to template this repo, the bulk of the README is not particularly unique to beman.exemplar. Shrinking this content will make it easier for the dozen+ projects we already have to keep up. We should consider replacing detailed how-to instructions with links to external resources, either in https://github.com/bemanproject/beman or from a high quality third-party guide. Content that would stay in the repo would be unique to the repo: specific dependencies, compiler support, language levels required, include interfaces, CMake package names, etc.

I'm happy to see this PR land as-is, but a future PR to slim this README down a lot and point users at a common guide should be what we're looking to do. Though we could consider that for the future. It's possible we need a robust implementation of some Beman tooling infrastructure of some sort first.

Copy link
Member

@JeffGarland JeffGarland left a comment

Choose a reason for hiding this comment

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

This looks like a good improvement overall so I'm approving this. @wusatosi lets get some of these PRs closed out -- you've been doing some great work here and I'd like to see it in the baseline :)

@neatudarius neatudarius merged commit 06cfae6 into bemanproject:main Feb 28, 2025
66 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.

Better README
4 participants