fixed pip install not using utf8

really fixed patcher and manual patches
removed the custom props file for msbuild: not necessary since unicode isn't supported for the destination directory, and it causes file locking issues
This commit is contained in:
isanae
2020-05-13 16:07:52 -04:00
parent 39db5a4416
commit f78f792c5a
4 changed files with 17 additions and 27 deletions
-25
View File
@@ -60,8 +60,6 @@ int msbuild::result() const
void msbuild::do_run()
{
write_custom_props_file();
// 14.2 to v142
const auto toolset = "v" + replace_all(tools::vs::toolset(), ".", "");
@@ -134,27 +132,4 @@ void msbuild::do_run()
execute_and_join();
}
void msbuild::write_custom_props_file()
{
const fs::path file = sln_.parent_path() / "Directory.Build.props";
if (fs::exists(file))
{
cx_->trace(context::generic, "props file {} already exists", file);
return;
}
const std::string content = R"(<!-- generated by mob.exe -->
<Project>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4566</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
</Project>
)";
op::write_text_file(*cx_, file, content);
}
} // namespace
+9
View File
@@ -49,6 +49,15 @@ void patcher::do_run()
cx_->trace(context::generic, "looking for patches in {}", patches);
if (!fs::exists(patches))
{
cx_->trace(context::generic,
"patch directory {} doesn't exist, assuming no patches",
patches);
return;
}
for (auto e : fs::directory_iterator(patches))
{
if (!e.is_regular_file())
+8
View File
@@ -126,6 +126,10 @@ void pip_install::do_run()
{
process_
.binary(python::python_exe())
.chcp(65001)
.stdout_encoding(encodings::utf8)
.stderr_encoding(encodings::utf8)
.arg("-X", "utf8")
.arg("-m", "pip")
.arg("install")
.arg("--no-warn-script-location")
@@ -136,6 +140,10 @@ void pip_install::do_run()
else if (!file_.empty())
process_.arg(file_);
process_
.env(this_env::get()
.set("PYTHONUTF8", "1"));
execute_and_join();
}
-2
View File
@@ -285,8 +285,6 @@ private:
std::string platform_;
arch arch_;
flags_t flags_;
void write_custom_props_file();
};