Skip to content

Commit

Permalink
Allow overriding archspec (#2966)
Browse files Browse the repository at this point in the history
* Allow overriding archspec

* Fix lint
  • Loading branch information
isuruf authored Nov 17, 2023
1 parent be3d531 commit 49e03b2
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions libmamba/src/core/virtual_packages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,29 @@ namespace mamba
#endif
return "x86_64";
}

std::string get_archspec(const std::string& arch)
{
auto override_version = util::get_env("CONDA_OVERRIDE_ARCHSPEC");
if (override_version)
{
return override_version.value();
}

if (arch == "64")
{
return get_archspec_x86_64();
}
else if (arch == "32")
{
return "x86";
}
else
{
return arch;
}
}

std::vector<PackageInfo> dist_packages(const Context& context)
{
LOG_DEBUG << "Loading distribution virtual packages";
Expand Down Expand Up @@ -248,15 +271,7 @@ namespace mamba
}
}

if (arch == "64")
{
arch = get_archspec_x86_64();
}
else if (arch == "32")
{
arch = "x86";
}
res.push_back(make_virtual_package("__archspec", platform, "1", arch));
res.push_back(make_virtual_package("__archspec", platform, "1", get_archspec(arch)));

return res;
}
Expand Down

0 comments on commit 49e03b2

Please sign in to comment.