Skip to content

Commit 0d9b60c

Browse files
committed
fix: gate artifact downloads to Linux
1 parent d5b5a47 commit 0d9b60c

4 files changed

Lines changed: 12 additions & 20 deletions

File tree

docs/artifact-exchange.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ parents are rejected.
3838

3939
Downloads are streamed under `DEVSPACE_ARTIFACT_MAX_FILE_BYTES` and published as
4040
owner-only files without overwriting an existing destination. The tool is
41-
available on Linux, macOS, FreeBSD, OpenBSD, and NetBSD; it is not registered on
42-
Windows.
41+
currently available on Linux. It is not registered on macOS, Windows, or BSD
42+
because Node.js does not expose the required descriptor-relative filesystem
43+
operations there.

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ an attached or generated file into an already-open workspace:
4848
DEVSPACE_ARTIFACTS=1 npx @waishnav/devspace serve
4949
```
5050

51-
This feature currently supports Linux, macOS, FreeBSD, OpenBSD, and NetBSD. It
52-
is not registered on Windows because the secure publication path depends on
53-
descriptor-anchored directory operations.
51+
This feature currently supports Linux. It is not registered on macOS, Windows,
52+
or BSD because the secure publication path depends on traversable,
53+
descriptor-anchored directory paths provided by Linux procfs.
5454

5555
| Variable | Default | Purpose |
5656
| --- | --- | --- |

src/artifact-download.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ function testOneToolContract(): void {
9999

100100
function testPlatformSupportContract(): void {
101101
assert.equal(isArtifactDownloadSupportedPlatform("linux"), true);
102-
assert.equal(isArtifactDownloadSupportedPlatform("darwin"), true);
103-
assert.equal(isArtifactDownloadSupportedPlatform("freebsd"), true);
104-
assert.equal(isArtifactDownloadSupportedPlatform("openbsd"), true);
105-
assert.equal(isArtifactDownloadSupportedPlatform("netbsd"), true);
102+
assert.equal(isArtifactDownloadSupportedPlatform("darwin"), false);
103+
assert.equal(isArtifactDownloadSupportedPlatform("freebsd"), false);
104+
assert.equal(isArtifactDownloadSupportedPlatform("openbsd"), false);
105+
assert.equal(isArtifactDownloadSupportedPlatform("netbsd"), false);
106106
assert.equal(isArtifactDownloadSupportedPlatform("win32"), false);
107107
}
108108

src/artifact-tools.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ const PARTIAL_PREFIX = ".devspace-download-";
3535
const PARTIAL_SUFFIX = ".partial";
3636
const STALE_PARTIAL_AGE_MS = 24 * 60 * 60 * 1_000;
3737
const MAX_STALE_PARTIAL_CLEANUP = 32;
38-
const ARTIFACT_DOWNLOAD_PLATFORMS = new Set<NodeJS.Platform>([
39-
"linux",
40-
"darwin",
41-
"freebsd",
42-
"openbsd",
43-
"netbsd",
44-
]);
38+
const ARTIFACT_DOWNLOAD_PLATFORMS = new Set<NodeJS.Platform>(["linux"]);
4539

4640
const openAIFileReferenceInputSchema = z.strictObject({
4741
download_url: z.string(),
@@ -375,10 +369,7 @@ async function assertDirectoryHandle(handle: FileHandle): Promise<void> {
375369
}
376370

377371
function descriptorDirectoryPath(handle: FileHandle): string {
378-
if (process.platform === "linux") return `/proc/self/fd/${handle.fd}`;
379-
if (isArtifactDownloadSupportedPlatform()) {
380-
return `/dev/fd/${handle.fd}`;
381-
}
372+
if (isArtifactDownloadSupportedPlatform()) return `/proc/self/fd/${handle.fd}`;
382373
throw new ArtifactError(
383374
"artifact_platform_unsupported",
384375
"Native file download requires descriptor-anchored directory operations on this platform.",

0 commit comments

Comments
 (0)