Update --prebuilt-platform usage in comments and error messages.

This commit is contained in:
David Smith 2023-05-15 12:53:58 -04:00
parent e1e72a3713
commit 1aa45240fd
No known key found for this signature in database
GPG key ID: 979D8D09D9570EED
2 changed files with 8 additions and 7 deletions

View file

@ -528,7 +528,7 @@ fn gen_from_mono_module_dev_wasm32<'a>(
let host_bytes = std::fs::read(preprocessed_host_path).unwrap_or_else(|_| {
internal_error!(
"Failed to read host object file {}! Try setting --prebuilt-platform=false",
"Failed to read host object file {}! Try omitting --prebuilt-platform",
preprocessed_host_path.display()
)
});
@ -794,7 +794,7 @@ fn build_loaded_file<'a>(
};
// For example, if we're loading the platform from a URL, it's automatically prebuilt
// even if the --prebuilt-platform=true CLI flag wasn't set.
// even if the --prebuilt-platform CLI flag wasn't set.
let is_platform_prebuilt = prebuilt_requested || loaded.uses_prebuilt_platform;
let cwd = app_module_path.parent().unwrap();
@ -1036,9 +1036,10 @@ fn build_loaded_file<'a>(
}
fn invalid_prebuilt_platform(prebuilt_requested: bool, preprocessed_host_path: PathBuf) {
let prefix = match prebuilt_requested {
true => "Because I was run with --prebuilt-platform=true, ",
false => "",
let prefix = if prebuilt_requested {
"Because I was run with --prebuilt-platform, "
} else {
""
};
let preprocessed_host_path_str = preprocessed_host_path.to_string_lossy();
@ -1057,7 +1058,7 @@ fn invalid_prebuilt_platform(prebuilt_requested: bool, preprocessed_host_path: P
However, it was not there!{}
If you have the platform's source code locally, you may be able to generate it by re-running this command with --prebuilt-platform=false
If you have the platform's source code locally, you may be able to generate it by re-running this command omitting --prebuilt-platform
"#
),
prefix,

View file

@ -44,7 +44,7 @@ fn nixos_error_if_dynamic(url: &str, dest_dir: &Path) {
You can:\n\n\t\
- Download the source of the platform and build it locally, like in this example:\n\t \
https://github.com/roc-lang/roc/blob/main/examples/platform-switching/rocLovesRust.roc.\n\t \
When building your roc application, you can use the flag `--prebuilt-platform=true` to prevent the platform from being rebuilt every time.\n\t \
When building your roc application, you can use the flag `--prebuilt-platform` to prevent the platform from being rebuilt every time.\n\t \
For some graphical platforms you may need to use https://github.com/guibou/nixGL.\n\n\t\
- Contact the author of the platform to ask them to statically link their platform.\n\t \
musl can be used to prevent a dynamic dependency on the systems' libc.\n\t \