Merge branch 'trunk' of github.com:rtfeldman/roc into pure-roc-list-walk

This commit is contained in:
Brian Carroll 2022-07-02 18:08:43 +01:00
commit 219e6d11cf
No known key found for this signature in database
GPG key ID: 9CF4E3BF9C4722C7
1067 changed files with 105 additions and 104 deletions

View file

@ -1,56 +1,56 @@
[workspace] [workspace]
members = [ members = [
"compiler/ident", "crates/compiler/ident",
"compiler/region", "crates/compiler/region",
"compiler/collections", "crates/compiler/collections",
"compiler/exhaustive", "crates/compiler/exhaustive",
"compiler/module", "crates/compiler/module",
"compiler/parse", "crates/compiler/parse",
"compiler/can", "crates/compiler/can",
"compiler/problem", "crates/compiler/problem",
"compiler/types", "crates/compiler/types",
"compiler/builtins", "crates/compiler/builtins",
"compiler/constrain", "crates/compiler/constrain",
"compiler/unify", "crates/compiler/unify",
"compiler/solve", "crates/compiler/solve",
"compiler/late_solve", "crates/compiler/late_solve",
"compiler/fmt", "crates/compiler/fmt",
"compiler/derive_key", "crates/compiler/derive_key",
"compiler/mono", "crates/compiler/mono",
"compiler/alias_analysis", "crates/compiler/alias_analysis",
"compiler/test_mono", "crates/compiler/test_mono",
"compiler/test_derive", "crates/compiler/test_derive",
"compiler/load", "crates/compiler/load",
"compiler/load_internal", "crates/compiler/load_internal",
"compiler/gen_llvm", "crates/compiler/gen_llvm",
"compiler/gen_dev", "crates/compiler/gen_dev",
"compiler/gen_wasm", "crates/compiler/gen_wasm",
"compiler/build", "crates/compiler/build",
"compiler/arena_pool", "crates/compiler/arena_pool",
"compiler/test_gen", "crates/compiler/test_gen",
"compiler/roc_target", "crates/compiler/roc_target",
"compiler/debug_flags", "crates/compiler/debug_flags",
"vendor/inkwell", "crates/vendor/inkwell",
"vendor/pathfinding", "crates/vendor/pathfinding",
"vendor/pretty", "crates/vendor/pretty",
"bindgen", "crates/bindgen",
"editor", "crates/editor",
"ast", "crates/ast",
"cli", "crates/cli",
"code_markup", "crates/code_markup",
"highlight", "crates/highlight",
"error_macros", "crates/error_macros",
"reporting", "crates/reporting",
"repl_cli", "crates/repl_cli",
"repl_eval", "crates/repl_eval",
"repl_test", "crates/repl_test",
"repl_wasm", "crates/repl_wasm",
"test_utils", "crates/test_utils",
"utils", "crates/utils",
"docs", "crates/docs",
"docs_cli", "crates/docs_cli",
"linker", "crates/linker",
"wasi-libc-sys", "crates/wasi-libc-sys",
] ]
exclude = [ exclude = [
# Examples sometimes have Rust hosts in their platforms. The compiler should ignore those. # Examples sometimes have Rust hosts in their platforms. The compiler should ignore those.
@ -58,10 +58,10 @@ exclude = [
"ci/bench-runner", "ci/bench-runner",
# Ignore building these normally. They are only imported by tests. # Ignore building these normally. They are only imported by tests.
# The tests will still correctly build them. # The tests will still correctly build them.
"cli_utils", "crates/cli_utils",
"compiler/test_mono_macros", "crates/compiler/test_mono_macros",
# `cargo build` would cause roc_std to be built with default features which errors on windows # `cargo build` would cause roc_std to be built with default features which errors on windows
"roc_std", "crates/roc_std",
] ]
# Needed to be able to run `cargo run -p roc_cli --no-default-features` - # Needed to be able to run `cargo run -p roc_cli --no-default-features` -
# see www/build.sh for more. # see www/build.sh for more.

View file

@ -53,11 +53,11 @@ install-zig-llvm-valgrind-clippy-rustfmt:
copy-dirs: copy-dirs:
FROM +install-zig-llvm-valgrind-clippy-rustfmt FROM +install-zig-llvm-valgrind-clippy-rustfmt
COPY --dir bindgen cli cli_utils compiler docs docs_cli editor ast code_markup error_macros highlight utils test_utils reporting repl_cli repl_eval repl_test repl_wasm repl_www roc_std vendor examples linker Cargo.toml Cargo.lock version.txt www wasi-libc-sys ./ COPY --dir crates repl_www examples Cargo.toml Cargo.lock version.txt www ./
test-zig: test-zig:
FROM +install-zig-llvm-valgrind-clippy-rustfmt FROM +install-zig-llvm-valgrind-clippy-rustfmt
COPY --dir compiler/builtins/bitcode ./ COPY --dir crates/compiler/builtins/bitcode ./
RUN cd bitcode && ./run-tests.sh && ./run-wasm-tests.sh RUN cd bitcode && ./run-tests.sh && ./run-wasm-tests.sh
build-rust-test: build-rust-test:
@ -84,7 +84,7 @@ check-rustfmt:
check-typos: check-typos:
RUN cargo install typos-cli --version 1.0.11 # version set to prevent confusion if the version is updated automatically 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 cli_utils compiler docs editor examples ast code_markup highlight utils linker nightly_benches packages roc_std www *.md LEGAL_DETAILS shell.nix version.txt ./ COPY --dir .github ci crates examples nightly_benches www *.md LEGAL_DETAILS flake.nix version.txt ./
RUN typos RUN typos
test-rust: test-rust:
@ -107,7 +107,7 @@ test-rust:
cargo test --locked --release --package test_gen --no-default-features --features gen-wasm -- --test-threads=1 && sccache --show-stats cargo test --locked --release --package test_gen --no-default-features --features gen-wasm -- --test-threads=1 && sccache --show-stats
# repl_test: build the compiler for wasm target, then run the tests on native target # repl_test: build the compiler for wasm target, then run the tests on native target
RUN --mount=type=cache,target=$SCCACHE_DIR \ RUN --mount=type=cache,target=$SCCACHE_DIR \
repl_test/test_wasm.sh && sccache --show-stats crates/repl_test/test_wasm.sh && sccache --show-stats
# run i386 (32-bit linux) cli tests # run i386 (32-bit linux) cli tests
# NOTE: disabled until zig 0.9 # NOTE: disabled until zig 0.9
# RUN echo "4" | cargo run --locked --release --features="target-x86" -- --target=x86_32 examples/benchmarks/NQueens.roc # RUN echo "4" | cargo run --locked --release --features="target-x86" -- --target=x86_32 examples/benchmarks/NQueens.roc
@ -152,13 +152,13 @@ prep-bench-folder:
ENV RUSTFLAGS="-C link-arg=-fuse-ld=lld -C target-cpu=native" ENV RUSTFLAGS="-C link-arg=-fuse-ld=lld -C target-cpu=native"
ARG BENCH_SUFFIX=branch ARG BENCH_SUFFIX=branch
RUN cargo criterion -V RUN cargo criterion -V
RUN --mount=type=cache,target=$SCCACHE_DIR cd cli && cargo criterion --no-run RUN --mount=type=cache,target=$SCCACHE_DIR cd crates/cli && cargo criterion --no-run
RUN mkdir -p bench-folder/compiler/builtins/bitcode/src RUN mkdir -p bench-folder/crates/compiler/builtins/bitcode/src
RUN mkdir -p bench-folder/target/release/deps RUN mkdir -p bench-folder/target/release/deps
RUN mkdir -p bench-folder/examples/benchmarks RUN mkdir -p bench-folder/examples/benchmarks
RUN cp examples/benchmarks/*.roc bench-folder/examples/benchmarks/ RUN cp examples/benchmarks/*.roc bench-folder/examples/benchmarks/
RUN cp -r examples/benchmarks/platform bench-folder/examples/benchmarks/ RUN cp -r examples/benchmarks/platform bench-folder/examples/benchmarks/
RUN cp compiler/builtins/bitcode/src/str.zig bench-folder/compiler/builtins/bitcode/src RUN cp crates/compiler/builtins/bitcode/src/str.zig bench-folder/crates/compiler/builtins/bitcode/src
RUN cp target/release/roc bench-folder/target/release RUN cp target/release/roc bench-folder/target/release
# copy the most recent time bench to bench-folder # copy the most recent time bench to bench-folder
RUN cp target/release/deps/`ls -t target/release/deps/ | grep time_bench | head -n 1` bench-folder/target/release/deps/time_bench RUN cp target/release/deps/`ls -t target/release/deps/ | grep time_bench | head -n 1` bench-folder/target/release/deps/time_bench

View file

@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cp target/release/roc ./roc # to be able to exclude "target" later in the tar command cp target/release/roc ./roc # to be able to exclude "target" later in the tar command
tar -czvf $1 --exclude="target" --exclude="zig-cache" roc LICENSE LEGAL_DETAILS examples/hello-world compiler/builtins/bitcode/src/ roc_std tar -czvf $1 --exclude="target" --exclude="zig-cache" roc LICENSE LEGAL_DETAILS examples/hello-world crates/compiler/builtins/bitcode/src/ crates/roc_std

View file

@ -1 +0,0 @@
../../../examples/interactive/cli-platform

View file

@ -48,6 +48,7 @@ pub fn fixtures_dir(dir_name: &str) -> PathBuf {
let mut path = root_dir(); let mut path = root_dir();
// Descend into cli/tests/fixtures/{dir_name} // Descend into cli/tests/fixtures/{dir_name}
path.push("crates");
path.push("bindgen"); path.push("bindgen");
path.push("tests"); path.push("tests");
path.push("fixtures"); path.push("fixtures");

View file

@ -34,7 +34,7 @@ mod bindgen_cli_run {
let output = Command::new("cargo") let output = Command::new("cargo")
.args(args) .args(args)
.current_dir(root_dir().join("cli")) .current_dir(root_dir().join("crates").join("cli"))
.output() .output()
.unwrap_or_else(|err| { .unwrap_or_else(|err| {
panic!( panic!(

Some files were not shown because too many files have changed in this diff Show more