Skip to content

Raising error for unsupported decentralized coordination for TypeScript target. - #2642

Merged
hokeun merged 7 commits into
masterfrom
ts
Jun 12, 2026
Merged

Raising error for unsupported decentralized coordination for TypeScript target.#2642
hokeun merged 7 commits into
masterfrom
ts

Conversation

@hokeun

@hokeun hokeun commented Jun 11, 2026

Copy link
Copy Markdown
Member

Problem: Currently, lfc compiles a TypeScript LF program with decentralized coordination in the target config without any error, even though decentralized coordination is not supported for TypeScript. Federated execution is supported with TypeScript, but only with centralized coordination.

@hokeun hokeun changed the title Error for unsupported decentralized coordination for TypeScript target. Raising error for unsupported decentralized coordination for TypeScript target. Jun 11, 2026
@hokeun
hokeun marked this pull request as ready for review June 11, 2026 19:41
@hokeun
hokeun requested a review from edwardalee June 11, 2026 19:41
… prepare git-hosted package fetched from "https://codeload.github.com/lf-lang/reactor-ts/tar.gz/87621f4c5a50b6a0c80cff43a1830938d83b340b": The git-hosted package "@lf-lang/reactor-ts@0.6.2" needs to execute build scripts but is not in the "allowBuilds" allowlist."

The root cause is clear: pnpm 10.x changed allowBuilds matching — for git-hosted packages it now requires the full resolved URL (with commit hash), not just the package name. Since the hash is only known after pnpm downloads the package, the static pnpm-workspace.yaml template can't pre-authorize it by name alone.

The reliable fix is dangerouslyAllowAllBuilds: true. Despite the name, it's safe here because these are generated, isolated project directories where we explicitly control every installed package — there's no risk of a malicious package sneaking in.
@hokeun hokeun added the bug Something isn't working label Jun 11, 2026
Comment thread core/src/main/resources/lib/ts/pnpm-workspace.yaml
hokeun added 2 commits June 11, 2026 14:08
…ifically 10.0–10.1) only matches git-hosted packages against their resolved specifier, i.e., the codeload URL with the specific commit hash (@lf-lang/reactor-ts@https://codeload.github.com/.../tar.gz/<sha>). The package name alone doesn't match. Since the hash is only known after pnpm fetches the package, we can never put the correct key in a static template file.

Why dangerouslyAllowAllBuilds: true works: This is a first-class pnpm 10 setting (defined in pnpm's config schema as dangerouslyAllowAllBuilds?: boolean) that bypasses the allowBuilds check entirely. It's safe to use here because these are generated, isolated project directories, every installed package is explicitly listed in a package.json we control, so there's no risk of a malicious package sneaking in.
@hokeun
hokeun requested a review from Jakio815 June 11, 2026 22:47
Comment thread core/src/main/java/org/lflang/validation/LFValidator.java Outdated

@edwardalee edwardalee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me. The dangerouslyAllowAllBuilds setting makes me nervous, but the explanation sounds reasonable.

@hokeun

hokeun commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Looks OK to me. The dangerouslyAllowAllBuilds setting makes me nervous, but the explanation sounds reasonable.

Thank you! Using allowBuilds fails due to a known limitation in pnpm 10 that prevents name-based allowlisting for git-hosted tarball dependencies, making dangerouslyAllowAllBuilds: true the only viable workaround for our CI tests. This flag should be safe here since our CI environment uses programmatically isolated, strictly controlled project directories with no exposure to unvetted third-party code.

@hokeun
hokeun added this pull request to the merge queue Jun 12, 2026
Merged via the queue into master with commit 16eb4d1 Jun 12, 2026
28 checks passed
@hokeun
hokeun deleted the ts branch June 12, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compiler validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants