Skip to content

server:package produces different archive structures #199

Closed

Description

@gushinetsm

Description

Issue: tar.gz archives contain ./ prefix on all entries, zip archives don't

File: packages/server/scripts/tasks.js, line 1133

Problem:
makePackageAction calls createArchive(distPath, options.destDir, ".") — passing "." as the files argument.

In scripts/lib/download.js:210, this flows to:

await tar.create({file: archivePath, cwd: cwd, gzip: true}, files);
For tar.gz, this creates entries like ./DLLs/, ./ai/, ./engine, etc. (all prefixed with ./).

For zip, AdmZip.addLocalFolder(filepath, ".") normalizes the . away, so entries are DLLs/, ai/, engine — no prefix.

This means Linux and macOS archives extract with a . directory containing all files, while Windows zip extracts files directly at root.

Fix:
In packages/server/scripts/tasks.js line 1133, change:

await createArchive(distPath, options.destDir, ".");
to:

const entries = await readDir(options.destDir);
await createArchive(distPath, options.destDir, entries);
readDir is already imported. This passes actual entry names (e.g. ["DLLs", "ai", "engine", ...]) instead of ".", so tar produces entries without the ./ prefix — matching the zip behavior.

Steps to Reproduce

run server:package on different platforms (Win, Lin, Mac)

Expected vs Actual Behavior

server:package should produce identical structure under archive file

Severity

P2 - Medium (feature impaired, workaround exists)

Platform

  • Windows
  • macOS
  • Linux

Version / Environment

No response

Screenshots / Logs

Image

Activity

  1. added
    bug
    on Mar 5, 2026
  2. added a commit that references this issue on Mar 5, 2026
    acdd6a5
  3. dsapandora commented on Mar 6, 2026

    @dsapandora
    Collaborator

    @asclearuc I was able to reproduce it on on macOS (darwin-arm64): Ran ./builder server:package and inspected the generated .tar.gz with tar -tf. All entries use a ./ prefix (e.g. ./, ./ai/, ./engine, ./include/, etc.), matching the described behavior.

  4. dsapandora commented on Mar 6, 2026

    @dsapandora
    Collaborator

    @asclearuc After applying the fix suggested in your branch (using readDir(options.destDir) and passing the result to createArchive instead of "."): Re-ran server:package and listed the new tar.gz. Entries now have no ./ prefix (e.g. ai/, engine, include/, java/, lib/, nodes/).
    Extraction goes to the archive root, matching zip behaviour. Fix confirmed.

  5. added a commit that references this issue on Mar 6, 2026
    84c28e5
  6. added 2 commits that reference this issue on Nov 9, 2026
    806968c
    9f03738
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions