diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6829efe9db..9a07d60c08 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -7,7 +7,8 @@ name: Nightly Release Build jobs: build: name: Test and Build - runs-on: ubuntu-latest + runs-on: [self-hosted, i5-4690K] + timeout-minutes: 90 env: FORCE_COLOR: 1 # for earthly logging steps: diff --git a/.gitignore b/.gitignore index 6ad9f80e0a..83471bad32 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ bench-folder* # earthly earthly_log.txt + +# created to test release +roc_linux_x86_64.tar.gz diff --git a/Earthfile b/Earthfile index 259542f0e5..e9be646703 100644 --- a/Earthfile +++ b/Earthfile @@ -47,7 +47,7 @@ install-zig-llvm-valgrind-clippy-rustfmt: copy-dirs: FROM +install-zig-llvm-valgrind-clippy-rustfmt - COPY --dir cli compiler docs editor ast code_markup utils roc_std vendor examples linker Cargo.toml Cargo.lock ./ + COPY --dir cli compiler docs editor ast code_markup utils roc_std vendor examples linker Cargo.toml Cargo.lock version.txt ./ test-zig: FROM +install-zig-llvm-valgrind-clippy-rustfmt @@ -67,12 +67,14 @@ check-rustfmt: check-typos: RUN cargo install typos-cli --version 1.0.11 # version set to prevent confusion if the version is updated automatically - COPY --dir .github ci cli compiler docs editor examples ast code_markup utils linker nightly_benches packages roc_std www *.md LEGAL_DETAILS shell.nix ./ + COPY --dir .github ci cli compiler docs editor examples ast code_markup utils linker nightly_benches packages roc_std www *.md LEGAL_DETAILS shell.nix version.txt ./ RUN typos test-rust: FROM +copy-dirs ENV RUST_BACKTRACE=1 + # for race condition problem with cli test + ENV ROC_NUM_WORKERS=1 # run one of the benchmarks to make sure the host is compiled # not pre-compiling the host can cause race conditions RUN echo "4" | cargo run --release examples/benchmarks/NQueens.roc @@ -102,10 +104,14 @@ test-all: BUILD +verify-no-git-changes build-nightly-release: - FROM +test-all + FROM +test-rust + COPY --dir .git ./ + # version.txt is used by the CLI: roc version + RUN printf "nightly pre-release, built from commit " > version.txt + RUN git log --pretty=format:'%h' -n 1 >> version.txt RUN cargo build --release - RUN tar -czvf roc_linux_x86_64.tar.gz ./target/release/roc - SAVE ARTIFACT ./roc_linux_x86_64.tar.gz + RUN cd ./target/release && tar -czvf roc_linux_x86_64.tar.gz ./roc + SAVE ARTIFACT ./target/release/roc_linux_x86_64.tar.gz AS LOCAL roc_linux_x86_64.tar.gz # compile everything needed for benchmarks and output a self-contained dir from which benchmarks can be run. prep-bench-folder: diff --git a/cli/src/lib.rs b/cli/src/lib.rs index bfd4faea6e..99892eb6fd 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,5 +1,3 @@ -#[macro_use] -extern crate clap; #[macro_use] extern crate const_format; @@ -21,7 +19,6 @@ use target_lexicon::{Architecture, OperatingSystem, Triple, X86_32Architecture}; pub mod build; pub mod repl; -pub const CMD_RUN: &str = "run"; pub const CMD_BUILD: &str = "build"; pub const CMD_REPL: &str = "repl"; pub const CMD_EDIT: &str = "edit"; @@ -43,7 +40,7 @@ pub const ARGS_FOR_APP: &str = "ARGS_FOR_APP"; pub fn build_app<'a>() -> App<'a> { let app = App::new("roc") - .version(concatcp!(crate_version!(), "\n")) + .version(concatcp!(include_str!("../../version.txt"), "\n")) .about("Runs the given .roc file. Use one of the SUBCOMMANDS below to do something else!") .subcommand(App::new(CMD_BUILD) .about("Build a binary from the given .roc file, but don't run it") @@ -104,38 +101,6 @@ pub fn build_app<'a>() -> App<'a> { .required(false), ) ) - .subcommand(App::new(CMD_RUN) - .about("DEPRECATED - now use `roc [FILE]` instead of `roc run [FILE]`") - .setting(AppSettings::TrailingVarArg) - .arg( - Arg::with_name(FLAG_OPTIMIZE) - .long(FLAG_OPTIMIZE) - .help("Optimize the compiled program to run faster. (Optimization takes time to complete.)") - .required(false), - ) - .arg( - Arg::with_name(FLAG_DEV) - .long(FLAG_DEV) - .help("Make compilation as fast as possible. (Runtime performance may suffer)") - .required(false), - ) - .arg( - Arg::with_name(FLAG_DEBUG) - .long(FLAG_DEBUG) - .help("Store LLVM debug information in the generated program") - .required(false), - ) - .arg( - Arg::with_name(ROC_FILE) - .help("The .roc file of an app to run") - .required(true), - ) - .arg( - Arg::with_name(ARGS_FOR_APP) - .help("Arguments to pass into the app being run") - .multiple(true), - ) - ) .subcommand(App::new(CMD_REPL) .about("Launch the interactive Read Eval Print Loop (REPL)") ) diff --git a/cli/src/main.rs b/cli/src/main.rs index 52f065a386..252aded55a 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,7 +1,7 @@ use roc_cli::build::check_file; use roc_cli::{ build_app, docs, repl, BuildConfig, CMD_BUILD, CMD_CHECK, CMD_DOCS, CMD_EDIT, CMD_REPL, - CMD_RUN, DIRECTORY_OR_FILES, FLAG_TIME, ROC_FILE, + DIRECTORY_OR_FILES, FLAG_TIME, ROC_FILE, }; use roc_load::file::LoadingProblem; use std::fs::{self, FileType}; @@ -44,17 +44,6 @@ fn main() -> io::Result<()> { matches.subcommand_matches(CMD_BUILD).unwrap(), BuildConfig::BuildOnly, )?), - Some(CMD_RUN) => { - // TODO remove CMD_RUN altogether if it is currently September 2021 or later. - println!( - r#"`roc run` is deprecated! -If you're using a prebuilt binary, you no longer need the `run` - just do `roc [FILE]` instead of `roc run [FILE]`. -If you're building the compiler from source you'll want to do `cargo run [FILE]` instead of `cargo run run [FILE]`. -"# - ); - - Ok(1) - } Some(CMD_CHECK) => { let arena = bumpalo::Bump::new(); diff --git a/version.txt b/version.txt new file mode 100644 index 0000000000..27ffb11fc3 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ + \ No newline at end of file