Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

The todmp tool now accepts .dmd (DMOD Dependencies) files to specify which modules to include in a DMP package, instead of packaging all modules in a directory.

Note: .dmd file support is only available when building with CMake. When building with Make, only directory-based packaging is supported.

Changes

Core functionality:

  • Parse .dmd files using existing dmod_dependencies library
  • Filter modules: copy only specified modules to temporary directory before packaging
  • Auto-select first module in .dmd as main module (overridable via CLI parameter)
  • Conditional compilation: .dmd support wrapped with #ifdef DMOD_ENABLE_DMD_SUPPORT

Build system:

  • CMake build: Links dmod_dependencies library and defines DMOD_ENABLE_DMD_SUPPORT
  • Make build: No additional dependencies, .dmd support disabled (directory-based packaging only)
  • Created Makefile for dmod_dependencies library for future use

Implementation details:

  • Use mkdtemp() for secure temp directory creation
  • Buffered file copying (64KB chunks) for memory efficiency
  • Proper cleanup on all error paths, skip . and .. entries

Documentation:

  • Added .dmd usage examples and workflow integration
  • Created integration tests covering parsing, filtering, and main module selection
  • Documented CMake-only limitation for .dmd support

Usage

With CMake build (includes .dmd support):

# deps.dmd
core_module
network_stack
filesystem

# Creates package with only these 3 modules, core_module as main
todmp myapp deps.dmd ./modules ./myapp.dmp

# Override main module
todmp myapp deps.dmd ./modules ./myapp.dmp network_stack

With Make build (directory-based only):

# Packages all modules in directory
todmp myapp ./modules ./myapp.dmp

Modules must already be downloaded in the input directory - version specifiers in .dmd are ignored during packaging.

Original prompt

This section details on the original issue you should resolve

<issue_title>Dodać wsparcie dla dmd w todmp</issue_title>
<issue_description>Powinna być możliwość tworzenia paczki na podstawie pliku *.dmd. Z założenia moduły już mają być oczywiście pobrane wcześniej, chodzi tylko o to, żeby wiedzieć które moduły mają być umieszczone w paczce. No i też o to, żeby główny moduł (jeśli nie jest podany w parametrach) to był ten, który jest pierwszy w pliku dmd</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 19, 2025 14:48
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for dmd in todmp Add .dmd file support to todmp for selective module packaging Dec 19, 2025
Copilot AI requested a review from JohnAmadis December 19, 2025 15:04
@JohnAmadis
Copy link
Contributor

@copilot dla make sie nie buduje

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 19, 2025

@copilot dla make sie nie buduje

Fixed in commit 7337da4. The .dmd file support is now conditional - it's only available when building with CMake. The Make build works as before without .dmd support.

When building with Make, todmp will only support directory-based packaging (existing functionality). The .dmd file features are available when building with CMake, which properly links the required dmod_dependencies library.

Copilot AI changed the title Add .dmd file support to todmp for selective module packaging Add .dmd file support to todmp for selective module packaging (CMake only) Dec 19, 2025
Copilot AI requested a review from JohnAmadis December 19, 2025 15:48
@JohnAmadis JohnAmadis marked this pull request as ready for review December 19, 2025 17:30
@JohnAmadis JohnAmadis merged commit 9c0e3ed into develop Dec 19, 2025
4 checks passed
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.

Dodać wsparcie dla dmd w todmp

2 participants