silent automake build - #895
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Automake configuration now enables silent build rules by default when supported. Users can disable them with ChangesAutomake silent build rules
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/bin/util/test/p11prov-test.sh`:
- Around line 127-129: Update the test cleanup flow around TOKEN_DIR so failures
from OpenSSL or SoftHSM commands also remove generated token objects and
private-key data before exiting. Register or invoke cleanup for both successful
and failed paths, covering the commands through the test completion logic near
lines 166 and 188-189, while preserving the existing TOKEN_DIR setup.
- Around line 89-97: Update the module-discovery loop in p11prov-test.sh to
consume find results without word splitting, preserving whitespace in each path
while retaining the existing *.so/*.dll filtering and P11MODULE assignment
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b171bddd-f89c-48a8-844c-eadd50bc92ac
📒 Files selected for processing (9)
.gitattributes.github/workflows/ci.ymlconfigure.acsrc/bin/util/test/.gitignoresrc/bin/util/test/CMakeLists.txtsrc/bin/util/test/Makefile.amsrc/bin/util/test/p11prov-test.shsrc/lib/SoftHSM.cppsrc/lib/SoftHSM.h
| for F in `find "$D" -name '*softhsm2.*'` ; do | ||
| case "$F" in | ||
| *.so|*.dll);; | ||
| *) continue;; | ||
| esac | ||
| test -f "$F" || continue | ||
| P11MODULE="$F" | ||
| break | ||
| done |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve module paths that contain whitespace.
Line 89 splits find output on whitespace. A build path with whitespace can set P11MODULE to an invalid path and fail the test.
Proposed fix
-P11MODULE=
-for F in `find "$D" -name '*softhsm2.*'` ; do
- case "$F" in
- *.so|*.dll);;
- *) continue;;
- esac
- test -f "$F" || continue
- P11MODULE="$F"
- break
-done
+P11MODULE=$(
+ find "$D" -type f \( -name '*softhsm2.so' -o -name '*softhsm2.dll' \) -print |
+ sed -n '1p'
+)🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 89-89: For loops over find output are fragile. Use find -exec or a while read loop.
(SC2044)
[style] 89-89: Use $(...) notation instead of legacy backticks ....
(SC2006)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/bin/util/test/p11prov-test.sh` around lines 89 - 97, Update the
module-discovery loop in p11prov-test.sh to consume find results without word
splitting, preserving whitespace in each path while retaining the existing
*.so/*.dll filtering and P11MODULE assignment behavior.
Source: Linters/SAST tools
| TOKEN_DIR="$CWD"/tokens | ||
| rm -rf "$TOKEN_DIR" | ||
| mkdir "$TOKEN_DIR" |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Clean up token data when a test command fails.
After line 166, a failed OpenSSL or SoftHSM command exits before line 189. The test then leaves token objects and the generated private key in tokens.
Proposed fix
TOKEN_DIR="$CWD"/tokens
rm -rf "$TOKEN_DIR"
mkdir "$TOKEN_DIR"
+trap 'rm -rf "$TOKEN_DIR"' 0Also applies to: 188-189
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/bin/util/test/p11prov-test.sh` around lines 127 - 129, Update the test
cleanup flow around TOKEN_DIR so failures from OpenSSL or SoftHSM commands also
remove generated token objects and private-key data before exiting. Register or
invoke cleanup for both successful and failed paths, covering the commands
through the test completion logic near lines 166 and 188-189, while preserving
the existing TOKEN_DIR setup.
bfee284 to
6f305dc
Compare
|
pushed again without unrelated changes for #864 |
Summary by CodeRabbit