Skip to content

build:sandbox fails due to incorrect tarball filename expectation #7

@dCodes03

Description

@dCodes03

The npm run build:all command fails with an ENOENT error when trying to chmod the packed tarball files. The script expects a different filename pattern than what npm pack actually generates for scoped packages.

Error

Error: ENOENT: no such file or directory, chmod 'packages/cli/dist/blackbox-cli-blackbox-cli-0.1.4.tgz'
    at chmodSync (node:fs:1996:11)
    at file:///Users/dhruvil.kakadiya@zomato.com/Projects/cli/scripts/build_sandbox.js:117:1

When npm pack creates a tarball from a scoped package like @blackbox_ai/blackbox-cli, it converts the package name according to npm's naming convention:

  • Expected by script: blackbox-cli-blackbox-cli-0.1.4.tgz
  • Actually generated: blackbox_ai-blackbox-cli-0.1.4.tgz
Image

The script in build_sandbox.js assumes an incorrect naming pattern for the tarball files.

Affected Files

  • packages/cli/dist/blackbox_ai-blackbox-cli-0.1.4.tgz (actual)
  • packages/core/dist/blackbox_ai-blackbox-cli-core-0.1.4.tgz (actual)

Steps to Reproduce

  1. Clone the repository
  2. Run npm install
  3. Run npm run build:all
  4. Observe the error during the build:sandbox step

Expected Behavior

The build:sandbox script should correctly reference the tarball filenames generated by npm pack for scoped packages.

Proposed Solution

Update build_sandbox.js lines 117-126 to use the correct tarball naming convention:

Proposed Solution

Update build_sandbox.js lines 117-126 to use the correct tarball naming convention:

// Current (incorrect):
chmodSync(
  join(cliPackageDir, 'dist', `blackbox-cli-blackbox-cli-${packageVersion}.tgz`),
  0o755,
);
chmodSync(
  join(
    corePackageDir,
    'dist',
    `blackbox-cli-blackbox-cli-core-${packageVersion}.tgz`,
  ),
  0o755,
);

// Should be:
chmodSync(
  join(cliPackageDir, 'dist', `blackbox_ai-blackbox-cli-${packageVersion}.tgz`),
  0o755,
);
chmodSync(
  join(
    corePackageDir,
    'dist',
    `blackbox_ai-blackbox-cli-core-${packageVersion}.tgz`,
  ),
  0o755,
);

Additional Context

  • Node.js version: v20.19.0
  • Package version: 0.1.4
  • Command: npm run build:all
  • Exit code: 1

The issue affects the entire build:all pipeline as it prevents the sandbox build step from completing successfully.

Severity

High - Blocks the build process and prevents developers from building the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions