Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ latest one; the GitHub release carries the same notes.
MattCozendey); a `!` program built for the CPU because no CUDA toolkit
was found says so (PR #1888); colliding output requests are refused
before anything is written (PR #2010 by vicmcorrea); a hyphenated
published file prints valid aliases (PR #1849 by vicmcorrea).
published file prints valid aliases (PR #1849 by vicmcorrea);
`--checkup` resolves imports from a symlinked entry's real directory.
- **Fixes**:
- Checker and verdict: a law names its module's own def when a Base
constructor shares the name (#1236, PR #2047 by nicolas-abril); `!=`
Expand Down
4 changes: 3 additions & 1 deletion bend2/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ async function cli_file(args: string[]): Promise<void> {
async function cli_checkup(file: string): Promise<void> {
const base = await book_read(BASE);
let bad = false;
file = fs.realpathSync(file);
const dir = path.dirname(file);
for (const raw of fs.readFileSync(file, "utf8").split("\n")) {
const line = raw.trim();
if (line === "" || line.startsWith("#")) {
Expand All @@ -370,7 +372,7 @@ async function cli_checkup(file: string): Promise<void> {
continue;
}
const at = m[1].startsWith("/") ? m[1]
: path.join(path.dirname(file), m[1]);
: path.join(dir, m[1]);
cli_say(1, "--- " + m[1] + " ---\n");
let code = 1;
try {
Expand Down
7 changes: 7 additions & 0 deletions gates/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@ try {
check("valid body literal text does not add an independent import",
header_check.code === 0 && header_run.code === 0
&& header_run.out.endsWith("5n\n"));
const alias_dir = path.join(TMP, "checkup-alias");
fs.mkdirSync(alias_dir);
const alias = path.join(alias_dir, "entry.bend");
fs.symlinkSync(header_source, alias);
const linked = await bend([alias, "--checkup"], { BEND_NO_TELEMETRY: "1" });
check("--checkup resolves imports from the symlink target's directory",
linked.code === 0 && linked.out === header_run.out);
const no_base = path.join(TMP, "no-base.bend");
fs.writeFileSync(no_base,
"def main() -> String:\n \"body\nimport Base\n\"\n");
Expand Down