mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
add suppress warning flag, remove test test_roc_app_slim
This commit is contained in:
parent
64cc816e51
commit
9ecb209f73
4 changed files with 398 additions and 303 deletions
|
@ -70,6 +70,7 @@ pub const FLAG_TIME: &str = "time";
|
|||
pub const FLAG_VERBOSE: &str = "verbose";
|
||||
pub const FLAG_LINKER: &str = "linker";
|
||||
pub const FLAG_BUILD_HOST: &str = "build-host";
|
||||
pub const FLAG_SUPPRESS_BUILD_HOST_WARNING: &str = "suppress-build-host-warning";
|
||||
pub const FLAG_CHECK: &str = "check";
|
||||
pub const FLAG_STDIN: &str = "stdin";
|
||||
pub const FLAG_STDOUT: &str = "stdout";
|
||||
|
@ -139,12 +140,18 @@ pub fn build_app() -> Command {
|
|||
.value_parser(["surgical", "legacy"])
|
||||
.required(false);
|
||||
|
||||
let flag_prebuilt = Arg::new(FLAG_BUILD_HOST)
|
||||
let flag_build_host = Arg::new(FLAG_BUILD_HOST)
|
||||
.long(FLAG_BUILD_HOST)
|
||||
.help("WARNING: platforms are responsible for building hosts, this flag will be removed when internal test platforms have a build script")
|
||||
.action(ArgAction::SetTrue)
|
||||
.required(false);
|
||||
|
||||
let flag_supress_build_host_warning = Arg::new(FLAG_SUPPRESS_BUILD_HOST_WARNING)
|
||||
.long(FLAG_SUPPRESS_BUILD_HOST_WARNING)
|
||||
.help("WARNING: platforms are responsible for building hosts, this flag will be removed when internal test platforms have a build script")
|
||||
.action(ArgAction::SetTrue)
|
||||
.required(false);
|
||||
|
||||
let flag_wasm_stack_size_kb = Arg::new(FLAG_WASM_STACK_SIZE_KB)
|
||||
.long(FLAG_WASM_STACK_SIZE_KB)
|
||||
.help("Stack size in kilobytes for wasm32 target\n(This only applies when --dev also provided.)")
|
||||
|
@ -198,7 +205,8 @@ pub fn build_app() -> Command {
|
|||
.arg(flag_profiling.clone())
|
||||
.arg(flag_time.clone())
|
||||
.arg(flag_linker.clone())
|
||||
.arg(flag_prebuilt.clone())
|
||||
.arg(flag_build_host.clone())
|
||||
.arg(flag_supress_build_host_warning.clone())
|
||||
.arg(flag_fuzz.clone())
|
||||
.arg(flag_wasm_stack_size_kb)
|
||||
.arg(
|
||||
|
@ -250,7 +258,8 @@ pub fn build_app() -> Command {
|
|||
.arg(flag_profiling.clone())
|
||||
.arg(flag_time.clone())
|
||||
.arg(flag_linker.clone())
|
||||
.arg(flag_prebuilt.clone())
|
||||
.arg(flag_build_host.clone())
|
||||
.arg(flag_supress_build_host_warning.clone())
|
||||
.arg(flag_fuzz.clone())
|
||||
.arg(
|
||||
Arg::new(FLAG_VERBOSE)
|
||||
|
@ -281,7 +290,8 @@ pub fn build_app() -> Command {
|
|||
.arg(flag_profiling.clone())
|
||||
.arg(flag_time.clone())
|
||||
.arg(flag_linker.clone())
|
||||
.arg(flag_prebuilt.clone())
|
||||
.arg(flag_build_host.clone())
|
||||
.arg(flag_supress_build_host_warning.clone())
|
||||
.arg(flag_fuzz.clone())
|
||||
.arg(roc_file_to_run.clone())
|
||||
.arg(args_for_app.clone().last(true))
|
||||
|
@ -296,7 +306,8 @@ pub fn build_app() -> Command {
|
|||
.arg(flag_profiling.clone())
|
||||
.arg(flag_time.clone())
|
||||
.arg(flag_linker.clone())
|
||||
.arg(flag_prebuilt.clone())
|
||||
.arg(flag_build_host.clone())
|
||||
.arg(flag_supress_build_host_warning.clone())
|
||||
.arg(flag_fuzz.clone())
|
||||
.arg(roc_file_to_run.clone())
|
||||
.arg(args_for_app.clone().last(true))
|
||||
|
@ -431,7 +442,8 @@ pub fn build_app() -> Command {
|
|||
.arg(flag_profiling)
|
||||
.arg(flag_time)
|
||||
.arg(flag_linker)
|
||||
.arg(flag_prebuilt)
|
||||
.arg(flag_build_host)
|
||||
.arg(flag_supress_build_host_warning)
|
||||
.arg(flag_fuzz)
|
||||
.arg(roc_file_to_run)
|
||||
.arg(args_for_app.trailing_var_arg(true))
|
||||
|
@ -697,7 +709,6 @@ pub fn build(
|
|||
roc_cache_dir: RocCacheDir<'_>,
|
||||
link_type: LinkType,
|
||||
) -> io::Result<i32> {
|
||||
use roc_build::program::build_file;
|
||||
use BuildConfig::*;
|
||||
|
||||
let path = matches.get_one::<PathBuf>(ROC_FILE).unwrap();
|
||||
|
@ -845,10 +856,10 @@ pub fn build(
|
|||
LinkingStrategy::Surgical
|
||||
};
|
||||
|
||||
// TODO: remove once host rebuilding is no longer required
|
||||
// all hosts should be prebuilt, this flag keeps the rebuilding behvaiour
|
||||
// until no longer required for internal tests
|
||||
let rebuild_host = matches.get_flag(FLAG_BUILD_HOST);
|
||||
// All hosts should be prebuilt, this flag keeps the rebuilding behvaiour
|
||||
// as required for internal tests
|
||||
let build_host = matches.get_flag(FLAG_BUILD_HOST);
|
||||
let supress_build_host_warning = matches.get_flag(FLAG_SUPPRESS_BUILD_HOST_WARNING);
|
||||
|
||||
let fuzz = matches.get_flag(FLAG_FUZZ);
|
||||
if fuzz && !matches!(code_gen_backend, CodeGenBackend::Llvm(_)) {
|
||||
|
@ -876,7 +887,7 @@ pub fn build(
|
|||
|
||||
let load_config = standard_load_config(target, build_ordering, threading);
|
||||
|
||||
let res_binary_path = build_file(
|
||||
let res_binary_path = roc_build::program::build_file(
|
||||
&arena,
|
||||
target,
|
||||
path.to_owned(),
|
||||
|
@ -884,7 +895,8 @@ pub fn build(
|
|||
emit_timings,
|
||||
link_type,
|
||||
linking_strategy,
|
||||
rebuild_host,
|
||||
build_host,
|
||||
supress_build_host_warning,
|
||||
wasm_dev_stack_bytes,
|
||||
roc_cache_dir,
|
||||
load_config,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue