Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 18, 2025

This PR adds a reusable CMake function hyperpage_add_archive() to simplify the common pattern of creating hyperpack archives during the build process.

Problem

Previously, creating hyperpack archives required manual setup of custom commands and dependencies:

add_custom_command(
    TARGET server POST_BUILD
    COMMAND $<TARGET_FILE:hyperpack> -o $<TARGET_FILE_DIR:server>/hyperpage.db ${CMAKE_CURRENT_SOURCE_DIR}/react-app/dist
    COMMENT "Building hyperpack archive from React app dist folder"
)
add_dependencies(server hyperpack)

This pattern is repetitive and error-prone when used across multiple targets or projects.

Solution

The new hyperpage_add_archive(name directory) function encapsulates this pattern:

hyperpage_add_archive(react_content "${CMAKE_CURRENT_SOURCE_DIR}/react-app/dist")
add_dependencies(server react_content)

Key Features

  • Simple Interface: Takes just a target name and directory path
  • Automatic Dependencies: Handles hyperpack executable dependency automatically
  • Target Properties: Sets HYPERPAGE_ARCHIVE_FILE property for consumers to access the output file path
  • Path Handling: Converts relative paths to absolute for better reliability
  • Error Validation: Validates required parameters with helpful error messages

Implementation Details

The function creates:

  1. A custom target named <name>
  2. A custom command that runs hyperpack to generate <name>.db in the build directory
  3. Proper dependencies on the hyperpack executable
  4. Target properties for easy access to the generated database file

Documentation

Added comprehensive inline documentation with usage examples and a demonstration in the example project showing how the new function can replace the existing manual approach.

Fixes #26.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • sqlite.org
    • Triggering command: /usr/local/bin/cmake -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P /home/REDACTED/work/hyperpage/hyperpage/build/_deps/sqlite3_ext-subbuild/sqlite3_ext-populate-prefix/src/sqlite3_ext-populate-stamp/download-sqlite3_ext-populate.cmake (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Contributor Author

Copilot AI commented Sep 18, 2025

@johnpatek 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (50ae22e) to head (867aaf6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #27   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           60        60           
  Branches         4         4           
=========================================
  Hits            60        60           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI and others added 2 commits September 18, 2025 14:47
Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
Copilot AI changed the title [WIP] CMake Function for Hyperpack Add CMake function for hyperpack archives Sep 18, 2025
Copilot AI requested a review from johnpatek September 18, 2025 14:51
@johnpatek johnpatek marked this pull request as ready for review September 18, 2025 14:51
@johnpatek johnpatek merged commit acd218c into master Sep 18, 2025
6 checks passed
@johnpatek johnpatek deleted the copilot/fix-26 branch September 18, 2025 14:52
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.

CMake Function for Hyperpack

2 participants