Skip to content

Commit c1f5e6e

Browse files
Print out exact sbt command to regenerate caches
1 parent a5a588e commit c1f5e6e

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

.vscode/launch.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@
4141
"name": "Rust Gen CI",
4242
"program": "${workspaceFolder}/target/rust/debug/enso-build-ci-gen",
4343
"args": []
44-
}
44+
},
45+
{
46+
"type": "lldb",
47+
"request": "launch",
48+
"preLaunchTask": "Rust ./run",
49+
"name": "Rust ./run",
50+
"program": "${workspaceFolder}/target/rust/buildscript/enso-build-cli",
51+
// provide arguments, for example:
52+
"args": ["backend", "stdlib-api-check"]
53+
// "args": []
54+
},
4555
]
4656
}

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
"isDefault": true
1414
},
1515
"label": "Rust Gen CI"
16+
},
17+
{
18+
"type": "cargo",
19+
"command": "build",
20+
"args": ["--profile", "buildscript", "-p", "enso-build-cli"],
21+
"problemMatcher": [
22+
"$rustc"
23+
],
24+
"group": {
25+
"kind": "build",
26+
"isDefault": true
27+
},
28+
"label": "Rust ./run"
1629
}
1730
]
1831
}

build_tools/build/src/engine/context.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ impl RunContext {
620620
assert!(old_api_dir.exists());
621621
debug!(
622622
"Checking API for library Standard.{}, its API dir is in {:?}",
623-
lib.name, old_api_dir
623+
lib.name,
624+
self.short_path(&old_api_dir)
624625
);
625626
// `lib_path_in_built_distribution` points to the lib in the `built-distribution`
626627
// directory, which is not under VCS. We will regenerate the API in this directory
@@ -645,23 +646,27 @@ impl RunContext {
645646
match diff {
646647
Ok(_) => Ok(()),
647648
Err(err) => {
648-
let suggested_cmd = built_enso
649-
.cmd()?
650-
.with_arg("--docs")
651-
.with_arg("api")
652-
.with_arg("--in-project")
653-
.with_arg(lib.path.clone());
654649
error!("API check failed for library Standard.{}", lib.name);
655650
error!("Current API vs Old API: {}", err);
656-
error!("If you wish to overwrite the current API in the directory {}, run the following command {},
651+
error!("If you wish to overwrite the current API in the directory {}, run the following command
652+
sbt \"runEngineDistribution --no-ir-caches --docs=api --in-project {}\"
657653
and commit the modified files",
658-
old_api_dir.display(),
659-
suggested_cmd.describe()
654+
self.short_path(&old_api_dir).display(),
655+
self.short_path(&lib.path).display()
660656
);
661657
bail!("API check failed for library Standard.{}", lib.name);
662658
}
663659
}
664660
}
661+
662+
fn short_path(&self, full: &PathBuf) -> PathBuf {
663+
let strip = full.strip_prefix(self.repo_root.path.clone());
664+
if let Ok(relative) = strip {
665+
relative.to_path_buf()
666+
} else {
667+
full.clone()
668+
}
669+
}
665670
}
666671

667672
#[derive(Debug)]

0 commit comments

Comments
 (0)