mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
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:
parent
97ce32ebde
commit
5663a1d9f9
4 changed files with 12 additions and 12 deletions
|
@ -151,7 +151,7 @@ pub fn build_file<'a>(
|
||||||
// TODO this should probably be moved before load_and_monomorphize.
|
// TODO this should probably be moved before load_and_monomorphize.
|
||||||
// To do this we will need to preprocess files just for their exported symbols.
|
// 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
|
// 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
|
let exposed_values = loaded
|
||||||
.exposed_to_host
|
.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
|
// 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()
|
let app_o_file = Builder::new()
|
||||||
.prefix("roc_app")
|
.prefix("roc_app")
|
||||||
.suffix(&format!(".{}", app_extension))
|
.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 link_start = Instant::now();
|
||||||
let problems = match (linking_strategy, link_type) {
|
let problems = match (linking_strategy, link_type) {
|
||||||
(LinkingStrategy::Surgical, _) => {
|
(LinkingStrategy::Surgical, _) => {
|
||||||
|
|
|
@ -54,7 +54,7 @@ pub const FLAG_NO_LINK: &str = "no-link";
|
||||||
pub const FLAG_TARGET: &str = "target";
|
pub const FLAG_TARGET: &str = "target";
|
||||||
pub const FLAG_TIME: &str = "time";
|
pub const FLAG_TIME: &str = "time";
|
||||||
pub const FLAG_LINKER: &str = "linker";
|
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_CHECK: &str = "check";
|
||||||
pub const FLAG_WASM_STACK_SIZE_KB: &str = "wasm-stack-size-kb";
|
pub const FLAG_WASM_STACK_SIZE_KB: &str = "wasm-stack-size-kb";
|
||||||
pub const ROC_FILE: &str = "ROC_FILE";
|
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)
|
let flag_precompiled = Arg::new(FLAG_PRECOMPILED)
|
||||||
.long(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"])
|
.possible_values(["true", "false"])
|
||||||
.required(false);
|
.required(false);
|
||||||
|
|
||||||
|
@ -502,7 +502,7 @@ pub fn build(
|
||||||
let precompiled = if matches.is_present(FLAG_PRECOMPILED) {
|
let precompiled = if matches.is_present(FLAG_PRECOMPILED) {
|
||||||
matches.value_of(FLAG_PRECOMPILED) == Some("true")
|
matches.value_of(FLAG_PRECOMPILED) == Some("true")
|
||||||
} else {
|
} 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
|
// 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.
|
// We make an exception for Wasm, because cross-compiling is the norm in that case.
|
||||||
triple != Triple::host() && !matches!(triple.architecture, Architecture::Wasm32)
|
triple != Triple::host() && !matches!(triple.architecture, Architecture::Wasm32)
|
||||||
|
|
|
@ -27,7 +27,7 @@ mod cli_run {
|
||||||
const OPTIMIZE_FLAG: &str = concatcp!("--", roc_cli::FLAG_OPTIMIZE);
|
const OPTIMIZE_FLAG: &str = concatcp!("--", roc_cli::FLAG_OPTIMIZE);
|
||||||
const LINKER_FLAG: &str = concatcp!("--", roc_cli::FLAG_LINKER);
|
const LINKER_FLAG: &str = concatcp!("--", roc_cli::FLAG_LINKER);
|
||||||
const CHECK_FLAG: &str = concatcp!("--", roc_cli::FLAG_CHECK);
|
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)]
|
#[allow(dead_code)]
|
||||||
const TARGET_FLAG: &str = concatcp!("--", roc_cli::FLAG_TARGET);
|
const TARGET_FLAG: &str = concatcp!("--", roc_cli::FLAG_TARGET);
|
||||||
|
|
||||||
|
@ -586,8 +586,8 @@ mod cli_run {
|
||||||
ran_without_optimizations = true;
|
ran_without_optimizations = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
// now we can pass the `PRECOMPILED_HOST` flag, because the `call_once` will
|
// now we can pass the `PRECOMPILED_PLATFORM` flag, because the `call_once` will
|
||||||
// have compiled the host
|
// have compiled the platform
|
||||||
|
|
||||||
if !ran_without_optimizations {
|
if !ran_without_optimizations {
|
||||||
// Check with and without optimizations
|
// Check with and without optimizations
|
||||||
|
@ -595,7 +595,7 @@ mod cli_run {
|
||||||
&file_name,
|
&file_name,
|
||||||
benchmark.stdin,
|
benchmark.stdin,
|
||||||
benchmark.executable_filename,
|
benchmark.executable_filename,
|
||||||
&[PRECOMPILED_HOST],
|
&[PRECOMPILED_PLATFORM],
|
||||||
&app_args,
|
&app_args,
|
||||||
benchmark.expected_ending,
|
benchmark.expected_ending,
|
||||||
benchmark.use_valgrind,
|
benchmark.use_valgrind,
|
||||||
|
@ -606,7 +606,7 @@ mod cli_run {
|
||||||
&file_name,
|
&file_name,
|
||||||
benchmark.stdin,
|
benchmark.stdin,
|
||||||
benchmark.executable_filename,
|
benchmark.executable_filename,
|
||||||
&[PRECOMPILED_HOST, OPTIMIZE_FLAG],
|
&[PRECOMPILED_PLATFORM, OPTIMIZE_FLAG],
|
||||||
&app_args,
|
&app_args,
|
||||||
benchmark.expected_ending,
|
benchmark.expected_ending,
|
||||||
benchmark.use_valgrind,
|
benchmark.use_valgrind,
|
||||||
|
|
|
@ -495,7 +495,7 @@ fn gen_from_mono_module_dev_wasm32(
|
||||||
|
|
||||||
let host_bytes = std::fs::read(preprocessed_host_path).unwrap_or_else(|_| {
|
let host_bytes = std::fs::read(preprocessed_host_path).unwrap_or_else(|_| {
|
||||||
panic!(
|
panic!(
|
||||||
"Failed to read host object file {}! Try setting --precompiled-host=false",
|
"Failed to read host object file {}! Try setting --precompiled-platform=false",
|
||||||
preprocessed_host_path.display()
|
preprocessed_host_path.display()
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue