Skip to content

Commit

Permalink
Fix multiply.toml and improve lib_build output
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdavidmackenzie committed Aug 30, 2023
1 parent 3bb9cba commit 2202090
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
18 changes: 10 additions & 8 deletions flowc/src/bin/flowc/lib_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ fn copy_definition_to_output_dir(toml_path: &Path, output_dir: &Path) -> Result<
let output_file = output_dir.join(toml_path.file_name()
.ok_or("Could not get Toml file filename")?);

debug!("Copying definition file from: {} to {}", toml_path.display(), output_file.display());
println!(" {} {} to {}", "Copying".green(),
toml_path.file_name().ok_or_else(|| "Could not get file name")?.to_string_lossy(),
output_file.display());

fs::copy(toml_path, &output_file)?;

assert!(output_file.exists(), "Copied file does not exist");

Ok(1)
}

Expand Down Expand Up @@ -222,12 +222,13 @@ fn compile_functions(
for entry in glob.walk(&lib_root_path) {
match &entry {
Ok(walk_entry) => {
if walk_entry.path().file_name() == Some(OsStr::new("function.toml")) {
let toml_path = walk_entry.path();
let toml_filename = toml_path.file_name()
.ok_or_else(|| "Could not get toml file name")?.to_string_lossy();
if toml_filename == "function.toml" {
continue;
}

let toml_path = walk_entry.path();

let url = Url::from_file_path(toml_path).map_err(|_| {
format!(
"Could not create url from file path '{}'",
Expand Down Expand Up @@ -375,7 +376,8 @@ fn compile_flows(
for entry in glob.walk(&lib_root_path) {
match &entry {
Ok(walk_entry) => {
if walk_entry.path().file_name() == Some(OsStr::new("function.toml")) {
if walk_entry.path().file_name() == Some(OsStr::new("function.toml")) ||
walk_entry.path().file_name() == Some(OsStr::new("Cargo.toml")) {
continue;
}

Expand Down Expand Up @@ -431,7 +433,7 @@ fn compile_flows(
)
.chain_err(|| "Could not add entry to library manifest")?;
}
Err(err) => debug!("Error parsing '{}'. Reason: '{}'", url, err),
Err(err) => bail!("Error parsing '{}'. Reason: '{}'", url, err),
}
},
Err(e) => bail!("Error walking glob entries: {}", e.to_string())
Expand Down
1 change: 0 additions & 1 deletion flowr/examples/matrix_mult/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ fn main() {
#[cfg(test)]
mod test {
#[test]
#[ignore]
fn test_matrix_mult_example() {
utilities::test_example(file!(), "flowrcli", false, true);
}
Expand Down
4 changes: 2 additions & 2 deletions flowstdlib/src/matrix/multiply.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ from = "input/a"
to = "duplicate_rows"

[[process]]
source = "lib://flowstdlib/data/transpose"
source = "lib://flowstdlib/matrix/transpose"

[[connection]]
from = "input/b"
Expand All @@ -60,7 +60,7 @@ to = "duplicate_rows/factor"

[[process]]
alias = "multiply"
source = "lib://flowstdlib/data/multiply_row"
source = "lib://flowstdlib/matrix/multiply_row"

[[connection]]
from = "duplicate_rows"
Expand Down

0 comments on commit 2202090

Please sign in to comment.