fix: skip packages without C examples in examples-random-c#13137
Draft
Planeshifter wants to merge 1 commit into
Draft
fix: skip packages without C examples in examples-random-c#13137Planeshifter wants to merge 1 commit into
Planeshifter wants to merge 1 commit into
Conversation
Contributor
|
Hello! Thank you for your contribution to stdlib. We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:
This acknowledgment confirms that you've read the guidelines, which include:
We can't review or accept contributions without this acknowledgment. Thank you for your understanding and cooperation. We look forward to reviewing your contribution! |
`examples-random-c` uses `PACKAGES_PATTERN='binding.gyp'` to select random packages. NAPI utility packages (e.g. `@stdlib/napi/argv-*`) have `binding.gyp` for their Node.js native add-on but ship no C example file. When one of these packages was selected, `examples-c` failed to compile, causing the `random_examples` CI workflow to fail on ~53% of runs (16/30 in 30 days). Add a pre-flight guard that checks for `*.c` files inside the package's `examples/` directory before invoking `examples-c`. Packages without C examples are silently skipped, leaving the `binding.gyp` selection pool intact while eliminating the false-positive failures.
2b15081 to
8d44847
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes persistent
random_examplesCI failures (~53% failure rate, 16/30 runs in the last 30 days).Root cause
examples-random-cusesPACKAGES_PATTERN='binding.gyp'to select random packages. NAPI utility packages (e.g.@stdlib/napi/argv-complex64,@stdlib/napi/argv-dataview-cast) have abinding.gypfor their Node.js native add-on but ship noexamples/c/*.cfile. When one of these 98 packages was selected from the pool of 1514,examples-cfailed, aborting the workflow.With ~98/1514 (~6.5%) packages lacking C examples, the probability that at least one of 10 randomly selected packages fails is ~49%, matching the observed 53% failure rate.
Fix
Add a pre-flight
findguard before callingexamples-c. If a selected package has no*.cfiles under itsexamples/directory, it is silently skipped.This keeps the original
PACKAGES_PATTERN='binding.gyp'selection pool (changing it toexample.cwould be excluded byFIND_LIB_PACKAGES_EXCLUDE_FLAGSwhich strips**/examples/*paths, silently returning 0 packages).Validation
FIND_LIB_PACKAGES_EXCLUDE_FLAGSexcludesexamples/subdirs, leading to the guard approach