From fac07f5b89e034ea2905251d39a8f0336a0d20e6 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Tue, 6 Apr 2021 15:00:22 +0200 Subject: [PATCH 01/14] clean generated manifests and test outputs in Make clean target --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index d3b8808142..17a0db0c36 100644 --- a/Makefile +++ b/Makefile @@ -285,6 +285,9 @@ copy: clean: @find . -name \*.dot.svg -type f -exec rm -rf {} + ; true @find . -name \*.dot -type f -exec rm -rf {} + ; true + @find . -name manifest.json -type f -exec rm -rf {} + ; true + @find . -name test.output -type f -exec rm -rf {} + ; true + @find . -name test.err -type f -exec rm -rf {} + ; true @rm -rf target/html @find . -name \*.dump -type f -exec rm -rf {} + ; true @find . -name \*.dot -type f -exec rm -rf {} + ; true From ccd126d07abda84f9ccee15a02faac0f860bcf4e Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Tue, 6 Apr 2021 15:48:14 +0200 Subject: [PATCH 02/14] Correct the lib url that is printed when loading flowstdlib --- flowr/src/lib/coordinator.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flowr/src/lib/coordinator.rs b/flowr/src/lib/coordinator.rs index c2c76d1073..15693a689e 100644 --- a/flowr/src/lib/coordinator.rs +++ b/flowr/src/lib/coordinator.rs @@ -444,7 +444,7 @@ impl Coordinator { server_context: Arc>, native: bool, ) -> Result { - let native_url = + let flowruntimelib_url = Url::parse("lib://flowruntime").chain_err(|| "Could not parse lib_manifest_url")?; // Load this run-time's library of native (statically linked) implementations @@ -452,17 +452,19 @@ impl Coordinator { .add_lib( provider, flowruntime::get_manifest(server_context)?, - &native_url, + &flowruntimelib_url, ) .chain_err(|| "Could not add 'flowruntime' library to loader")?; // If the "native" feature is enabled then load the native flowstdlib if command line arg to do so if cfg!(feature = "native") && native { + let flowstdlib_url = + Url::parse("lib://flowstdlib").chain_err(|| "Could not parse flowstdlib_url")?; loader .add_lib( provider, flowstdlib::get_manifest().chain_err(|| "Could not get flowstdlib manifest")?, - &native_url, + &flowstdlib_url, ) .chain_err(|| "Could not add 'flowstdlib' library to loader")?; } From 22cdffd11751587d641362ff4f0cd52cae9ddc80 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Tue, 6 Apr 2021 16:27:17 +0200 Subject: [PATCH 03/14] Re-instate test_arrays() now lib loading is fixed. --- samples/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/main.rs b/samples/main.rs index cd36db40f2..3c5135ea39 100644 --- a/samples/main.rs +++ b/samples/main.rs @@ -224,7 +224,6 @@ mod test { test_run_sample(&sample, &super::get_flowr().unwrap()); } - #[ignore] #[test] #[serial] fn test_arrays() { From ffd9d207f9f672ffff8ad3e639ea0e0c827f661f Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Tue, 6 Apr 2021 16:27:41 +0200 Subject: [PATCH 04/14] rust format --- samples/build.rs | 60 +++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/samples/build.rs b/samples/build.rs index 0d7cc7b68d..096de0fce4 100644 --- a/samples/build.rs +++ b/samples/build.rs @@ -1,5 +1,5 @@ -// Build script to compile the flow samples in the crate use std::{fs, io}; +// Build script to compile the flow samples in the crate use std::io::ErrorKind; use std::path::Path; use std::process::{Command, Stdio}; @@ -18,7 +18,7 @@ fn main() -> io::Result<()> { } } } - }; + } println!("cargo:rerun-if-env-changed=FLOW_LIB_PATH"); Ok(()) @@ -35,42 +35,50 @@ fn get_flowc() -> io::Result { return Ok(dev.into_os_string().to_str().unwrap().to_string()); } - if Simpath::new("PATH").find_type("flowr", FileType::File).is_ok() { + if Simpath::new("PATH") + .find_type("flowr", FileType::File) + .is_ok() + { return Ok("flowc".into()); } - Err(io::Error::new(io::ErrorKind::Other, - "`flowc` could not be found in `$PATH` or `target/`")) + Err(io::Error::new( + io::ErrorKind::Other, + "`flowc` could not be found in `$PATH` or `target/`", + )) } fn compile_sample(sample_dir: &Path, flowc: &str) -> io::Result<()> { - // Tell Cargo that if the given file changes, to rerun this build script. - println!("cargo:rerun-if-changed={}/context.toml", sample_dir.display()); + // Tell Cargo that if any file in the sample directory changes it should rerun this build script + println!("cargo:rerun-if-changed={}", sample_dir.display()); let mut command = Command::new(flowc); // -g for debug symbols, -d to dump compiler structs, -s to skip running, only compile the flow - let command_args = vec!("-g", "-d", "-s", sample_dir.to_str().unwrap()); + let command_args = vec!["-g", "-d", "-s", sample_dir.to_str().unwrap()]; - match command.args(command_args) + match command + .args(command_args) .stdin(Stdio::inherit()) .stdout(Stdio::inherit()) .stderr(Stdio::inherit()) - .spawn() { - Ok(flowc_child) => { - match flowc_child.wait_with_output() { - Ok(_) => Ok(()), - Err(e) => Err(io::Error::new(io::ErrorKind::Other, - format!("Error running `flowc`: {}", e))) - } - } - Err(e) => { - match e.kind() { - ErrorKind::NotFound => - Err(io::Error::new(io::ErrorKind::Other, - format!("`flowc` was not found! Check your $PATH. {}", e))), - _ => Err(io::Error::new(io::ErrorKind::Other, - format!("Unexpected error occurred spawning `flowc`: {}", e))) - } - } + .spawn() + { + Ok(flowc_child) => match flowc_child.wait_with_output() { + Ok(_) => Ok(()), + Err(e) => Err(io::Error::new( + io::ErrorKind::Other, + format!("Error running `flowc`: {}", e), + )), + }, + Err(e) => match e.kind() { + ErrorKind::NotFound => Err(io::Error::new( + io::ErrorKind::Other, + format!("`flowc` was not found! Check your $PATH. {}", e), + )), + _ => Err(io::Error::new( + io::ErrorKind::Other, + format!("Unexpected error occurred spawning `flowc`: {}", e), + )), + }, } } From 682fc805cdf21386ea8041850806c0efae311472 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Tue, 6 Apr 2021 16:28:48 +0200 Subject: [PATCH 05/14] Update old flow_impl references to use flowcore library --- flowstdlib/control/compare_switch/flow.toml | 2 +- flowstdlib/control/index/flow.toml | 2 +- flowstdlib/control/join/flow.toml | 2 +- flowstdlib/control/route/flow.toml | 2 +- flowstdlib/control/select/flow.toml | 2 +- flowstdlib/control/tap/flow.toml | 2 +- flowstdlib/data/accumulate/flow.toml | 2 +- flowstdlib/data/append/flow.toml | 2 +- flowstdlib/data/buffer/flow.toml | 2 +- flowstdlib/data/count/flow.toml | 2 +- flowstdlib/data/duplicate/flow.toml | 2 +- flowstdlib/data/duplicate_rows/flow.toml | 2 +- flowstdlib/data/enumerate/flow.toml | 2 +- flowstdlib/data/info/flow.toml | 2 +- flowstdlib/data/multiply_row/flow.toml | 2 +- flowstdlib/data/ordered_split/flow.toml | 2 +- flowstdlib/data/remove/flow.toml | 2 +- flowstdlib/data/sort/flow.toml | 2 +- flowstdlib/data/split/flow.toml | 2 +- flowstdlib/data/transpose/flow.toml | 2 +- flowstdlib/data/zip/flow.toml | 2 +- flowstdlib/fmt/reverse/flow.toml | 2 +- flowstdlib/fmt/to_json/flow.toml | 2 +- flowstdlib/fmt/to_string/flow.toml | 2 +- flowstdlib/img/format_png/flow.toml | 2 +- flowstdlib/math/add/flow.toml | 2 +- flowstdlib/math/compare/flow.toml | 2 +- flowstdlib/math/divide/flow.toml | 2 +- flowstdlib/math/multiply/flow.toml | 2 +- flowstdlib/math/sqrt/flow.toml | 2 +- flowstdlib/math/subtract/flow.toml | 2 +- samples/mandlebrot/pixel_to_point/flow.toml | 2 +- samples/mandlebrot/render_pixel/flow.toml | 2 +- samples/reverse-echo/reverse/flow.toml | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/flowstdlib/control/compare_switch/flow.toml b/flowstdlib/control/compare_switch/flow.toml index 301581678d..88d6e4b107 100644 --- a/flowstdlib/control/compare_switch/flow.toml +++ b/flowstdlib/control/compare_switch/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/control/index/flow.toml b/flowstdlib/control/index/flow.toml index f8072a5ec8..09cf463389 100644 --- a/flowstdlib/control/index/flow.toml +++ b/flowstdlib/control/index/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/control/join/flow.toml b/flowstdlib/control/join/flow.toml index 90ba0f7f6b..fee6f7ed48 100644 --- a/flowstdlib/control/join/flow.toml +++ b/flowstdlib/control/join/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/control/route/flow.toml b/flowstdlib/control/route/flow.toml index 918192bf8c..e5a4767c8c 100644 --- a/flowstdlib/control/route/flow.toml +++ b/flowstdlib/control/route/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/control/select/flow.toml b/flowstdlib/control/select/flow.toml index 5db2f9e217..56f7f8831d 100644 --- a/flowstdlib/control/select/flow.toml +++ b/flowstdlib/control/select/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/control/tap/flow.toml b/flowstdlib/control/tap/flow.toml index f8434ceb00..24c3a7fde9 100644 --- a/flowstdlib/control/tap/flow.toml +++ b/flowstdlib/control/tap/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/accumulate/flow.toml b/flowstdlib/data/accumulate/flow.toml index 2857e46efc..ac885021a8 100644 --- a/flowstdlib/data/accumulate/flow.toml +++ b/flowstdlib/data/accumulate/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/append/flow.toml b/flowstdlib/data/append/flow.toml index cb91597591..18ce1e100d 100644 --- a/flowstdlib/data/append/flow.toml +++ b/flowstdlib/data/append/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/buffer/flow.toml b/flowstdlib/data/buffer/flow.toml index 09b68acc96..ca9f5b2d3f 100644 --- a/flowstdlib/data/buffer/flow.toml +++ b/flowstdlib/data/buffer/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/count/flow.toml b/flowstdlib/data/count/flow.toml index 8f3dc866c1..667cdc8029 100644 --- a/flowstdlib/data/count/flow.toml +++ b/flowstdlib/data/count/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/duplicate/flow.toml b/flowstdlib/data/duplicate/flow.toml index a151bf71e7..601ee456ee 100644 --- a/flowstdlib/data/duplicate/flow.toml +++ b/flowstdlib/data/duplicate/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/duplicate_rows/flow.toml b/flowstdlib/data/duplicate_rows/flow.toml index 1f105f478b..b828fa4cd5 100644 --- a/flowstdlib/data/duplicate_rows/flow.toml +++ b/flowstdlib/data/duplicate_rows/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/enumerate/flow.toml b/flowstdlib/data/enumerate/flow.toml index 149fc7eedf..4127d79f59 100644 --- a/flowstdlib/data/enumerate/flow.toml +++ b/flowstdlib/data/enumerate/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/info/flow.toml b/flowstdlib/data/info/flow.toml index 11a7b8c8ab..5c3d6311d0 100644 --- a/flowstdlib/data/info/flow.toml +++ b/flowstdlib/data/info/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/multiply_row/flow.toml b/flowstdlib/data/multiply_row/flow.toml index c675fa5513..4301ce83e3 100644 --- a/flowstdlib/data/multiply_row/flow.toml +++ b/flowstdlib/data/multiply_row/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/ordered_split/flow.toml b/flowstdlib/data/ordered_split/flow.toml index 80deb6936d..111164b0a5 100644 --- a/flowstdlib/data/ordered_split/flow.toml +++ b/flowstdlib/data/ordered_split/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/remove/flow.toml b/flowstdlib/data/remove/flow.toml index 4cc4b8167e..3c08ccd274 100644 --- a/flowstdlib/data/remove/flow.toml +++ b/flowstdlib/data/remove/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/sort/flow.toml b/flowstdlib/data/sort/flow.toml index 5c91cd2093..bc3a5deaaa 100644 --- a/flowstdlib/data/sort/flow.toml +++ b/flowstdlib/data/sort/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/split/flow.toml b/flowstdlib/data/split/flow.toml index a538c7a0ab..ba6470ff69 100644 --- a/flowstdlib/data/split/flow.toml +++ b/flowstdlib/data/split/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/transpose/flow.toml b/flowstdlib/data/transpose/flow.toml index c9fb56118f..0c64fca12a 100644 --- a/flowstdlib/data/transpose/flow.toml +++ b/flowstdlib/data/transpose/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/data/zip/flow.toml b/flowstdlib/data/zip/flow.toml index 411c1b512f..20191ee0bf 100644 --- a/flowstdlib/data/zip/flow.toml +++ b/flowstdlib/data/zip/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/fmt/reverse/flow.toml b/flowstdlib/fmt/reverse/flow.toml index 16209f86d9..191692ab1d 100644 --- a/flowstdlib/fmt/reverse/flow.toml +++ b/flowstdlib/fmt/reverse/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/fmt/to_json/flow.toml b/flowstdlib/fmt/to_json/flow.toml index 84db0642ba..d2de25fced 100644 --- a/flowstdlib/fmt/to_json/flow.toml +++ b/flowstdlib/fmt/to_json/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/fmt/to_string/flow.toml b/flowstdlib/fmt/to_string/flow.toml index 49148d2ac8..c119760d52 100644 --- a/flowstdlib/fmt/to_string/flow.toml +++ b/flowstdlib/fmt/to_string/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/img/format_png/flow.toml b/flowstdlib/img/format_png/flow.toml index ee299e4b1a..9fa098d235 100644 --- a/flowstdlib/img/format_png/flow.toml +++ b/flowstdlib/img/format_png/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" image = "=0.23.10" diff --git a/flowstdlib/math/add/flow.toml b/flowstdlib/math/add/flow.toml index 4ee01874ca..af15401c48 100644 --- a/flowstdlib/math/add/flow.toml +++ b/flowstdlib/math/add/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/math/compare/flow.toml b/flowstdlib/math/compare/flow.toml index 2c25bb6fd3..b8353e7487 100644 --- a/flowstdlib/math/compare/flow.toml +++ b/flowstdlib/math/compare/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/math/divide/flow.toml b/flowstdlib/math/divide/flow.toml index c169f5d8cb..edaa809a58 100644 --- a/flowstdlib/math/divide/flow.toml +++ b/flowstdlib/math/divide/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/math/multiply/flow.toml b/flowstdlib/math/multiply/flow.toml index 08094799ac..c32f02cc2a 100644 --- a/flowstdlib/math/multiply/flow.toml +++ b/flowstdlib/math/multiply/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/math/sqrt/flow.toml b/flowstdlib/math/sqrt/flow.toml index e5174f5ec0..f5f1d73e2f 100644 --- a/flowstdlib/math/sqrt/flow.toml +++ b/flowstdlib/math/sqrt/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/flowstdlib/math/subtract/flow.toml b/flowstdlib/math/subtract/flow.toml index 0c532923a9..5d0c58ac04 100644 --- a/flowstdlib/math/subtract/flow.toml +++ b/flowstdlib/math/subtract/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" diff --git a/samples/mandlebrot/pixel_to_point/flow.toml b/samples/mandlebrot/pixel_to_point/flow.toml index 34866e4f82..4c9fe6bf16 100644 --- a/samples/mandlebrot/pixel_to_point/flow.toml +++ b/samples/mandlebrot/pixel_to_point/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" num = "0.3.0" diff --git a/samples/mandlebrot/render_pixel/flow.toml b/samples/mandlebrot/render_pixel/flow.toml index fc668c3378..ed21cf3ee2 100644 --- a/samples/mandlebrot/render_pixel/flow.toml +++ b/samples/mandlebrot/render_pixel/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" num = "0.3.0" serde_json = "1.0" diff --git a/samples/reverse-echo/reverse/flow.toml b/samples/reverse-echo/reverse/flow.toml index 7bf2be14e1..b30b616a1d 100644 --- a/samples/reverse-echo/reverse/flow.toml +++ b/samples/reverse-echo/reverse/flow.toml @@ -15,7 +15,7 @@ lto = true opt-level = 's' [dependencies] -flow_impl = "=0.10.0" +flowcore = "=0.34.7" flow_impl_derive = "=0.10.0" serde_json = "1.0" From 95359325152cc9153e3a432cdbda02a7b81665fe Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 10:08:00 +0200 Subject: [PATCH 06/14] Delete wasm files on clean (avoid double delete of dot files) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 17a0db0c36..9e5f93e857 100644 --- a/Makefile +++ b/Makefile @@ -288,7 +288,7 @@ clean: @find . -name manifest.json -type f -exec rm -rf {} + ; true @find . -name test.output -type f -exec rm -rf {} + ; true @find . -name test.err -type f -exec rm -rf {} + ; true + @find . -name \*.wasm -type f -exec rm -rf {} + ; true @rm -rf target/html @find . -name \*.dump -type f -exec rm -rf {} + ; true - @find . -name \*.dot -type f -exec rm -rf {} + ; true @cargo clean \ No newline at end of file From b7390b83a9215bd86ce2001a4708220ba3474ef0 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 10:09:34 +0200 Subject: [PATCH 07/14] Use flowcore with no default features from all wasm projects, avoid non-wasm-build code when "code" feature disabled --- flowc/src/lib/compiler/compile_wasm.rs | 14 +++++++++-- flowc/src/lib/dumper/dump_dot.rs | 7 ++++-- flowcore/Cargo.toml | 27 ++++++++++++--------- flowcore/src/lib.rs | 12 ++++++++- flowstdlib/control/compare_switch/flow.toml | 4 +-- flowstdlib/control/index/flow.toml | 4 +-- flowstdlib/control/join/flow.toml | 4 +-- flowstdlib/control/route/flow.toml | 4 +-- flowstdlib/control/select/flow.toml | 4 +-- flowstdlib/control/tap/flow.toml | 4 +-- flowstdlib/data/accumulate/flow.toml | 4 +-- flowstdlib/data/append/flow.toml | 4 +-- flowstdlib/data/buffer/flow.toml | 4 +-- flowstdlib/data/count/flow.toml | 4 +-- flowstdlib/data/duplicate/flow.toml | 4 +-- flowstdlib/data/duplicate_rows/flow.toml | 4 +-- flowstdlib/data/enumerate/flow.toml | 4 +-- flowstdlib/data/info/flow.toml | 4 +-- flowstdlib/data/multiply_row/flow.toml | 4 +-- flowstdlib/data/ordered_split/flow.toml | 4 +-- flowstdlib/data/remove/flow.toml | 4 +-- flowstdlib/data/sort/flow.toml | 4 +-- flowstdlib/data/split/flow.toml | 4 +-- flowstdlib/data/transpose/flow.toml | 4 +-- flowstdlib/data/zip/flow.toml | 4 +-- flowstdlib/fmt/reverse/flow.toml | 4 +-- flowstdlib/fmt/to_json/flow.toml | 4 +-- flowstdlib/fmt/to_string/flow.toml | 4 +-- flowstdlib/img/format_png/flow.toml | 4 +-- flowstdlib/math/add/flow.toml | 4 +-- flowstdlib/math/compare/flow.toml | 4 +-- flowstdlib/math/divide/flow.toml | 4 +-- flowstdlib/math/multiply/flow.toml | 4 +-- flowstdlib/math/sqrt/flow.toml | 4 +-- flowstdlib/math/subtract/flow.toml | 4 +-- samples/mandlebrot/Cargo.toml | 4 +-- samples/mandlebrot/pixel_to_point/flow.toml | 4 +-- samples/mandlebrot/render_pixel/flow.toml | 4 +-- samples/reverse-echo/reverse/flow.toml | 7 +++--- 39 files changed, 115 insertions(+), 88 deletions(-) diff --git a/flowc/src/lib/compiler/compile_wasm.rs b/flowc/src/lib/compiler/compile_wasm.rs index c3e5af6049..6e5824fc08 100644 --- a/flowc/src/lib/compiler/compile_wasm.rs +++ b/flowc/src/lib/compiler/compile_wasm.rs @@ -155,6 +155,7 @@ fn run_cargo_build(manifest_path: &Path, target_dir: &Path) -> Result { let mut command_args = vec![ "build", "--quiet", + // "--verbose", "--lib", "--target=wasm32-unknown-unknown", ]; @@ -169,7 +170,7 @@ fn run_cargo_build(manifest_path: &Path, target_dir: &Path) -> Result { ); let output = Command::new(&command) - .args(command_args) + .args(&command_args) .stdin(Stdio::inherit()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) @@ -179,11 +180,20 @@ fn run_cargo_build(manifest_path: &Path, target_dir: &Path) -> Result { match output.status.code() { Some(0) => Ok("Cargo Build of supplied function to wasm succeeded".to_string()), Some(code) => { + error!( + "Process STDOUT:\n{}", + String::from_utf8_lossy(&output.stdout) + ); error!( "Process STDERR:\n{}", String::from_utf8_lossy(&output.stderr) ); - bail!("Exited with status code: {}", code) + bail!( + "cargo exited with status code: {}\nCommand Line: {} {:?}", + code, + command, + command_args + ) } None => Ok("No return code - ignoring".to_string()), } diff --git a/flowc/src/lib/dumper/dump_dot.rs b/flowc/src/lib/dumper/dump_dot.rs index 974df440de..dd9b890462 100644 --- a/flowc/src/lib/dumper/dump_dot.rs +++ b/flowc/src/lib/dumper/dump_dot.rs @@ -69,7 +69,7 @@ pub fn write_flow_to_dot( &Url::parse(&process_ref.source).map_err(|_| { std::io::Error::new( std::io::ErrorKind::Other, - "Could not parse Url from flow_source", + format!("Could not parse Url from: {}", process_ref.source), ) })?, "", @@ -78,7 +78,10 @@ pub fn write_flow_to_dot( .map_err(|_| { std::io::Error::new( std::io::ErrorKind::Other, - "Could not resolve Url of flow_source", + format!( + "Could not resolve Url of flow_source: {}", + process_ref.source + ), ) })?; diff --git a/flowcore/Cargo.toml b/flowcore/Cargo.toml index ecccf170f2..19caf8288b 100644 --- a/flowcore/Cargo.toml +++ b/flowcore/Cargo.toml @@ -17,16 +17,21 @@ exclude = [".gitignore", "Cargo.lock"] name = "flowcore" path = "src/lib.rs" -[features] -default = [] # Don't include any features by default -debugger = [] # feature to add the debugger - [dependencies] -provider = {path = "../provider", version = "0.34.4" } +serde_json = "1.0" # Needed for Implementation trait and must compile for wasm32-unknown-unknown -url = { version = "2.2", features = ["serde"] } -serde = "~1.0.27" -serde_derive = "~1.0.27" -serde_json = "1.0" -error-chain = "0.12.2" -log = "0.4.6" +# All other dependencies below are optional and can be turned off using "default-features false" removing any +# dependency that won't compile for wasm32 +serde = { version = "~1.0.27", optional = true } +serde_derive = { version = "~1.0.27", optional = true } +provider = {path = "../provider", version = "0.34.4", optional = true} +url = { version = "2.2", features = ["serde"], optional = true } +error-chain = {version = "0.12.2", optional = true} +log = {version = "0.4.6", optional = true} + +[features] +default = ["code"] # by default include code not just the trait definition +debugger = ["code"] # feature to add the debugger, depends on code feature +# Enable the "code" feature to compile the crate with dependencies for code not just trait +# It brings in the following optional dependencies, some of which do not compile for wasm32 +code = ["serde", "serde_derive", "provider", "url", "error-chain", "log"] diff --git a/flowcore/src/lib.rs b/flowcore/src/lib.rs index 3f0fb02c71..4d559ab680 100644 --- a/flowcore/src/lib.rs +++ b/flowcore/src/lib.rs @@ -1,29 +1,38 @@ #![warn(clippy::unwrap_used)] -//! `flowcore` create defined some core structs and traits used by other flow libraries +//! `flowcore` defines some core structs and traits used by other flow libraries and implementations +#[cfg(feature = "code")] #[macro_use] +#[cfg(feature = "code")] extern crate error_chain; use std::panic::{RefUnwindSafe, UnwindSafe}; use serde_json::Value; +#[cfg(feature = "code")] /// `function` defines functions that form part of a flow pub mod function; +#[cfg(feature = "code")] /// `input` defines the struct for inputs to functions in a flow pub mod input; +#[cfg(feature = "code")] /// `lib_manifest` defines the structs for specifying a Library's manifest and methods to load it pub mod lib_manifest; +#[cfg(feature = "code")] /// `manifest` is the struct that specifies the manifest of functions in a flow pub mod manifest; +#[cfg(feature = "code")] /// `output_connection` defines a struct for a function's output connection pub mod output_connection; +#[cfg(feature = "code")] /// Utility functions related to Urls pub mod url_helper; /// We'll put our errors in an `errors` module, and other modules in this crate will `use errors::*;` /// to get access to everything `error_chain!` creates. +#[cfg(feature = "code")] #[doc(hidden)] pub mod errors { // Create the Error, ErrorKind, ResultExt, and Result types @@ -39,6 +48,7 @@ pub const RUN_AGAIN: RunAgain = true; pub const DONT_RUN_AGAIN: RunAgain = false; #[doc(hidden)] +#[cfg(feature = "code")] error_chain! { types { Error, ErrorKind, ResultExt, Result; diff --git a/flowstdlib/control/compare_switch/flow.toml b/flowstdlib/control/compare_switch/flow.toml index 88d6e4b107..ea5a54207a 100644 --- a/flowstdlib/control/compare_switch/flow.toml +++ b/flowstdlib/control/compare_switch/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" diff --git a/flowstdlib/control/index/flow.toml b/flowstdlib/control/index/flow.toml index 09cf463389..14ea0b31be 100644 --- a/flowstdlib/control/index/flow.toml +++ b/flowstdlib/control/index/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/control/join/flow.toml b/flowstdlib/control/join/flow.toml index fee6f7ed48..e52d0ab6c3 100644 --- a/flowstdlib/control/join/flow.toml +++ b/flowstdlib/control/join/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" diff --git a/flowstdlib/control/route/flow.toml b/flowstdlib/control/route/flow.toml index e5a4767c8c..0c1565e237 100644 --- a/flowstdlib/control/route/flow.toml +++ b/flowstdlib/control/route/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/control/select/flow.toml b/flowstdlib/control/select/flow.toml index 56f7f8831d..3048de95b9 100644 --- a/flowstdlib/control/select/flow.toml +++ b/flowstdlib/control/select/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/control/tap/flow.toml b/flowstdlib/control/tap/flow.toml index 24c3a7fde9..711bcd0876 100644 --- a/flowstdlib/control/tap/flow.toml +++ b/flowstdlib/control/tap/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/accumulate/flow.toml b/flowstdlib/data/accumulate/flow.toml index ac885021a8..9ebadce08f 100644 --- a/flowstdlib/data/accumulate/flow.toml +++ b/flowstdlib/data/accumulate/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/append/flow.toml b/flowstdlib/data/append/flow.toml index 18ce1e100d..0956543034 100644 --- a/flowstdlib/data/append/flow.toml +++ b/flowstdlib/data/append/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/buffer/flow.toml b/flowstdlib/data/buffer/flow.toml index ca9f5b2d3f..a71312b1de 100644 --- a/flowstdlib/data/buffer/flow.toml +++ b/flowstdlib/data/buffer/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/count/flow.toml b/flowstdlib/data/count/flow.toml index 667cdc8029..f19fb4319e 100644 --- a/flowstdlib/data/count/flow.toml +++ b/flowstdlib/data/count/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/duplicate/flow.toml b/flowstdlib/data/duplicate/flow.toml index 601ee456ee..4db3adbda4 100644 --- a/flowstdlib/data/duplicate/flow.toml +++ b/flowstdlib/data/duplicate/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/duplicate_rows/flow.toml b/flowstdlib/data/duplicate_rows/flow.toml index b828fa4cd5..f52b6278d2 100644 --- a/flowstdlib/data/duplicate_rows/flow.toml +++ b/flowstdlib/data/duplicate_rows/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/enumerate/flow.toml b/flowstdlib/data/enumerate/flow.toml index 4127d79f59..5f9dcf94f8 100644 --- a/flowstdlib/data/enumerate/flow.toml +++ b/flowstdlib/data/enumerate/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/info/flow.toml b/flowstdlib/data/info/flow.toml index 5c3d6311d0..888e505168 100644 --- a/flowstdlib/data/info/flow.toml +++ b/flowstdlib/data/info/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/multiply_row/flow.toml b/flowstdlib/data/multiply_row/flow.toml index 4301ce83e3..1b170cbb7a 100644 --- a/flowstdlib/data/multiply_row/flow.toml +++ b/flowstdlib/data/multiply_row/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/ordered_split/flow.toml b/flowstdlib/data/ordered_split/flow.toml index 111164b0a5..97aab75a82 100644 --- a/flowstdlib/data/ordered_split/flow.toml +++ b/flowstdlib/data/ordered_split/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/remove/flow.toml b/flowstdlib/data/remove/flow.toml index 3c08ccd274..39049bfc08 100644 --- a/flowstdlib/data/remove/flow.toml +++ b/flowstdlib/data/remove/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/sort/flow.toml b/flowstdlib/data/sort/flow.toml index bc3a5deaaa..b9ca118e5d 100644 --- a/flowstdlib/data/sort/flow.toml +++ b/flowstdlib/data/sort/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/split/flow.toml b/flowstdlib/data/split/flow.toml index ba6470ff69..f8e49c9a91 100644 --- a/flowstdlib/data/split/flow.toml +++ b/flowstdlib/data/split/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/transpose/flow.toml b/flowstdlib/data/transpose/flow.toml index 0c64fca12a..d29c792b24 100644 --- a/flowstdlib/data/transpose/flow.toml +++ b/flowstdlib/data/transpose/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/data/zip/flow.toml b/flowstdlib/data/zip/flow.toml index 20191ee0bf..5b59807637 100644 --- a/flowstdlib/data/zip/flow.toml +++ b/flowstdlib/data/zip/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/fmt/reverse/flow.toml b/flowstdlib/fmt/reverse/flow.toml index 191692ab1d..4825fe2401 100644 --- a/flowstdlib/fmt/reverse/flow.toml +++ b/flowstdlib/fmt/reverse/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/fmt/to_json/flow.toml b/flowstdlib/fmt/to_json/flow.toml index d2de25fced..7bd2f717b7 100644 --- a/flowstdlib/fmt/to_json/flow.toml +++ b/flowstdlib/fmt/to_json/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/fmt/to_string/flow.toml b/flowstdlib/fmt/to_string/flow.toml index c119760d52..080b362acf 100644 --- a/flowstdlib/fmt/to_string/flow.toml +++ b/flowstdlib/fmt/to_string/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/img/format_png/flow.toml b/flowstdlib/img/format_png/flow.toml index 9fa098d235..b765737412 100644 --- a/flowstdlib/img/format_png/flow.toml +++ b/flowstdlib/img/format_png/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" image = "=0.23.10" diff --git a/flowstdlib/math/add/flow.toml b/flowstdlib/math/add/flow.toml index af15401c48..126add3d84 100644 --- a/flowstdlib/math/add/flow.toml +++ b/flowstdlib/math/add/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/math/compare/flow.toml b/flowstdlib/math/compare/flow.toml index b8353e7487..8ef5fb8d25 100644 --- a/flowstdlib/math/compare/flow.toml +++ b/flowstdlib/math/compare/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" diff --git a/flowstdlib/math/divide/flow.toml b/flowstdlib/math/divide/flow.toml index edaa809a58..dce971236c 100644 --- a/flowstdlib/math/divide/flow.toml +++ b/flowstdlib/math/divide/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/math/multiply/flow.toml b/flowstdlib/math/multiply/flow.toml index c32f02cc2a..45947b3895 100644 --- a/flowstdlib/math/multiply/flow.toml +++ b/flowstdlib/math/multiply/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/math/sqrt/flow.toml b/flowstdlib/math/sqrt/flow.toml index f5f1d73e2f..c8735f0e93 100644 --- a/flowstdlib/math/sqrt/flow.toml +++ b/flowstdlib/math/sqrt/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/flowstdlib/math/subtract/flow.toml b/flowstdlib/math/subtract/flow.toml index 5d0c58ac04..e946cf0aa4 100644 --- a/flowstdlib/math/subtract/flow.toml +++ b/flowstdlib/math/subtract/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" [workspace] diff --git a/samples/mandlebrot/Cargo.toml b/samples/mandlebrot/Cargo.toml index 1fa51a1032..2b91173772 100644 --- a/samples/mandlebrot/Cargo.toml +++ b/samples/mandlebrot/Cargo.toml @@ -10,8 +10,8 @@ name="mandlebrot" path = "main.rs" [dependencies] -flowcore = "=0.34.6" -flow_impl_derive = "=0.10.0" +flowcore = "=0.34.7" +flow_impl_derive = "=0.34.7" serde_json = "1.0" num = "0.3.0" image = "=0.23.10" diff --git a/samples/mandlebrot/pixel_to_point/flow.toml b/samples/mandlebrot/pixel_to_point/flow.toml index 4c9fe6bf16..494de28eb6 100644 --- a/samples/mandlebrot/pixel_to_point/flow.toml +++ b/samples/mandlebrot/pixel_to_point/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" serde_json = "1.0" num = "0.3.0" diff --git a/samples/mandlebrot/render_pixel/flow.toml b/samples/mandlebrot/render_pixel/flow.toml index ed21cf3ee2..153266955f 100644 --- a/samples/mandlebrot/render_pixel/flow.toml +++ b/samples/mandlebrot/render_pixel/flow.toml @@ -15,8 +15,8 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" num = "0.3.0" serde_json = "1.0" diff --git a/samples/reverse-echo/reverse/flow.toml b/samples/reverse-echo/reverse/flow.toml index b30b616a1d..58f7a6a051 100644 --- a/samples/reverse-echo/reverse/flow.toml +++ b/samples/reverse-echo/reverse/flow.toml @@ -15,10 +15,9 @@ lto = true opt-level = 's' [dependencies] -flowcore = "=0.34.7" -flow_impl_derive = "=0.10.0" - -serde_json = "1.0" +flowcore = {path = "../../../flowcore", version = "=0.34.7", default-features = false} +flow_impl_derive = "=0.34.7" +serde_json = {version = "1.0" } [workspace] exclude = ["../../../"] From 25a2cb7279339d569f1bc86e9c2b0fdf9209b4e2 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 10:10:27 +0200 Subject: [PATCH 08/14] Fail on any build/run/test error in flowsamples, don't suppress it. --- samples/build.rs | 99 ++++++++++++++++++++++++++---------------------- samples/main.rs | 9 +++-- 2 files changed, 58 insertions(+), 50 deletions(-) diff --git a/samples/build.rs b/samples/build.rs index 096de0fce4..da95c4b149 100644 --- a/samples/build.rs +++ b/samples/build.rs @@ -1,45 +1,60 @@ -use std::{fs, io}; -// Build script to compile the flow samples in the crate -use std::io::ErrorKind; -use std::path::Path; +//! Build script to compile the flow samples in the crate +use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; +use std::{fs, io}; -use simpath::{FileType, Simpath}; +use simpath::{FileType, FoundType, Simpath}; fn main() -> io::Result<()> { + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-env-changed=FLOW_LIB_PATH"); + + println!("`flowsample` version {}", env!("CARGO_PKG_VERSION")); + println!( + "Current Working Directory: `{}`", + std::env::current_dir().unwrap().display() + ); + println!("Samples Root Directory: `{}`", env!("CARGO_MANIFEST_DIR")); + let flowc = get_flowc()?; + println!( + "Using 'flowc' compiler found at: `{}`", + flowc.to_str().unwrap() + ); + // find all sample sub-folders for entry in fs::read_dir(env!("CARGO_MANIFEST_DIR"))? { - if let Ok(e) = entry { - if let Ok(ft) = e.file_type() { - if ft.is_dir() { - compile_sample(&e.path(), &flowc)?; - } + let e = entry?; + if e.file_type()?.is_dir() { + println!( + "\nBuilding sample in directory: `{}`", + e.path().to_str().unwrap() + ); + if compile_sample(&e.path(), &flowc).is_err() { + std::process::exit(1); } } } - println!("cargo:rerun-if-env-changed=FLOW_LIB_PATH"); Ok(()) } -fn get_flowc() -> io::Result { - let dev = Path::new(env!("CARGO_MANIFEST_DIR")).join("../target/debug/flowc"); +fn get_flowc() -> io::Result { + let root = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap(); + + let dev = root.join("target/debug/flowc"); if dev.exists() { - return Ok(dev.into_os_string().to_str().unwrap().to_string()); + return Ok(dev); } - let dev = Path::new(env!("CARGO_MANIFEST_DIR")).join("../target/release/flowc"); + let dev = root.join("target/release/flowc"); if dev.exists() { - return Ok(dev.into_os_string().to_str().unwrap().to_string()); + return Ok(dev); } - if Simpath::new("PATH") - .find_type("flowr", FileType::File) - .is_ok() - { - return Ok("flowc".into()); + if let Ok(FoundType::File(flowc)) = Simpath::new("PATH").find_type("flowc", FileType::File) { + return Ok(flowc); } Err(io::Error::new( @@ -48,37 +63,29 @@ fn get_flowc() -> io::Result { )) } -fn compile_sample(sample_dir: &Path, flowc: &str) -> io::Result<()> { - // Tell Cargo that if any file in the sample directory changes it should rerun this build script - println!("cargo:rerun-if-changed={}", sample_dir.display()); +fn compile_sample(sample_dir: &Path, flowc: &Path) -> io::Result<()> { + // // Tell Cargo that if any file in the sample directory changes it should rerun this build script + // println!("cargo:rerun-if-changed={}", sample_dir.display()); let mut command = Command::new(flowc); - // -g for debug symbols, -d to dump compiler structs, -s to skip running, only compile the flow - let command_args = vec!["-g", "-d", "-s", sample_dir.to_str().unwrap()]; + // -g for debug symbols, -d to dump compiler structs, -s to skip running and only compile the flow + let command_args = vec!["-g", "-s", sample_dir.to_str().unwrap()]; - match command + let flowc_child = command .args(command_args) .stdin(Stdio::inherit()) .stdout(Stdio::inherit()) .stderr(Stdio::inherit()) - .spawn() - { - Ok(flowc_child) => match flowc_child.wait_with_output() { - Ok(_) => Ok(()), - Err(e) => Err(io::Error::new( - io::ErrorKind::Other, - format!("Error running `flowc`: {}", e), - )), - }, - Err(e) => match e.kind() { - ErrorKind::NotFound => Err(io::Error::new( - io::ErrorKind::Other, - format!("`flowc` was not found! Check your $PATH. {}", e), - )), - _ => Err(io::Error::new( - io::ErrorKind::Other, - format!("Unexpected error occurred spawning `flowc`: {}", e), - )), - }, + .spawn()?; + + let flowc_output = flowc_child.wait_with_output()?; + + match flowc_output.status.code() { + Some(0) => Ok(()), + Some(_) => Err(io::Error::new( + io::ErrorKind::Other, + "`flowc` exited with non-zero status code", + )), + None => Ok(()), } } diff --git a/samples/main.rs b/samples/main.rs index 3c5135ea39..19aaf95448 100644 --- a/samples/main.rs +++ b/samples/main.rs @@ -13,7 +13,7 @@ fn main() -> io::Result<()> { "Current Working Directory: `{}`", std::env::current_dir().unwrap().display() ); - println!("Manifest Directory: `{}`", env!("CARGO_MANIFEST_DIR")); + println!("Samples Root Directory: `{}`", env!("CARGO_MANIFEST_DIR")); let flowr = get_flowr()?; @@ -72,7 +72,8 @@ fn run_sample(sample_dir: &Path, flowr_path: &str) -> io::Result<()> { let mut flowr_command = Command::new(flowr_path); let manifest = sample_dir.join("manifest.json"); - println!("\tRunning Sample: {:?}", sample_dir.file_name().unwrap()); + println!("\n\tRunning Sample: {:?}", sample_dir.file_name().unwrap()); + assert!(manifest.exists(), "Manifest file does not exist"); println!("\tReading STDIN from test.input, Arguments read from test.arguments"); println!("\tOutput sent to STDOUT/STDERR and file output to test.file"); @@ -152,7 +153,7 @@ mod test { println!("\tSample: {:?}", sample_dir.file_name().unwrap()); let manifest = sample_dir.join("manifest.json"); - + assert!(manifest.exists(), "manifest.json does not exist"); let mut command_args: Vec = vec!["--native".into(), manifest.display().to_string()]; command_args.append(&mut super::args(&sample_dir).unwrap()); @@ -209,7 +210,7 @@ mod test { sample_dir.file_name().unwrap(), error.display() ); - std::process::exit(-1); + std::process::exit(1); } } From 2a06ae85ad200c25d76d46d7f436f6acf94b141c Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 11:47:31 +0200 Subject: [PATCH 09/14] Modify cargo:re-run --- samples/build.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/build.rs b/samples/build.rs index da95c4b149..cb27b96773 100644 --- a/samples/build.rs +++ b/samples/build.rs @@ -6,8 +6,11 @@ use std::{fs, io}; use simpath::{FileType, FoundType, Simpath}; fn main() -> io::Result<()> { - println!("cargo:rerun-if-changed=build.rs"); + let samples_root = env!("CARGO_MANIFEST_DIR"); + println!("cargo:rerun-if-env-changed=FLOW_LIB_PATH"); + // Tell Cargo that if any file in the samples directory changes it should rerun this build script + println!("cargo:rerun-if-changed={}", samples_root); println!("`flowsample` version {}", env!("CARGO_PKG_VERSION")); println!( @@ -24,7 +27,7 @@ fn main() -> io::Result<()> { ); // find all sample sub-folders - for entry in fs::read_dir(env!("CARGO_MANIFEST_DIR"))? { + for entry in fs::read_dir(samples_root)? { let e = entry?; if e.file_type()?.is_dir() { println!( @@ -64,12 +67,9 @@ fn get_flowc() -> io::Result { } fn compile_sample(sample_dir: &Path, flowc: &Path) -> io::Result<()> { - // // Tell Cargo that if any file in the sample directory changes it should rerun this build script - // println!("cargo:rerun-if-changed={}", sample_dir.display()); - let mut command = Command::new(flowc); // -g for debug symbols, -d to dump compiler structs, -s to skip running and only compile the flow - let command_args = vec!["-g", "-s", sample_dir.to_str().unwrap()]; + let command_args = vec!["-g", "-d", "-s", sample_dir.to_str().unwrap()]; let flowc_child = command .args(command_args) From 4ff025b7a991faa5ebb4e858b91333d4c1c4c6ca Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 11:48:07 +0200 Subject: [PATCH 10/14] For now don't resolve lib: urls in process references in dot files --- flowc/src/lib/dumper/dump_dot.rs | 68 ++++++++++++++++++------------- flowc/src/lib/dumper/dump_flow.rs | 2 +- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/flowc/src/lib/dumper/dump_dot.rs b/flowc/src/lib/dumper/dump_dot.rs index dd9b890462..c8f9e1df9d 100644 --- a/flowc/src/lib/dumper/dump_dot.rs +++ b/flowc/src/lib/dumper/dump_dot.rs @@ -4,12 +4,9 @@ use std::io::prelude::*; use std::path::Path; use serde_json::Value; -use url::Url; use flowcore::input::InputInitializer::{Always, Once}; -use provider::lib_provider::LibProvider; -use crate::deserializers::deserializer_helper::get_file_extension; use crate::errors::*; use crate::generator::generate::GenerationTables; use crate::model::connection::Connection; @@ -37,11 +34,19 @@ fn absolute_to_relative(absolute: &str, current_dir: &Path) -> Result { Ok(absolute.replace(&format!("file://{}/", root_path.display()), &path_to_root)) } +fn remove_file_extension(file_path: &str) -> String { + let splits: Vec<&str> = file_path.split('.').collect(); + if splits.len() > 1 { + splits[0..splits.len() - 1].join(".") + } else { + file_path.to_owned() + } +} + pub fn write_flow_to_dot( flow: &Flow, dot_file: &mut dyn Write, output_dir: &Path, - provider: &dyn LibProvider, ) -> std::io::Result<()> { dot_file.write_all(digraph_wrapper_start(flow).as_bytes())?; @@ -64,32 +69,9 @@ pub fn write_flow_to_dot( })?; match process { FlowProcess(ref flow) => { - let (flow_source, _) = provider - .resolve_url( - &Url::parse(&process_ref.source).map_err(|_| { - std::io::Error::new( - std::io::ErrorKind::Other, - format!("Could not parse Url from: {}", process_ref.source), - ) - })?, - "", - &[""], - ) - .map_err(|_| { - std::io::Error::new( - std::io::ErrorKind::Other, - format!( - "Could not resolve Url of flow_source: {}", - process_ref.source - ), - ) - })?; + // TODO convert lib reference to a file path or url reference to the actual resource - // remove file extension when forming URL as is of form {file_stem}.dot.svg - let mut flow_source_str = flow_source.to_string(); - if let Some(extension) = get_file_extension(&flow_source) { - flow_source_str.truncate(flow_source_str.len() - (extension.len() + 1)) - } + let flow_source_str = remove_file_extension(&process_ref.source); let relative_path = absolute_to_relative(&flow_source_str, output_dir).map_err(|_| { @@ -447,3 +429,31 @@ pub fn process_refs_to_dot( Ok(output) } + +#[cfg(test)] +mod test { + use super::remove_file_extension; + + #[test] + fn strip_extension() { + assert_eq!("file", remove_file_extension("file.toml")); + } + + #[test] + fn strip_last_extension_only() { + assert_eq!("file.my.file", remove_file_extension("file.my.file.toml")); + } + + #[test] + fn strip_extension_in_path() { + assert_eq!( + "/root/home/file", + remove_file_extension("/root/home/file.toml") + ); + } + + #[test] + fn strip_no_extension() { + assert_eq!("file", remove_file_extension("file")); + } +} diff --git a/flowc/src/lib/dumper/dump_flow.rs b/flowc/src/lib/dumper/dump_flow.rs index 098376dd57..832af463c6 100644 --- a/flowc/src/lib/dumper/dump_flow.rs +++ b/flowc/src/lib/dumper/dump_flow.rs @@ -93,7 +93,7 @@ fn _dump_flow( writer = dump_tables::create_output_file(&output_dir, filename, "dot")?; info!("\tGenerating {}.dot, Use \"dotty\" to view it", filename); - dump_dot::write_flow_to_dot(flow, &mut writer, output_dir, provider)?; + dump_dot::write_flow_to_dot(flow, &mut writer, output_dir)?; // Dump sub-flows for subprocess in &flow.subprocesses { From be8192015541bd77e569a45681a03e40cec80e22 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 12:01:45 +0200 Subject: [PATCH 11/14] Fix image reference in samples/router/DESCRIPTION.md --- samples/router/DESCRIPTION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/router/DESCRIPTION.md b/samples/router/DESCRIPTION.md index a3f1c7dca2..9eb24d2ee4 100644 --- a/samples/router/DESCRIPTION.md +++ b/samples/router/DESCRIPTION.md @@ -1,13 +1,13 @@ router == -Descriptiopn +Description === This sample implements the algorithm (as described here https://github.com/andrewdavidmackenzie/router) for calculating the shortest route from a start-point to an end-point through a simplified road network. -![Road route London Heathrow to City Center]("LHR_to_LON.png") +![Road route London Heathrow to City Center](LHR_to_LON.png) Context Diagram === From 79d641254a980c0149cc37b9297dc4afbabce325 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 12:24:32 +0200 Subject: [PATCH 12/14] Always do docs build on linux, only deploy when building on master --- .travis.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed343ec337..1373dacfb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,16 +46,9 @@ before_install: script: - | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then - # Build the docs nightly - travis_wait 50 make docs - else - travis_wait 50 make clippy build test - fi + travis_wait 50 make clippy build test docs else - if [[ "$TRAVIS_EVENT_TYPE" != "cron" ]]; then - travis_wait 50 make clippy test - fi + travis_wait 50 make clippy test fi # Docs are only built and deployed in "cron" builds on linux with rust stable @@ -65,10 +58,10 @@ deploy: github-token: $GITHUB_PAGES_TOKEN local-dir: target/html keep_history: true - allow_empty_commit: true # Avoid deploy fail on empty commit if nothing has changed in CRON deploy + allow_empty_commit: true # Avoid deploy fail on empty commit if nothing has changed (CRON builds) on: branch: master - condition: $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_EVENT_TYPE == "cron" + condition: $TRAVIS_OS_NAME == "linux" && $TRAVIS_RUST_VERSION == "stable" notifications: email: From 0f24be5a9f4b45c82478c775a8f1802b4579dd75 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 13:55:41 +0200 Subject: [PATCH 13/14] Always do book config on linux --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1373dacfb0..6465931c40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ addons: before_install: - make no-book-config - | - if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" && "$TRAVIS_EVENT_TYPE" == "cron" ]]; then + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make book-config fi From bd18e06d0208c7b2c2739fa55b397ae25aed2b6b Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 8 Apr 2021 14:30:19 +0200 Subject: [PATCH 14/14] Fix conditions for builds in CI, and document in comments --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6465931c40..6b4b0c11ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,24 +34,24 @@ addons: packages: - zmq -# Docs are only built and deployed in "cron" builds - so only prepare that when needed +# Doc building tools are needed on linux with stable rust before_install: - make no-book-config - | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" ]]; then make book-config fi -# Docs are only built and deployed in "cron" builds on linux with rust stable +# Docs are only built on linux with stable rust script: - | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" ]]; then travis_wait 50 make clippy build test docs else travis_wait 50 make clippy test fi -# Docs are only built and deployed in "cron" builds on linux with rust stable +# Docs are only on linux builds of master branch with stable rust deploy: provider: pages skip_cleanup: true @@ -67,6 +67,7 @@ notifications: email: - andrew@mackenzie-serres.net +# avoid measuring coverage on CRON builds, only measure on non-CRON linux builds with stable rust after_success: | if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" && "$TRAVIS_EVENT_TYPE" != "cron" ]]; then FLOW_LIB_PATH=$TRAVIS_BUILD_DIR,$TRAVIS_BUILD_DIR/flowr/src/lib make coverage