-
Notifications
You must be signed in to change notification settings - Fork 83
fix(build): Use checksum to skip mariadb-connector-cpp
rebuild.
#1415
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
sitaowang1998
wants to merge
11
commits into
y-scope:main
Choose a base branch
from
sitaowang1998:mariadb-cpp-task
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.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b079f4e
Use checksum to skip the mariadb rebuild
sitaowang1998 e073f09
Merge branch 'main' into mariadb-cpp-task
sitaowang1998 7ddc3e8
Fix docstring
sitaowang1998 61df0eb
Fix the subtask variable
sitaowang1998 25d0219
Merge branch 'main' into mariadb-cpp-task
sitaowang1998 d643708
Fix checksum dir
sitaowang1998 ab73f77
Merge branch 'mariadb-cpp-task' of github.com:sitaowang1998/clp into …
sitaowang1998 61bbdb3
Fix checksum directory
sitaowang1998 82cfa32
Only checksum the install directory
sitaowang1998 1733aee
Reorder task parameters
sitaowang1998 063316b
Reorder task attributes
sitaowang1998 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
Some comments aren't visible on the classic Files Changed page.
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 |
---|---|---|
|
@@ -390,27 +390,75 @@ tasks: | |
TARBALL_SHA256: "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b" | ||
TARBALL_URL: "https://github.com/lz4/lz4/releases/download/v1.10.0/lz4-1.10.0.tar.gz" | ||
|
||
mariadb-connector-cpp-download-and-validate-checksum: | ||
internal: true | ||
requires: | ||
vars: ["CHECKSUM_FILE"] | ||
cmds: | ||
- task: "yscope-dev-utils:remote:download-and-extract-tar" | ||
vars: | ||
FILE_SHA256: "0e3dfe9f2bc3f7bb6f7c159009556290064a7c23402ea08019fa8aebfc3ff2c9" | ||
OUTPUT_DIR: "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-extracted" | ||
URL: "https://github.com/mariadb-corporation/mariadb-connector-cpp/archive/refs/tags/\ | ||
1.1.5.tar.gz" | ||
# Uses checksum to skip mariadb-connector-cpp installation because the build updates the | ||
# source directory and will always rebuild. | ||
- task: "yscope-dev-utils:checksum:validate" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
INCLUDE_PATTERNS: &mariadb-cmake-include-patterns | ||
- "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-install" | ||
|
||
mariadb-connector-cpp: | ||
internal: true | ||
vars: | ||
# Cannot use dependency checksum directory because it is cleaned up in `utils:init`. | ||
CHECKSUM_FILE: "{{.G_DEPS_CPP_CHECKSUMS_DIR}}/mariadb-connector-cpp.md5" | ||
sources: | ||
- "{{.TASKFILE}}" | ||
- "{{.CHECKSUM_FILE}}" | ||
platforms: ["linux"] | ||
generates: ["{{.CHECKSUM_FILE}}"] | ||
run: "once" | ||
deps: | ||
- task: "mariadb-connector-cpp-download-and-validate-checksum" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
preconditions: | ||
# NOTE: The MariaDB connector is only required for building Spider, which is only supported on | ||
# Ubuntu. `INSTALL_LAYOUT` is currently hardcoded to "DEB". To support other Linux distros: | ||
# - Update the precondition accordingly. | ||
# - Make `INSTALL_LAYOUT` configurable. | ||
- >- | ||
source /etc/os-release && [[ "$ID" == "ubuntu" ]] | ||
internal: true | ||
run: "once" | ||
cmds: | ||
- task: "utils:install-remote-cmake-lib" | ||
# Copies extracted files so that the build won't pollute the extracted files and cause | ||
# unnecessary rebuilds. | ||
- |- | ||
rm -rf "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-src" | ||
cp -r "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-extracted" \ | ||
"{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-src" | ||
- task: "yscope-dev-utils:cmake:generate" | ||
Comment on lines
+438
to
+441
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Copy step is fine; consider rsync for robustness (optional) Current rm/cp works. If large trees or hidden files become an issue, rsync reduces risk and handles deletions: -rm -rf "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-src"
-cp -r "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-extracted" \
-"{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-src"
+rsync -a --delete "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-extracted/" \
+ "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-src/" 🤖 Prompt for AI Agents
|
||
vars: | ||
CMAKE_GEN_ARGS: | ||
BUILD_DIR: "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-build" | ||
EXTRA_ARGS: | ||
- "-DUSE_SYSTEM_INSTALLED_LIB=ON" | ||
- "-DINSTALL_LAYOUT=DEB" | ||
LIB_NAME: "mariadb-connector-cpp" | ||
TARBALL_URL: "https://github.com/mariadb-corporation/mariadb-connector-cpp/archive/refs/\ | ||
tags/1.1.5.tar.gz" | ||
TARBALL_SHA256: "0e3dfe9f2bc3f7bb6f7c159009556290064a7c23402ea08019fa8aebfc3ff2c9" | ||
SOURCE_DIR: "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-src" | ||
- task: "yscope-dev-utils:cmake:build" | ||
vars: | ||
BUILD_DIR: "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-build" | ||
JOBS: "{{.G_CPP_MAX_PARALLELISM_PER_BUILD_TASK}}" | ||
- task: "yscope-dev-utils:cmake:install" | ||
vars: | ||
BUILD_DIR: "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-build" | ||
CMAKE_PACKAGE_NAME: "mariadb-connector-cpp" | ||
CMAKE_SETTINGS_DIR: "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}" | ||
INSTALL_PREFIX: "{{.G_DEPS_CPP_DIR}}/mariadb-connector-cpp-install" | ||
- task: "yscope-dev-utils:checksum:compute" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
INCLUDE_PATTERNS: *mariadb-cmake-include-patterns | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
microsoft.gsl: | ||
internal: true | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Validate before downloading; add run: once and stable TAR_FILE
Run checksum:validate first to bail out early and skip the whole download/extract when install is unchanged. Also mark the helper run: "once" and set a stable TAR_FILE (and forward CHECKSUM_FILE) to maximise caching.
Also applies to: 406-411
🤖 Prompt for AI Agents