Skip to content

Commit f80df10

Browse files
committed
Use standard C++ filesystem API only
1 parent 070b6e3 commit f80df10

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

libmamba/environment-dev.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dependencies:
1212
- libcurl 7.82.0 *_0
1313
- gtest
1414
- gmock
15-
- cpp-filesystem >=1.5.8
1615
- cpp-expected
1716
- reproc-cpp
1817
- yaml-cpp
-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#ifndef MAMBA_CORE_FS_HPP
22
#define MAMBA_CORE_FS_HPP
33

4-
#ifdef MAMBA_USE_STD_FS
54
#include <filesystem>
65
#include <fstream>
76
namespace fs = std::filesystem;
8-
#else
9-
#include "ghc/filesystem.hpp"
10-
namespace fs = ghc::filesystem;
11-
#endif
127

138
#endif

libmamba/src/core/environments_manager.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,15 @@ namespace mamba
155155
if (!fs::exists(env_txt_file))
156156
return {};
157157

158-
fs::path abs_loc = fs::absolute(location);
158+
std::error_code fsabs_error;
159+
fs::path abs_loc = fs::absolute(
160+
location, fsabs_error); // If it fails we just get the defaultly constructed path.
161+
if (fsabs_error && !location.empty()) // Ignore cases where we got an empty location.
162+
{
163+
LOG_WARNING << fmt::format("Failed to get absolute path for location '{}' : {}",
164+
location.string(),
165+
fsabs_error.message());
166+
}
159167

160168
std::vector<std::string> lines = read_lines(env_txt_file);
161169
std::set<std::string> final_lines;

libmambapy/environment-dev.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dependencies:
1212
- libcurl 7.82.0 *_0
1313
- gtest
1414
- gmock
15-
- cpp-filesystem >=1.5.8
1615
- cpp-expected
1716
- reproc-cpp
1817
- yaml-cpp

mamba/environment-dev.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dependencies:
1212
- libcurl 7.82.0 *_0
1313
- gtest
1414
- gmock
15-
- cpp-filesystem >=1.5.8
1615
- cpp-expected
1716
- reproc-cpp
1817
- yaml-cpp

micromamba/environment-dev.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dependencies:
1212
- libcurl 7.82.0 *_0
1313
- gtest
1414
- gmock
15-
- cpp-filesystem >=1.5.8
1615
- cpp-expected
1716
- reproc-cpp
1817
- yaml-cpp

0 commit comments

Comments
 (0)