Skip to content

Patches from Debian package - #370

Open
keith-packard wants to merge 5 commits into
github:masterfrom
keith-packard:for-upstream
Open

keith-packard wants to merge 5 commits into
github:masterfrom
keith-packard:for-upstream

Conversation

@keith-packard

@keith-packard keith-packard commented Jan 6, 2025 •

Copy link
Copy Markdown

Here's a set of patches that I wrote as a part of packaging cmark-gfm for Debian.

  1. Install more headers for library users. I'm unsure whether these are still required, but as of gfm.6 they were.
  2. Add missing command line options to the man page.
  3. Add an environment variable, CMARK_TIMING_SCALE, to increase test timeouts. Some debian targets are so slow that even the generous timeouts aren't long enough. I use CMARK_TIMING_SCALE=10 for debian packaging to ensure that even hppa builds work.
  4. Fix python regex syntax errors in tests. Back slashes must be escaped (with another backslash) in regex strings.
  5. test/pathological_tests.py was using allowed_failures incorrectly.

These are needed to actually use the library it seems.

Signed-off-by: Keith Packard <keithp@keithp.com>
These options were documented in --help but missing from the man page.

Signed-off-by: Keith Packard <keithp@keithp.com>
Some hardware is really slow; let users set CMARK_TIMING_SCALE to
multiply the timeouts by an arbitrary amount

Signed-off-by: Keith Packard <keithp@keithp.com>
The regular expressions in normalize.py and pathological_tests.py are
missing a lot of backslashes -- you need two in the source file to get
one in the string.

Signed-off-by: Keith Packard <keithp@keithp.com>
The test needs to check if the test description is a valid key in the
allowed_failures dictionary instead of attempting to fetch from the
dictionary as most of the descriptions are not present in the
dictionary leading to a missing key error at runtime.

Signed-off-by: Keith Packard <keithp@keithp.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The installed headers omit config.h, and C timing-scale parsing is inconsistent with Python.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds Debian packaging improvements for headers, CLI documentation, timeout scaling, and test correctness.

Changes:

  • Installs additional library headers and documents missing CLI options.
  • Adds CMARK_TIMING_SCALE support to slow-test timeouts.
  • Corrects Python regex escaping and allowed-failure handling.
File Description
src/​CMakeLists.txt Installs additional headers.
man/​man1/​cmark-gfm.1 Documents four CLI options.
api_test/​main.c Scales C timing limits.
test/​pathological_tests.py Scales timeouts and fixes regex/failure handling.
test/​normalize.py Corrects regex string escaping.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/CMakeLists.txt
Comment on lines +178 to +180
install(FILES ${HEADERS}
DESTINATION include/cmark-gfm
)
Comment thread api_test/main.c
Comment on lines +945 to +950
static int _timing_scale = 1;
# define SETUP_TIMING() \
do { \
char *scale = getenv("CMARK_TIMING_SCALE"); \
if (scale) \
_timing_scale = atoi(scale); \
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.

2 participants