Skip to content

chore(deps): bump epub4j and epub4j-native versions to 1.4.0#1090

Open
balazs-szucs wants to merge 1 commit intogrimmory-tools:developfrom
balazs-szucs:bump-epub4j-again
Open

chore(deps): bump epub4j and epub4j-native versions to 1.4.0#1090
balazs-szucs wants to merge 1 commit intogrimmory-tools:developfrom
balazs-szucs:bump-epub4j-again

Conversation

@balazs-szucs
Copy link
Copy Markdown
Member

@balazs-szucs balazs-szucs commented May 4, 2026

Description

i bumped epub4j, had to manually due to the fact that package signatures changes, previously all native binaries were bundled together, now they are part of their respective packages, hence i needed to adjust this.

Linked Issue

Changes

Manual Testing Steps

  1. deleted library, and remade it
  2. confirmed that epub were parsed in right

Screenshots (Optional)

Additional Context (Optional)

AI Disclosure

Checklist

  • This PR links and implements an accepted issue.
  • This PR is a single focused change.
  • There are new or updated tests validating this change.
  • I ran just ui check and just api check.
  • I have added screenshots if there were any UI changes.
  • I have disclosed any AI usage as per the organization AI Policy above.
  • I understand all of my submitted changes.

Summary by CodeRabbit

  • Chores
    • Improved native library detection for Linux systems with better musl libc support.
    • Updated EPUB processing library from version 1.2.0 to 1.4.0 with improved dependency management.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Walkthrough

The pull request enhances native library classifier selection in the Gradle build configuration. It refactors pdfiumNativesClassifier() to use runCatching for musl detection and updates it to respect optional TARGETLIBC overrides. A new epub4jNativesClassifier() function is added with parallel logic for cross-platform support. epub4j dependencies are upgraded from 1.2.0 to 1.4.0, with a new runtimeOnly configuration using the classifier function.

Changes

Native Library Classifier Selection

Layer / File(s) Summary
Core Logic
backend/build.gradle.kts (lines 68–84, 97–145)
Enhanced pdfiumNativesClassifier() to use runCatching for musl detection and support optional TARGETLIBC/targetLibc override. New epub4jNativesClassifier() function added with Docker-style TARGETPLATFORM/TARGETARCH support, mapping macOS to macos, Linux with optional musl detection, and architectures to x86_64/aarch64.
Dependency Wiring
backend/build.gradle.kts (lines 190–197)
epub4j-core and epub4j-native versions updated from 1.2.0 to 1.4.0; epub4j-native now includes a runtimeOnly dependency using epub4jNativesClassifier() to select the appropriate native binary.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

backend, chore

Suggested reviewers

  • zachyale
  • imajes
  • imnotjames

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Description check ❌ Error Pull request description is incomplete and missing required sections with proper content. Provide a linked issue number (Fixes #xxx), expand Changes section with bullet points listing modifications, and complete AI Disclosure field. The 'Linked Issue' section should not be empty.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title follows the conventional commit format with 'chore(deps):' prefix and clearly describes the main change of bumping epub4j versions to 1.4.0.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@backend/build.gradle.kts`:
- Around line 97-145: The platform/arch and libc-detection logic is duplicated
between epub4jNativesClassifier() and pdfiumNativesClassifier(); extract two
private helper functions (e.g., resolveTargetPlatformAndArch(project):
Pair<String?,String?> and detectMuslLibc(project, targetPlatform, targetArch):
String /*returns "linux" or "linux-musl"*/ ) that encapsulate: (1) resolving
TARGETPLATFORM/TARGETARCH from env or project properties and computing osName
and arch, and (2) resolving TARGETLIBC/project targetLibc, checking /lib for
ld-musl-*, and fallback /proc/self/maps check; then replace the duplicated
blocks in epub4jNativesClassifier() and pdfiumNativesClassifier() to call these
helpers and keep the existing osKey/archKey mapping and error behavior
unchanged.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: d0ad3071-5699-467b-802d-1e3cdcd4bbfe

📥 Commits

Reviewing files that changed from the base of the PR and between f3138a8 and f1c7f29.

📒 Files selected for processing (1)
  • backend/build.gradle.kts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test Suite / Backend Tests
  • GitHub Check: Test Suite / Frontend Tests
  • GitHub Check: Frontend Lint Threshold Check
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (1)
**/*

⚙️ CodeRabbit configuration file

**/*: This project is being developed using current and future-facing technologies:

  • Java 25 with --enable-preview (preview features are INTENTIONAL and encouraged)
  • Spring Boot 4 (latest major version, check APIs accordingly)
  • Jackson 3 (new package: tools.jackson.* instead of com.fasterxml.jackson.*)
  • Hibernate 7.3.x (Jakarta Persistence 3.2, new APIs; avoid deprecated Hibernate 5/6 patterns)
  • Angular 21 (signals-based reactivity, no NgModules unless legacy)

Grimmory Internal Tools

Metadata Standards and Compliance

  • For all metadata writing and parsing logic, double-check against Dublin Core and ANSI standards to ensure perfect official compliance.
  • We strictly follow the widespread and official XML-compliant methods for EPUB2, EPUB3, CBX, and PDF formats.

General Java and Spring rules

  • ALWAYS prefer modern, idiomatic Java 25 constructs over legacy patterns.
  • Preview features (--enable-preview) are enabled and intentional; do NOT flag them as risky unless there is a concrete runtime issue.
  • Prefer: records, sealed classes/interfaces, pattern matching (switch expressions, instanceof), structured concurrency (StructuredTaskScope), scoped values, string templates, unnamed patterns/variables.
  • Prefer virtual threads (Thread.ofVirtual(), Executors.newVirtualThreadPerTaskExecutor()) over platform threads for I/O-bound work.
  • Prefer the new Sequenced Collections API (SequencedCollection, SequencedMap) where applicable.
  • Prefer var for local variables when the type is obvious from context.
  • Use stream().toList() instead of stream().collect(Collectors.toList()) for imm...

Files:

  • backend/build.gradle.kts
🧠 Learnings (2)
📚 Learning: 2026-03-31T06:22:25.311Z
Learnt from: imnotjames
Repo: grimmory-tools/grimmory PR: 113
File: booklore-api/build.gradle.kts:89-90
Timestamp: 2026-03-31T06:22:25.311Z
Learning: When reviewing build logic or CI checks that call the JitPack build status API, do not treat a response like {"status":"none"} as evidence that a dependency is unavailable or that a build has failed. JitPack typically builds packages on-demand the first time they’re requested (e.g., via Gradle); "none" means the package isn’t pre-built/cached yet. Only raise a build failure concern when the status explicitly indicates an error/failure (e.g., failed/cancelled), or when dependent resolution actually fails.

Applied to files:

  • backend/build.gradle.kts
📚 Learning: 2026-04-02T09:12:48.158Z
Learnt from: balazs-szucs
Repo: grimmory-tools/grimmory PR: 334
File: booklore-api/build.gradle.kts:0-0
Timestamp: 2026-04-02T09:12:48.158Z
Learning: In this repo, nightcompress (groupId `com.github.gotson.nightcompress`, artifact `nightcompress`) is the preferred library for archive/unarchive operations (including RAR and other formats). During code review, flag changes to Gradle dependency declarations that remove nightcompress or replace it with an alternative for unarchiving (e.g., junrar, commons-compress, JNI-based libraries, or standard Java `ZipInputStream`/`ZipFile`) unless there’s a justified exception. Exceptions are acceptable only when nightcompress cannot handle a specific archive format; in that case, require the PR to clearly document the format limitation, the alternative being used, and get maintainer confirmation of the trade-off.

Applied to files:

  • backend/build.gradle.kts
🔇 Additional comments (1)
backend/build.gradle.kts (1)

138-144: The generated classifiers correctly match the expected platform-architecture combinations for epub4j-native:1.4.0. The epub4jNativesClassifier() function produces linux-x86_64, linux-aarch64, linux-musl-x86_64, linux-musl-aarch64, macos-x86_64, macos-aarch64, and windows-x86_64—exactly the classifiers published for the native library. No Gradle dependency resolution issues are expected.

Comment thread backend/build.gradle.kts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant