Rephrase "precompiled host" to "precompiled platform"

This is for clarity to Roc app developers, for whom "host" is not
necessarily in their Roc vocabulary. Additionally, this phrasing
is simply more accurate.
This commit is contained in:
Jan Van Bruggen 2022-09-05 21:45:02 -06:00
parent 97ce32ebde
commit 5663a1d9f9
No known key found for this signature in database
GPG key ID: FE2A4E38E0FA6134
4 changed files with 12 additions and 12 deletions

View file

@ -151,7 +151,7 @@ pub fn build_file<'a>(
// TODO this should probably be moved before load_and_monomorphize.
// To do this we will need to preprocess files just for their exported symbols.
// Also, we should no longer need to do this once we have platforms on
// a package repository, as we can then get precompiled hosts from there.
// a package repository, as we can then get precompiled platforms from there.
let exposed_values = loaded
.exposed_to_host
@ -192,7 +192,7 @@ pub fn build_file<'a>(
);
// TODO try to move as much of this linking as possible to the precompiled
// host, to minimize the amount of host-application linking required.
// platform, to minimize the amount of host-application linking required.
let app_o_file = Builder::new()
.prefix("roc_app")
.suffix(&format!(".{}", app_extension))
@ -330,7 +330,7 @@ pub fn build_file<'a>(
}
}
// Step 2: link the precompiled host and compiled app
// Step 2: link the precompiled platform and compiled app
let link_start = Instant::now();
let problems = match (linking_strategy, link_type) {
(LinkingStrategy::Surgical, _) => {

View file

@ -54,7 +54,7 @@ pub const FLAG_NO_LINK: &str = "no-link";
pub const FLAG_TARGET: &str = "target";
pub const FLAG_TIME: &str = "time";
pub const FLAG_LINKER: &str = "linker";
pub const FLAG_PRECOMPILED: &str = "precompiled-host";
pub const FLAG_PRECOMPILED: &str = "precompiled-platform";
pub const FLAG_CHECK: &str = "check";
pub const FLAG_WASM_STACK_SIZE_KB: &str = "wasm-stack-size-kb";
pub const ROC_FILE: &str = "ROC_FILE";
@ -106,7 +106,7 @@ pub fn build_app<'a>() -> Command<'a> {
let flag_precompiled = Arg::new(FLAG_PRECOMPILED)
.long(FLAG_PRECOMPILED)
.help("Assume the host has been precompiled and skip recompiling the host\n(This is enabled by default when using `roc build` with a --target other than `--target host`.)")
.help("Assume the platform has been precompiled and skip recompiling the platform\n(This is enabled by default when using `roc build` with a --target other than `--target host`.)")
.possible_values(["true", "false"])
.required(false);
@ -502,7 +502,7 @@ pub fn build(
let precompiled = if matches.is_present(FLAG_PRECOMPILED) {
matches.value_of(FLAG_PRECOMPILED) == Some("true")
} else {
// When compiling for a different target, default to assuming a precompiled host.
// When compiling for a different target, default to assuming a precompiled platform.
// Otherwise compilation would most likely fail because many toolchains assume you're compiling for the host
// We make an exception for Wasm, because cross-compiling is the norm in that case.
triple != Triple::host() && !matches!(triple.architecture, Architecture::Wasm32)

View file

@ -27,7 +27,7 @@ mod cli_run {
const OPTIMIZE_FLAG: &str = concatcp!("--", roc_cli::FLAG_OPTIMIZE);
const LINKER_FLAG: &str = concatcp!("--", roc_cli::FLAG_LINKER);
const CHECK_FLAG: &str = concatcp!("--", roc_cli::FLAG_CHECK);
const PRECOMPILED_HOST: &str = concatcp!("--", roc_cli::FLAG_PRECOMPILED, "=true");
const PRECOMPILED_PLATFORM: &str = concatcp!("--", roc_cli::FLAG_PRECOMPILED, "=true");
#[allow(dead_code)]
const TARGET_FLAG: &str = concatcp!("--", roc_cli::FLAG_TARGET);
@ -586,8 +586,8 @@ mod cli_run {
ran_without_optimizations = true;
});
// now we can pass the `PRECOMPILED_HOST` flag, because the `call_once` will
// have compiled the host
// now we can pass the `PRECOMPILED_PLATFORM` flag, because the `call_once` will
// have compiled the platform
if !ran_without_optimizations {
// Check with and without optimizations
@ -595,7 +595,7 @@ mod cli_run {
&file_name,
benchmark.stdin,
benchmark.executable_filename,
&[PRECOMPILED_HOST],
&[PRECOMPILED_PLATFORM],
&app_args,
benchmark.expected_ending,
benchmark.use_valgrind,
@ -606,7 +606,7 @@ mod cli_run {
&file_name,
benchmark.stdin,
benchmark.executable_filename,
&[PRECOMPILED_HOST, OPTIMIZE_FLAG],
&[PRECOMPILED_PLATFORM, OPTIMIZE_FLAG],
&app_args,
benchmark.expected_ending,
benchmark.use_valgrind,