Skip to content

Commit

Permalink
Attempt to fix CI (#2637)
Browse files Browse the repository at this point in the history
* Revert "Change brace space in clang-format (#2627)"

This reverts commit 3dce990.

* Revert "Improvement: Support ZST in mamba and enable ZST by default (#2404)"

This reverts commit 60cd358.
  • Loading branch information
AntoinePrv authored Jun 29, 2023
1 parent 6ed76f5 commit 50a627e
Show file tree
Hide file tree
Showing 125 changed files with 1,479 additions and 1,506 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ColumnLimit: '100'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: 'true'
Cpp11BracedListStyle: 'false'
DerivePointerAlignment: 'false'
DisableFormat: 'false'
EmptyLineAfterAccessModifier: Always
Expand Down
3 changes: 2 additions & 1 deletion libmamba/data/conda_exe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4679,5 +4679,6 @@ unsigned char conda_exe[] = {
0x65, 0xe3, 0x00, 0x00, 0x7e, 0xe3, 0x00, 0x00, 0x54, 0x0b, 0x01, 0x00, 0x7e, 0xe3, 0x00, 0x00,
0x97, 0xe3, 0x00, 0x00, 0x54, 0x0b, 0x01, 0x00, 0x9e, 0xe3, 0x00, 0x00, 0xb7, 0xe3, 0x00, 0x00,
0x54, 0x0b, 0x01, 0x00, 0xb7, 0xe3, 0x00, 0x00, 0xd0, 0xe3, 0x00, 0x00, 0x34, 0x0f, 0x01, 0x00,
0xd0, 0xe3, 0x00, 0x00, 0x1c, 0xe4, 0x00, 0x00, 0x30, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00};
0xd0, 0xe3, 0x00, 0x00, 0x1c, 0xe4, 0x00, 0x00, 0x30, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
};
std::size_t conda_exe_len = 74752;
14 changes: 7 additions & 7 deletions libmamba/include/mamba/api/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ namespace mamba
std::map<std::string, T> converted_values;
for (auto& y : values)
{
converted_values.insert({y.first, y.second.as<T>()});
converted_values.insert({ y.first, y.second.as<T>() });
}
set_rc_values(converted_values, sources);
}
Expand Down Expand Up @@ -670,13 +670,13 @@ namespace mamba
if (this->m_api_configured && (level >= ConfigurationLevel::kApi))
{
m_sources.push_back("API");
m_values.insert({"API", m_value});
m_values.insert({ "API", m_value });
}

if (cli_configured() && (level >= ConfigurationLevel::kCli))
{
m_sources.push_back("CLI");
m_values.insert({"CLI", m_cli_config.value()});
m_values.insert({ "CLI", m_cli_config.value() });
}

if (env_var_configured() && env_var_active() && (level >= ConfigurationLevel::kEnvVar))
Expand All @@ -689,7 +689,7 @@ namespace mamba
try
{
m_values.insert(
{env_var, detail::Source<T>::deserialize(env_var_value.value())}
{ env_var, detail::Source<T>::deserialize(env_var_value.value()) }
);
m_sources.push_back(env_var);
}
Expand All @@ -714,13 +714,13 @@ namespace mamba
if ((p_default_value_hook != NULL) && (level >= ConfigurationLevel::kDefault))
{
m_sources.push_back("default");
m_values.insert({"default", p_default_value_hook()});
m_values.insert({ "default", p_default_value_hook() });
}

if (m_sources.empty() && (p_fallback_value_hook != NULL))
{
m_sources.push_back("fallback");
m_values.insert({"fallback", p_fallback_value_hook()});
m_values.insert({ "fallback", p_fallback_value_hook() });
}

if (!m_sources.empty())
Expand Down Expand Up @@ -926,7 +926,7 @@ namespace mamba
std::string name = configurable.name();
if (m_config.count(name) == 0)
{
auto [it, success] = m_config.insert({name, std::move(configurable)});
auto [it, success] = m_config.insert({ name, std::move(configurable) });
it->second.set_configuration(*this);
m_config_order.push_back(name);
}
Expand Down
7 changes: 4 additions & 3 deletions libmamba/include/mamba/api/configuration_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace mamba
{
static std::vector<std::string> default_value(const T&)
{
return std::vector<std::string>({"default"});
return std::vector<std::string>({ "default" });
};

static void merge(
Expand Down Expand Up @@ -328,8 +328,9 @@ namespace YAML
{
private:

inline static const std::array<std::string, 7>
log_level_names = {"trace", "debug", "info", "warning", "error", "critical", "off"};
inline static const std::array<std::string, 7> log_level_names = {
"trace", "debug", "info", "warning", "error", "critical", "off"
};

public:

Expand Down
57 changes: 29 additions & 28 deletions libmamba/include/mamba/core/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,55 +124,55 @@ namespace mamba
// ssl_verify can be either an empty string (regular SSL verification),
// the string "<false>" to indicate no SSL verification, or a path to
// a directory with cert files, or a cert file.
std::string ssl_verify{""};
bool ssl_no_revoke{false};
bool curl_initialized{false}; // non configurable, used in fetch only
std::string ssl_verify{ "" };
bool ssl_no_revoke{ false };
bool curl_initialized{ false }; // non configurable, used in fetch only

std::string user_agent{"mamba/" LIBMAMBA_VERSION_STRING};
std::string user_agent{ "mamba/" LIBMAMBA_VERSION_STRING };

int connect_timeout_secs{10};
int connect_timeout_secs{ 10 };
// int read_timeout_secs { 60 };
int retry_timeout{2}; // seconds
int retry_backoff{3}; // retry_timeout * retry_backoff
int max_retries{3}; // max number of retries
int retry_timeout{ 2 }; // seconds
int retry_backoff{ 3 }; // retry_timeout * retry_backoff
int max_retries{ 3 }; // max number of retries
};

struct OutputParams
{
int verbosity{0};
log_level logging_level{log_level::warn};
int verbosity{ 0 };
log_level logging_level{ log_level::warn };

bool json{false};
bool quiet{false};
bool json{ false };
bool quiet{ false };

std::string log_pattern{"%^%-9!l%-8n%$ %v"};
std::size_t log_backtrace{0};
std::string log_pattern{ "%^%-9!l%-8n%$ %v" };
std::size_t log_backtrace{ 0 };
};

struct GraphicsParams
{
bool no_progress_bars{false};
bool no_progress_bars{ false };
Palette palette;
};

struct SrcParams
{
bool no_rc{false};
bool no_env{false};
bool no_rc{ false };
bool no_env{ false };
};

struct CommandParams
{
std::string caller_version{""};
std::string conda_version{"3.8.0"};
std::string current_command{"mamba"};
bool is_micromamba{false};
std::string caller_version{ "" };
std::string conda_version{ "3.8.0" };
std::string current_command{ "mamba" };
bool is_micromamba{ false };
};

struct ThreadsParams
{
std::size_t download_threads{5};
int extract_threads{0};
std::size_t download_threads{ 5 };
int extract_threads{ 0 };
};

struct PrefixParams
Expand Down Expand Up @@ -271,21 +271,22 @@ namespace mamba

std::string channel_alias = "https://conda.anaconda.org";
std::map<std::string, AuthenticationInfo>& authentication_info();
std::vector<fs::u8path> token_locations{"~/.continuum/anaconda-client/tokens"};
std::vector<fs::u8path> token_locations{ "~/.continuum/anaconda-client/tokens" };

bool override_channels_enabled = true;

std::vector<std::string> pinned_packages = {};

bool use_only_tar_bz2 = false;

std::vector<std::string> repodata_has_zst = {"https://conda.anaconda.org/conda-forge"};
bool repodata_use_zst = false;
std::vector<std::string> repodata_has_zst = { "https://conda.anaconda.org/conda-forge" };

// usernames on anaconda.org can have a underscore, which influences the
// first two characters
const std::regex token_regex{"/t/([a-zA-Z0-9-_]{0,2}[a-zA-Z0-9-]*)"};
const std::regex http_basicauth_regex{"(://|^)([^\\s]+):([^\\s]+)@"};
const std::regex scheme_regex{"[a-z][a-z0-9]{0,11}://"};
const std::regex token_regex{ "/t/([a-zA-Z0-9-_]{0,2}[a-zA-Z0-9-]*)" };
const std::regex http_basicauth_regex{ "(://|^)([^\\s]+):([^\\s]+)@" };
const std::regex scheme_regex{ "[a-z][a-z0-9]{0,11}://" };

static Context& instance();

Expand Down
7 changes: 3 additions & 4 deletions libmamba/include/mamba/core/env_lockfile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ namespace mamba
std::optional<std::type_index> yaml_error_type = std::nullopt
)
{
return mamba_error{
std::forward<StringT>(msg),
mamba_error_code::env_lockfile_parsing_failed,
EnvLockFileError{error_code, yaml_error_type}};
return mamba_error{ std::forward<StringT>(msg),
mamba_error_code::env_lockfile_parsing_failed,
EnvLockFileError{ error_code, yaml_error_type } };
}
};

Expand Down
10 changes: 5 additions & 5 deletions libmamba/include/mamba/core/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace mamba
return;
}

std::scoped_lock lock{threads_mutex};
std::scoped_lock lock{ threads_mutex };
if (is_open) // Double check necessary for correctness
{
threads.emplace_back(std::forward<Task>(task), std::forward<Args>(args)...);
Expand All @@ -91,7 +91,7 @@ namespace mamba
return;
}

std::scoped_lock lock{threads_mutex};
std::scoped_lock lock{ threads_mutex };
if (is_open) // Double check necessary for correctness
{
threads.push_back(std::move(thread));
Expand All @@ -116,7 +116,7 @@ namespace mamba

invoke_close_handlers();

std::scoped_lock lock{threads_mutex};
std::scoped_lock lock{ threads_mutex };
for (auto&& t : threads)
{
t.join();
Expand All @@ -133,7 +133,7 @@ namespace mamba
return;
}

std::scoped_lock lock{handlers_mutex};
std::scoped_lock lock{ handlers_mutex };
if (is_open) // Double check needed to avoid adding new handles while closing.
{
close_handlers.push_back(std::move(handler));
Expand All @@ -142,7 +142,7 @@ namespace mamba

private:

std::atomic<bool> is_open{true};
std::atomic<bool> is_open{ true };
std::vector<std::thread> threads;
std::recursive_mutex threads_mutex; // TODO: replace by synchronized_value once available

Expand Down
2 changes: 1 addition & 1 deletion libmamba/include/mamba/core/package_handling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace mamba
void extract_conda(
const fs::u8path& file,
const fs::u8path& dest_dir,
const std::vector<std::string>& parts = {"info", "pkg"}
const std::vector<std::string>& parts = { "info", "pkg" }
);
void extract(const fs::u8path& file, const fs::u8path& destination);
fs::u8path extract(const fs::u8path& file);
Expand Down
2 changes: 1 addition & 1 deletion libmamba/include/mamba/core/satisfiability_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ namespace mamba
{
fmt::text_style unavailable = fmt::fg(fmt::terminal_color::red);
fmt::text_style available = fmt::fg(fmt::terminal_color::green);
std::array<std::string_view, 4> indents = {"", " ", "├─ ", "└─ "};
std::array<std::string_view, 4> indents = { "", " ", "├─ ", "└─ " };
};

std::ostream& print_problem_tree_msg(
Expand Down
22 changes: 11 additions & 11 deletions libmamba/include/mamba/core/tasksync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace mamba
{
auto make_remote_status()
{
return std::weak_ptr<Status>{m_status};
return std::weak_ptr<Status>{ m_status };
}

public:
Expand Down Expand Up @@ -119,12 +119,12 @@ namespace mamba
// requested.
{ // We can use 'this' safely in this scope.
notify_begin_execution();
on_scope_exit _{[&, this]
{
status.reset(); // Make sure we are not keeping the
// TaskSynchronizer waiting
notify_end_execution();
}};
on_scope_exit _{ [&, this]
{
status.reset(); // Make sure we are not keeping the
// TaskSynchronizer waiting
notify_end_execution();
} };
std::invoke(new_work, std::forward<decltype(args)>(args)...);
}
};
Expand Down Expand Up @@ -178,10 +178,10 @@ namespace mamba

struct Status
{
std::atomic<bool> join_requested{false};
std::atomic<bool> join_requested{ false };
};

std::atomic<int64_t> m_running_tasks{0};
std::atomic<int64_t> m_running_tasks{ 0 };

std::shared_ptr<Status> m_status = std::make_shared<Status>();

Expand All @@ -196,7 +196,7 @@ namespace mamba
void notify_end_execution()
{
{
std::unique_lock exit_lock{m_mutex};
std::unique_lock exit_lock{ m_mutex };
--m_running_tasks;
}
m_task_end_condition.notify_one();
Expand All @@ -209,7 +209,7 @@ namespace mamba
return;
}

std::unique_lock exit_lock{m_mutex};
std::unique_lock exit_lock{ m_mutex };

auto remote_status = make_remote_status();
m_status->join_requested = true;
Expand Down
6 changes: 3 additions & 3 deletions libmamba/include/mamba/core/util_random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace mamba
auto dev = std::random_device{};
std::generate_n(begin(seed), seed_len, std::ref(dev));
auto seed_seq = std::seed_seq(begin(seed), end(seed));
return T{seed_seq};
return T{ seed_seq };
}

template <typename T = std::mt19937>
Expand All @@ -40,7 +40,7 @@ namespace mamba
template <typename T = int, typename G = std::mt19937>
inline T random_int(T min, T max, G& generator = local_random_generator())
{
return std::uniform_int_distribution<T>{min, max}(generator);
return std::uniform_int_distribution<T>{ min, max }(generator);
}

inline std::string generate_random_alphanumeric_string(std::size_t len)
Expand All @@ -50,7 +50,7 @@ namespace mamba
"abcdefghijklmnopqrstuvwxyz";
auto& rng = local_random_generator<std::mt19937>();

auto dist = std::uniform_int_distribution{{}, std::strlen(chars) - 1};
auto dist = std::uniform_int_distribution{ {}, std::strlen(chars) - 1 };
auto result = std::string(len, '\0');
std::generate_n(begin(result), len, [&]() { return chars[dist(rng)]; });
return result;
Expand Down
Loading

0 comments on commit 50a627e

Please sign in to comment.