-
Notifications
You must be signed in to change notification settings - Fork 83
refactor(deps): Document standard rules for writing lib install tasks and apply across all existing tasks: #1479
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
Open
Bill-hbrhbr
wants to merge
17
commits into
y-scope:main
Choose a base branch
from
Bill-hbrhbr:improve-deps-main-taskfile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−241
Open
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6a68ee4
refine taskfile
Bill-hbrhbr 701620d
fix indent
Bill-hbrhbr 060a0ba
Add guidelines for writing taskfiles
Bill-hbrhbr efde834
Improve README
Bill-hbrhbr 90bbe66
Merge branch 'main' into improve-deps-main-taskfile
Bill-hbrhbr 2d0280c
Merge branch 'main' into improve-deps-main-taskfile
Bill-hbrhbr 411a2f5
Merge branch 'main' into improve-deps-main-taskfile
Bill-hbrhbr feceebc
Address review
Bill-hbrhbr 6c64a5b
Address coderabbitai comments
Bill-hbrhbr ed63112
Merge branch 'main' into improve-deps-main-taskfile
davidlion ad9e783
Merge branch 'main' into improve-deps-main-taskfile
Bill-hbrhbr b61382f
Update taskfiles/deps/README.md
Bill-hbrhbr a59858d
Merge branch 'main' into improve-deps-main-taskfile
Bill-hbrhbr e75c8de
Update taskfiles/deps/README.md
Bill-hbrhbr 12f57c1
Update taskfiles/deps/README.md
Bill-hbrhbr 3cfd273
Remove shared libs in task installations
Bill-hbrhbr 1ef92df
Merge branch 'main' into improve-deps-main-taskfile
Bill-hbrhbr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Dependency Taskfiles | ||
|
|
||
| Follow the guidelines below when writing or updating dependency installation taskfiles. | ||
|
|
||
| * Use one of the following tasks for installation, in descending order of preference: | ||
| * `deps:utils:install-remote-cmake-lib` | ||
| * `yscope-dev-utils:cmake:install-remote-tar` | ||
|
|
||
| * For special tasks that don't apply to the rule above: | ||
| * Include `deps:utils:init` in the `deps` section of the task. | ||
| * Briefly explain why if the library is installable via CMake. | ||
| * Ensure each library installation includes checksum validation using the best effort. | ||
| * Use of `yscope-dev-utils` tasks is encouraged, as most of them include proper checksum checks. | ||
| * Use `<lib>-extracted` as the directory name for tarball extractions. | ||
|
|
||
| * Avoid parsing version numbers in download URLs unless the version is used elsewhere, as URL | ||
| formats can change over time, making it more maintainable to store and use the full URL directly | ||
| as plain text. | ||
|
|
||
| ## CMake Generate Arguments | ||
|
|
||
| Apply the following guidelines to the `CMAKE_GEN_ARGS` section of tasks that call | ||
| `deps:utils:install-remote-cmake-lib`: | ||
|
|
||
| * Set `CMP0074` to `NEW` whenever: | ||
| * The component's minimum required CMake version is less than 3.27 (where `CMP0074` defaults to | ||
| `OLD`) | ||
| * The component depends on another via `<lib_name>_ROOT`. | ||
|
|
||
| * Build both shared and static libraries when possible. | ||
|
|
||
| * Skip unit tests, examples, docs or unused binaries to speed up the installation process. | ||
|
|
||
| * Prefer disabling lib-specific testing flags (e.g., `CATCH_BUILD_TESTING=OFF`) rather than setting | ||
| the generic `BUILD_TESTING` to `OFF`. | ||
|
|
||
| * **Lastly**, while satisfying the above requirements, remove redundant flags that merely restate | ||
| default values found in `CMakeLists.txt` and others source CMake files, with two exceptions: | ||
Bill-hbrhbr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Set `CMAKE_BUILD_TYPE` to `Release` unless another build type is explicitly required. | ||
| * Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to reduce log verbosity during installation. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.