Skip to content

mcpp pack per target: a DJGPP program is refused in the default mode, and a wasm32-emscripten package leaves out cmd.exe.wasm #1007

Open

Description

@speak-agent

Summary

Packing Sunrisepeak/cmd#1 (a C program with two program targets, cmd.exe and COMMAND.COM) target by target with mcpp 2026.11.22.1, mcpp pack --release --target <T> --all-programs:

Target Result
x86_64-linux-musl, x86_64-windows-gnu, x86_64-uefi, i686-dos-musl, x86_64-openkal packed, both programs in the package
i586-dos-djgpp refused in the default mode; packed with --mode static
wasm32-emscripten packed, but cmd.exe.wasm is missing; COMMAND.COM.wasm is there

Neither blocks the project: its release uses --mode static for the DJGPP row and the web directory (--pkg-format web, complete) for WebAssembly.

1. DJGPP: the default (vendored) mode refuses a DJGPP program

     Packing cmd v0.1.0 (vendored, stripped)
error: cannot package the unknown artifact 'COMMAND.COM' yet.
       Its dependency closure is resolved by running the artifact under its own
       dynamic linker, and this file is neither ELF, PE nor Mach-O -- there is no
       such linker to ask.

A DJGPP program (COFF under a go32 stub) has no dynamic linker and links everything statically, so its closure is empty by construction. --mode static packs it (cmd-0.1.0-i586-dos-djgpp-static.tar.gz, both programs). Expected: the row (or djgpp-platform) states that its programs are static, so the default mode packs them as i686-dos-musl is packed, without a flag the user has to find.

2. wasm32-emscripten: one program's .wasm is left out

The build directory holds both programs' launcher and module:

target/wasm32-emscripten/<fp>/bin/: cmd.exe.js  cmd.exe.wasm  COMMAND.COM.js  COMMAND.COM.wasm

The package holds three of them:

cmd-0.1.0-wasm32-emscripten/bin/COMMAND.COM.js
cmd-0.1.0-wasm32-emscripten/bin/COMMAND.COM.wasm
cmd-0.1.0-wasm32-emscripten/bin/cmd.exe.js

cmd.exe.js cannot run without cmd.exe.wasm. The difference between the two programs is the name: cmd.exe already ends in .exe. The project's build program keeps the row's suffix on this row (mcpp::artifact_name is not called for emscripten), so the files are cmd.exe.js / cmd.exe.wasm; a guess is that the companion of cmd.exe.js is looked up from a name with .exe treated as a suffix (cmd.wasm), which does not exist. mcpp pack --pkg-format web copies cmd.exe.wasm correctly.

Reproduce

git clone -b mcpp-openkal-platforms https://github.com/Sunrisepeak/cmd && cd cmd
mcpp pack --release --target i586-dos-djgpp --all-programs -o out/       # error above
mcpp pack --release --target i586-dos-djgpp --all-programs --mode static -o out/   # packs
mcpp pack --release --target wasm32-emscripten --all-programs -o out/    # no cmd.exe.wasm
tar -tzf out/cmd-*-wasm32-emscripten.tar.gz | grep bin/

Activity

  1. speak-agent commented on Nov 22, 2026

    @speak-agent
    MemberAuthor

    A third finding while staging a release, same mcpp (2026.11.22.1):

    mcpp pack -o dist/pack/ empties the project's dist/. Files placed in dist/bare/ before the pack are gone after it (the directory stays, its files do not). With the output elsewhere (-o rel/pack/) sibling directories keep their files and earlier packages in the output directory stay.

    mkdir -p dist/bare && echo x > dist/bare/marker
    mcpp pack --release --target x86_64-linux-musl --all-programs -o dist/pack/
    ls dist/bare            # empty
    
    mkdir -p rel/bare && echo x > rel/bare/marker
    mcpp pack --release --target x86_64-linux-musl --all-programs -o rel/pack/
    ls rel/bare             # marker

    Expected: a pack writes into the directory it is given and leaves anything else the user put there. The project stages its release in rel/ meanwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions