diff --git a/src/main.cpp b/src/main.cpp index e6d930d31..4772e46d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -332,9 +332,13 @@ int main(int argc, char **argv) { if (noparse) return 0; - bool ok = true; - auto wakefiles = find_all_wakefiles(ok, workspace, verbose); - if (!ok) std::cerr << "Workspace wake file enumeration failed" << std::endl; + bool enumok = true; + auto wakefiles = find_all_wakefiles(enumok, workspace, verbose); + if (!enumok) { + if (verbose) std::cerr << "Workspace wake file enumeration failed" << std::endl; + // Try to run the build anyway; if wake files are missing, it will fail later + // The unreadable location might be irrelevant to the build + } uint64_t target_hash = 0; if (hash) { @@ -349,14 +353,18 @@ int main(int argc, char **argv) { Profile tree; Runtime runtime(profile ? &tree : nullptr, profileh, heap_factor, target_hash); bool sources = find_all_sources(runtime, workspace); - if (!sources) std::cerr << "Source file enumeration failed" << std::endl; - ok &= sources; + if (!sources) { + if (verbose) std::cerr << "Source file enumeration failed" << std::endl; + // Try to run the build anyway; if sources are missing, it will fail later + // The unreadable location might be irrelevant to the build + } // Select a default package int longest_src_dir = -1; bool warned_conflict = false; // Read all wake build files + bool ok = true; Scope::debug = debug; std::unique_ptr top(new Top); for (auto &i : wakefiles) { diff --git a/src/sources.cpp b/src/sources.cpp index 3e353bf14..5867ff945 100644 --- a/src/sources.cpp +++ b/src/sources.cpp @@ -569,8 +569,8 @@ std::vector find_all_wakefiles(bool &ok, bool workspace, bool verbo std::string rel_libdir = make_relative(get_cwd(), make_canonical(abs_libdir)); std::vector acc; - ok = ok && !push_files(acc, rel_libdir, exp, 0); - if (workspace) ok = ok && !push_files(acc, ".", exp, 0); + if (push_files(acc, rel_libdir, exp, 0)) ok = false; + if (workspace && push_files(acc, ".", exp, 0)) ok = false; // make the output distinct std::sort(acc.begin(), acc.end()); @@ -669,7 +669,7 @@ static PRIMFN(prim_files) { std::vector match; bool fail = push_files(match, root, *arg1->exp, skip); - if (fail) match.clear(); // !!! There's a hole in the API + (void)fail; // !!! There's a hole in the API size_t need = reserve_list(match.size()); for (auto &x : match) need += String::reserve(x.size());