Browse Source

Complete migration to fmt 7.0

default_compile_flags
vector-of-bool 4 years ago
parent
commit
ef887e644b
17 changed files with 25 additions and 23 deletions
  1. +4
    -4
      src/dds/build/builder.cpp
  2. +1
    -1
      src/dds/build/plan/archive.cpp
  3. +1
    -1
      src/dds/build/plan/compile_exec.cpp
  4. +3
    -3
      src/dds/build/plan/exe.cpp
  5. +2
    -2
      src/dds/catalog/import.cpp
  6. +1
    -1
      src/dds/deps.cpp
  7. +1
    -1
      src/dds/error/errors.hpp
  8. +1
    -1
      src/dds/package/id.cpp
  9. +1
    -1
      src/dds/toolchain/from_json.cpp
  10. +1
    -1
      src/dds/usage_reqs.cpp
  11. +1
    -1
      src/dds/util/flock.nix.cpp
  12. +3
    -1
      src/dds/util/flock.win.cpp
  13. +1
    -1
      src/dds/util/fs.cpp
  14. +1
    -1
      src/dds/util/log.hpp
  15. +1
    -1
      src/libman/index.cpp
  16. +1
    -1
      src/libman/package.cpp
  17. +1
    -1
      src/libman/parse.cpp

+ 4
- 4
src/dds/build/builder.cpp View File



dds::stopwatch sw; dds::stopwatch sw;
plan.compile_all(env, params.parallel_jobs); plan.compile_all(env, params.parallel_jobs);
log::info("Compilation completed in {:n}ms", sw.elapsed_ms().count());
log::info("Compilation completed in {:L}ms", sw.elapsed_ms().count());


sw.reset(); sw.reset();
plan.archive_all(env, params.parallel_jobs); plan.archive_all(env, params.parallel_jobs);
log::info("Archiving completed in {:n}ms", sw.elapsed_ms().count());
log::info("Archiving completed in {:L}ms", sw.elapsed_ms().count());


sw.reset(); sw.reset();
plan.link_all(env, params.parallel_jobs); plan.link_all(env, params.parallel_jobs);
log::info("Runtime binary linking completed in {:n}ms", sw.elapsed_ms().count());
log::info("Runtime binary linking completed in {:L}ms", sw.elapsed_ms().count());


sw.reset(); sw.reset();
auto test_failures = plan.run_all_tests(env, params.parallel_jobs); auto test_failures = plan.run_all_tests(env, params.parallel_jobs);
log::info("Test execution finished in {:n}ms", sw.elapsed_ms().count());
log::info("Test execution finished in {:L}ms", sw.elapsed_ms().count());


for (auto& fail : test_failures) { for (auto& fail : test_failures) {
log_failure(fail); log_failure(fail);

+ 1
- 1
src/dds/build/plan/archive.cpp View File

// Do it! // Do it!
log::info("[{}] Archive: {}", _qual_name, out_relpath); log::info("[{}] Archive: {}", _qual_name, out_relpath);
auto&& [dur_ms, ar_res] = timed<std::chrono::milliseconds>([&] { return run_proc(ar_cmd); }); auto&& [dur_ms, ar_res] = timed<std::chrono::milliseconds>([&] { return run_proc(ar_cmd); });
log::info("[{}] Archive: {} - {:n}ms", _qual_name, out_relpath, dur_ms.count());
log::info("[{}] Archive: {} - {:L}ms", _qual_name, out_relpath, dur_ms.count());


// Check, log, and throw // Check, log, and throw
if (!ar_res.okay()) { if (!ar_res.okay()) {

+ 1
- 1
src/dds/build/plan/compile_exec.cpp View File

auto&& [dur_ms, proc_res] auto&& [dur_ms, proc_res]
= timed<std::chrono::milliseconds>([&] { return run_proc(cf.cmd_info.command); }); = timed<std::chrono::milliseconds>([&] { return run_proc(cf.cmd_info.command); });
auto nth = counter.n.fetch_add(1); auto nth = counter.n.fetch_add(1);
log::info("{:60} - {:>7n}ms [{:{}}/{}]",
log::info("{:60} - {:>7L}ms [{:{}}/{}]",
msg, msg,
dur_ms.count(), dur_ms.count(),
nth, nth,

+ 3
- 3
src/dds/build/plan/exe.cpp View File

log::info(msg); log::info(msg);
auto [dur_ms, proc_res] auto [dur_ms, proc_res]
= timed<std::chrono::milliseconds>([&] { return run_proc(link_command); }); = timed<std::chrono::milliseconds>([&] { return run_proc(link_command); });
log::info("{} - {:>6n}ms", msg, dur_ms.count());
log::info("{} - {:>6L}ms", msg, dur_ms.count());


// Check and throw if errant // Check and throw if errant
if (!proc_res.okay()) { if (!proc_res.okay()) {
[&] { return run_proc({.command = {exe_path.string()}, .timeout = 10s}); }); [&] { return run_proc({.command = {exe_path.string()}, .timeout = 10s}); });


if (res.okay()) { if (res.okay()) {
log::info("{} - PASSED - {:>9n}μs", msg, dur.count());
log::info("{} - PASSED - {:>9L}μs", msg, dur.count());
return std::nullopt; return std::nullopt;
} else { } else {
auto exit_msg = fmt::format(res.signal ? "signalled {}" : "exited {}", auto exit_msg = fmt::format(res.signal ? "signalled {}" : "exited {}",
res.signal ? res.signal : res.retc); res.signal ? res.signal : res.retc);
auto fail_str = res.timed_out ? "TIMEOUT" : "FAILED "; auto fail_str = res.timed_out ? "TIMEOUT" : "FAILED ";
log::error("{} - {} - {:>9n}μs [{}]", msg, fail_str, dur.count(), exit_msg);
log::error("{} - {} - {:>9L}μs [{}]", msg, fail_str, dur.count(), exit_msg);
test_failure f; test_failure f;
f.executable_path = exe_path; f.executable_path = exe_path;
f.output = res.output; f.output = res.output;

+ 2
- 2
src/dds/catalog/import.cpp View File



#include <dds/error/errors.hpp> #include <dds/error/errors.hpp>


#include <fmt/core.h>
#include <json5/parse_data.hpp> #include <json5/parse_data.hpp>
#include <neo/assert.hpp> #include <neo/assert.hpp>
#include <semester/walk.hpp> #include <semester/walk.hpp>
#include <spdlog/fmt/fmt.h>


#include <optional> #include <optional>


}; };


template <typename KF, typename... Args> template <typename KF, typename... Args>
any_key(KF&&, Args&&...) -> any_key<KF, Args...>;
any_key(KF&&, Args&&...)->any_key<KF, Args...>;


namespace { namespace {



+ 1
- 1
src/dds/deps.cpp View File

#include <json5/parse_data.hpp> #include <json5/parse_data.hpp>
#include <semester/walk.hpp> #include <semester/walk.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


#include <cctype> #include <cctype>
#include <sstream> #include <sstream>

+ 1
- 1
src/dds/error/errors.hpp View File

#pragma once #pragma once


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


#include <stdexcept> #include <stdexcept>
#include <string_view> #include <string_view>

+ 1
- 1
src/dds/package/id.cpp View File



#include <dds/error/errors.hpp> #include <dds/error/errors.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


#include <tuple> #include <tuple>



+ 1
- 1
src/dds/toolchain/from_json.cpp View File

#include <dds/util/algo.hpp> #include <dds/util/algo.hpp>
#include <dds/util/shlex.hpp> #include <dds/util/shlex.hpp>


#include <fmt/core.h>
#include <json5/parse_data.hpp> #include <json5/parse_data.hpp>
#include <semester/decomp.hpp> #include <semester/decomp.hpp>
#include <spdlog/fmt/fmt.h>


#include <string> #include <string>



+ 1
- 1
src/dds/usage_reqs.cpp View File

#include <dds/error/errors.hpp> #include <dds/error/errors.hpp>
#include <dds/util/algo.hpp> #include <dds/util/algo.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


#include <stdexcept> #include <stdexcept>



+ 1
- 1
src/dds/util/flock.nix.cpp View File



#include <dds/util/signal.hpp> #include <dds/util/signal.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


#include <fcntl.h> #include <fcntl.h>
#include <sys/file.h> #include <sys/file.h>

+ 3
- 1
src/dds/util/flock.win.cpp View File



#include <dds/util/signal.hpp> #include <dds/util/signal.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>
#include <wil/resource.h> #include <wil/resource.h>


#include <cassert>

using namespace dds; using namespace dds;


namespace { namespace {

+ 1
- 1
src/dds/util/fs.cpp View File

#include "./fs.hpp" #include "./fs.hpp"


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


#include <sstream> #include <sstream>



+ 1
- 1
src/dds/util/log.hpp View File

}; };


template <formattable... Args> template <formattable... Args>
void log(level l, std::string_view s, const Args&... args) {
void log(level l, std::string_view s, const Args&... args) noexcept {
if (int(l) >= int(current_log_level)) { if (int(l) >= int(current_log_level)) {
auto message = fmt::format(s, args...); auto message = fmt::format(s, args...);
log_print(l, message); log_print(l, message);

+ 1
- 1
src/libman/index.cpp View File



#include <libman/parse.hpp> #include <libman/parse.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


using namespace lm; using namespace lm;



+ 1
- 1
src/libman/package.cpp View File



#include <libman/parse.hpp> #include <libman/parse.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


using namespace lm; using namespace lm;



+ 1
- 1
src/libman/parse.cpp View File



#include <libman/util.hpp> #include <libman/util.hpp>


#include <spdlog/fmt/fmt.h>
#include <fmt/core.h>


#include <cctype> #include <cctype>
#include <fstream> #include <fstream>

Loading…
Cancel
Save