Skip to content

Commit 4e721d0

Browse files
Chris Townsendluis4a0
Chris Townsend
andauthored
Merge #3285
3285: Support Mantic compilers r=townsend2010 a=luis4a0 Co-authored-by: Luis Peñaranda <[email protected]>
2 parents ec41570 + 5d2c179 commit 4e721d0

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

3rd-party/fmt

Submodule fmt updated 70 files

3rd-party/submodule_info.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Version: 0.10.4 (+[our patches](https://github.com/CanonicalLtd/libssh/compare/l
1717
<https://www.libssh.org/>
1818

1919
### fmt
20-
Version: 9.1.0 |
20+
Version: 10.1.1 |
2121
<https://github.com/fmtlib/fmt.git> |
2222
<https://github.com/fmtlib/fmt/releases>
2323

include/multipass/ip_address.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define MULTIPASS_IP_ADDRESS_H
2222

2323
#include <array>
24+
#include <cstdint>
2425
#include <string>
2526

2627
namespace multipass

src/cert/ssl_cert_provider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class WritableFile
5353
}
5454

5555
private:
56-
std::unique_ptr<FILE, decltype(fclose)*> fp;
56+
std::unique_ptr<FILE, std::function<int(FILE*)>> fp;
5757
};
5858

5959
class EVPKey

src/client/cli/cmd/transfer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ mp::ReturnCode cmd::Transfer::run(mp::ArgParser* parser)
5959
auto& [sources, target] = *args;
6060
std::error_code err;
6161
if (sources.size() > 1 && !MP_FILEOPS.is_directory(target, err) && !err)
62-
throw std::runtime_error{fmt::format("Target {} is not a directory", target)};
62+
throw std::runtime_error{fmt::format("Target {:?} is not a directory", target)};
6363
else if (err)
64-
throw std::runtime_error{fmt::format("Cannot access {}: {}", target, err.message())};
64+
throw std::runtime_error{fmt::format("Cannot access {:?}: {}", target, err.message())};
6565
for (auto [s, s_end] = sources.equal_range(instance_name); s != s_end; ++s)
6666
success &= sftp_client->pull(s->second, target, flags);
6767
}
@@ -70,7 +70,7 @@ mp::ReturnCode cmd::Transfer::run(mp::ArgParser* parser)
7070
{
7171
auto& [sources, target] = *args;
7272
if (sources.size() > 1 && !sftp_client->is_remote_dir(target))
73-
throw std::runtime_error{fmt::format("Target {} is not a directory", target)};
73+
throw std::runtime_error{fmt::format("Target {:?} is not a directory", target)};
7474
for (const auto& source : sources)
7575
success &= sftp_client->push(source, target, flags);
7676
}

src/ssh/sftp_client.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ bool SFTPClient::push_dir(const fs::path& source_path, const fs::path& target_pa
188188
{
189189
if (sftp_mkdir(sftp.get(), remote_file_path.u8string().c_str(), 0777) != SSH_OK &&
190190
sftp_get_error(sftp.get()) != SSH_FX_FILE_ALREADY_EXISTS)
191-
throw SFTPError{"cannot create remote directory {}: {}", remote_file_path,
191+
throw SFTPError{"cannot create remote directory {:?}: {}",
192+
remote_file_path,
192193
ssh_get_error(sftp->session)};
193194

194195
subdirectory_perms.emplace_back(remote_file_path, status.permissions());
@@ -202,13 +203,14 @@ bool SFTPClient::push_dir(const fs::path& source_path, const fs::path& target_pa
202203

203204
auto remote_file_info = mp_sftp_lstat(sftp.get(), remote_file_path.u8string().c_str());
204205
if (remote_file_info && remote_file_info->type == SSH_FILEXFER_TYPE_DIRECTORY)
205-
throw SFTPError{"cannot overwrite remote directory {} with non-directory", remote_file_path};
206+
throw SFTPError{"cannot overwrite remote directory {:?} with non-directory", remote_file_path};
206207

207208
if ((sftp_unlink(sftp.get(), remote_file_path.u8string().c_str()) != SSH_FX_OK &&
208209
sftp_get_error(sftp.get()) != SSH_FX_NO_SUCH_FILE) ||
209210
sftp_symlink(sftp.get(), link_target.u8string().c_str(), remote_file_path.u8string().c_str()) !=
210211
SSH_FX_OK)
211-
throw SFTPError{"cannot create remote symlink {}: {}", remote_file_path,
212+
throw SFTPError{"cannot create remote symlink {:?}: {}",
213+
remote_file_path,
212214
ssh_get_error(sftp->session)};
213215
break;
214216
}

src/ssh/sftp_utils.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fs::path SFTPUtils::get_remote_file_target(sftp_session sftp, const fs::path& so
7979
target_full_path += source_path.filename().u8string().insert(0, "/");
8080
target_attr = mp_sftp_stat(sftp, target_full_path.u8string().c_str());
8181
if (target_attr && target_attr->type == SSH_FILEXFER_TYPE_DIRECTORY)
82-
throw SFTPError{"cannot overwrite remote directory {} with non-directory", target_full_path};
82+
throw SFTPError{"cannot overwrite remote directory {:?} with non-directory", target_full_path};
8383

8484
return target_full_path;
8585
}
@@ -136,10 +136,10 @@ fs::path SFTPUtils::get_remote_dir_target(sftp_session sftp, const fs::path& sou
136136
auto child_path_string = child_path.u8string();
137137
auto child_info = mp_sftp_stat(sftp, child_path_string.c_str());
138138
if (child_info && child_info->type != SSH_FILEXFER_TYPE_DIRECTORY)
139-
throw SFTPError{"cannot overwrite remote non-directory {} with directory", child_path};
139+
throw SFTPError{"cannot overwrite remote non-directory {:?} with directory", child_path};
140140

141141
if (!child_info && sftp_mkdir(sftp, child_path_string.c_str(), 0777) != SSH_FX_OK)
142-
throw SFTPError{"cannot create remote directory {}: {}", child_path, ssh_get_error(sftp->session)};
142+
throw SFTPError{"cannot create remote directory {:?}: {}", child_path, ssh_get_error(sftp->session)};
143143

144144
return child_path;
145145
}
@@ -154,9 +154,9 @@ void SFTPUtils::mkdir_recursive(sftp_session sftp, const fs::path& path)
154154
for (const auto& partial_path : partial_paths)
155155
if (auto attr = mp_sftp_lstat(sftp, partial_path.u8string().c_str());
156156
attr && attr->type != SSH_FILEXFER_TYPE_DIRECTORY)
157-
throw SFTPError{"cannot overwrite remote non-directory {} with directory", partial_path};
157+
throw SFTPError{"cannot overwrite remote non-directory {:?} with directory", partial_path};
158158
else if (!attr && sftp_mkdir(sftp, partial_path.u8string().c_str(), 0777) != SSH_FX_OK)
159-
throw SFTPError{"cannot create remote directory {}: {}", partial_path, ssh_get_error(sftp->session)};
159+
throw SFTPError{"cannot create remote directory {:?}: {}", partial_path, ssh_get_error(sftp->session)};
160160
}
161161

162162
std::unique_ptr<SFTPClient> SFTPUtils::make_SFTPClient(const std::string& host, int port, const std::string& username,

0 commit comments

Comments
 (0)