You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by wy...@apache.org on 2026/09/16 08:16:18 UTC

(maka) branch feat/runtime-host-rust updated: fix(release): use portable paths for source archive workspaces

This is an automated email from the ASF dual-hosted git repository.

M4n5ter pushed a commit to branch feat/runtime-host-rust
in repository https://gitbox.apache.org/repos/asf/maka.git


The following commit(s) were added to refs/heads/feat/runtime-host-rust by this push:
     new dd151e1d1d fix(release): use portable paths for source archive workspaces
dd151e1d1d is described below

commit dd151e1d1d24bc330371aae2ee462d99e90ec709
Author: Wang <m4...@gmail.com>
AuthorDate: Wed Sep 16 16:16:11 2026 +0800

    fix(release): use portable paths for source archive workspaces
    
    Generated-by: OpenAI Codex
---
 scripts/asf-source-release.mjs      | 12 ++++++++----
 scripts/asf-source-release.test.mjs | 25 ++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/scripts/asf-source-release.mjs b/scripts/asf-source-release.mjs
index 5675a353db..73b05a9573 100644
--- a/scripts/asf-source-release.mjs
+++ b/scripts/asf-source-release.mjs
@@ -36,7 +36,7 @@ import {
   writeFileSync,
 } from 'node:fs';
 import { tmpdir } from 'node:os';
-import { basename, dirname, extname, join, resolve } from 'node:path';
+import { basename, dirname, extname, join, posix, resolve } from 'node:path';
 import { fileURLToPath } from 'node:url';
 
 const defaultRepoRoot = resolve(import.meta.dirname, '..');
@@ -619,7 +619,7 @@ function validateNodePackageInputs(candidateRoot, identity, entries) {
     }
     const dependencyNames = declaredPackageDependencies(manifest, entry);
     if (dependencyNames.length > 0) {
-      const directory = dirname(entry);
+      const directory = posix.dirname(entry);
       const lockEntry = [
         `${directory}/npm-shrinkwrap.json`,
         `${directory}/package-lock.json`,
@@ -653,7 +653,11 @@ function validateNodePackageInputs(candidateRoot, identity, entries) {
       if (!lockPath) continue;
       if (dependency?.link === true) {
         const name = lockPath.slice(lockPath.lastIndexOf('node_modules/') + 13);
-        const targetManifestEntry = join(dirname(entry), dependency.resolved ?? '', 'package.json');
+        const targetManifestEntry = posix.join(
+          posix.dirname(entry),
+          dependency.resolved ?? '',
+          'package.json',
+        );
         const targetManifest = manifests.get(targetManifestEntry);
         const targetLockPath = dependency.resolved;
         const targetLock = targetLockPath ? lock.packages[targetLockPath] : undefined;
@@ -669,7 +673,7 @@ function validateNodePackageInputs(candidateRoot, identity, entries) {
         continue;
       }
       if (!lockPath.includes('node_modules/')) {
-        const manifestEntry = join(dirname(entry), lockPath, 'package.json');
+        const manifestEntry = posix.join(posix.dirname(entry), lockPath, 'package.json');
         const manifest = manifests.get(manifestEntry);
         if (!manifest || manifest.name !== dependency.name) {
           throw new Error(`Cannot safely classify workspace package ${lockPath} in ${entry}`);
diff --git a/scripts/asf-source-release.test.mjs b/scripts/asf-source-release.test.mjs
index 39c6aa3b39..bbeeb48f1c 100644
--- a/scripts/asf-source-release.test.mjs
+++ b/scripts/asf-source-release.test.mjs
@@ -232,7 +232,30 @@ describe('ASF source release verification', () => {
     }
   });
 
-  test('rejects lock links without a candidate-owned workspace target', async () => {
+  test('binds workspace links to candidate-owned manifests using archive paths', async () => {
+    const owned = createFixtureCandidate({
+      'packages/runtime/package.json': JSON.stringify({
+        license: 'Apache-2.0',
+        name: '@maka/runtime',
+        version: '1.0.0',
+      }),
+      'package-lock.json': JSON.stringify({
+        lockfileVersion: 3,
+        name: 'maka',
+        version: '0.1.12',
+        packages: {
+          '': { name: 'maka', version: '0.1.12' },
+          'packages/runtime': { name: '@maka/runtime', version: '1.0.0' },
+          'node_modules/@maka/runtime': { link: true, resolved: 'packages/runtime' },
+        },
+      }),
+    });
+    try {
+      await assert.doesNotReject(() => verifySourceCandidate({ archivePath: owned.archivePath }));
+    } finally {
+      owned.cleanup();
+    }
+
     const fixture = createFixtureCandidate({
       'tools/runtime/package-lock.json': `${JSON.stringify({
         lockfileVersion: 3,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org