Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace boost::filesystem with std #6432

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- CHANGED: Avoid copy of std::function-based callback in path unpacking [#6895](https://github.com/Project-OSRM/osrm-backend/pull/6895)
- CHANGED: Replace boost::hash by std::hash [#6892](https://github.com/Project-OSRM/osrm-backend/pull/6892)
- CHANGED: Partial fix migration from boost::optional to std::optional [#6551](https://github.com/Project-OSRM/osrm-backend/issues/6551)
- CHANGED: Replace boost::filesystem with std::filesystem [#6432](https://github.com/Project-OSRM/osrm-backend/pull/6432)
- CHANGED: Update Conan Boost version to 1.85.0. [#6868](https://github.com/Project-OSRM/osrm-backend/pull/6868)
- FIXED: Fix an error in a RouteParameters AnnotationsType operator overload. [#6646](https://github.com/Project-OSRM/osrm-backend/pull/6646)
- ADDED: Add support for "unlimited" to be passed as a value for the default-radius and max-matching-radius flags. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
Expand Down
2 changes: 1 addition & 1 deletion features/support/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function () {
this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000;
this.OSRM_IP = process.env.OSRM_IP || '127.0.0.1';
this.OSRM_CONNECTION_RETRIES = process.env.OSRM_CONNECTION_RETRIES && parseInt(process.env.OSRM_CONNECTION_RETRIES) || 10;
this.OSRM_CONNECTION_EXP_BACKOFF_COEF = process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF && parseFloat(process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF) || 1.0;
this.OSRM_CONNECTION_EXP_BACKOFF_COEF = process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF && parseFloat(process.env.OSRM_CONNECTION_EXP_BACKOFF_COEF) || 1.1;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is to always use exponential back off. This fixed test runs on my dev machine


this.HOST = `http://${this.OSRM_IP}:${this.OSRM_PORT}`;

Expand Down
5 changes: 2 additions & 3 deletions include/contractor/contractor_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "storage/io_config.hpp"
#include "updater/updater_config.hpp"

#include <boost/filesystem/path.hpp>

#include <filesystem>
#include <string>

namespace osrm::contractor
Expand All @@ -47,7 +46,7 @@ struct ContractorConfig final : storage::IOConfig
}

// Infer the output names from the path of the .osrm file
void UseDefaultOutputNames(const boost::filesystem::path &base)
void UseDefaultOutputNames(const std::filesystem::path &base)
{
IOConfig::UseDefaultOutputNames(base);
updater_config.UseDefaultOutputNames(base);
Expand Down
4 changes: 2 additions & 2 deletions include/contractor/files.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace osrm::contractor::files
{
// reads .osrm.hsgr file
template <typename ContractedMetricT>
inline void readGraph(const boost::filesystem::path &path,
inline void readGraph(const std::filesystem::path &path,
std::unordered_map<std::string, ContractedMetricT> &metrics,
std::uint32_t &connectivity_checksum)
{
Expand All @@ -30,7 +30,7 @@ inline void readGraph(const boost::filesystem::path &path,

// writes .osrm.hsgr file
template <typename ContractedMetricT>
inline void writeGraph(const boost::filesystem::path &path,
inline void writeGraph(const std::filesystem::path &path,
const std::unordered_map<std::string, ContractedMetricT> &metrics,
const std::uint32_t connectivity_checksum)
{
Expand Down
5 changes: 2 additions & 3 deletions include/customizer/customizer_config.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#ifndef OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
#define OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP

#include <boost/filesystem/path.hpp>

#include <array>
#include <filesystem>
#include <string>

#include "storage/io_config.hpp"
Expand All @@ -27,7 +26,7 @@ struct CustomizationConfig final : storage::IOConfig
{
}

void UseDefaultOutputNames(const boost::filesystem::path &base)
void UseDefaultOutputNames(const std::filesystem::path &base)
{
IOConfig::UseDefaultOutputNames(base);
updater_config.UseDefaultOutputNames(base);
Expand Down
2 changes: 1 addition & 1 deletion include/customizer/edge_based_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "storage/shared_memory_ownership.hpp"

#include <boost/filesystem/path.hpp>
#include <filesystem>

namespace osrm::customizer
{
Expand Down
8 changes: 4 additions & 4 deletions include/customizer/files.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace osrm::customizer::files

// reads .osrm.cell_metrics file
template <typename CellMetricT>
inline void readCellMetrics(const boost::filesystem::path &path,
inline void readCellMetrics(const std::filesystem::path &path,
std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
{
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
Expand Down Expand Up @@ -44,7 +44,7 @@ inline void readCellMetrics(const boost::filesystem::path &path,
// writes .osrm.cell_metrics file
template <typename CellMetricT>
inline void
writeCellMetrics(const boost::filesystem::path &path,
writeCellMetrics(const std::filesystem::path &path,
const std::unordered_map<std::string, std::vector<CellMetricT>> &metrics)
{
static_assert(std::is_same<CellMetricView, CellMetricT>::value ||
Expand Down Expand Up @@ -72,7 +72,7 @@ writeCellMetrics(const boost::filesystem::path &path,

// reads .osrm.mldgr file
template <typename MultiLevelGraphT>
inline void readGraph(const boost::filesystem::path &path,
inline void readGraph(const std::filesystem::path &path,
MultiLevelGraphT &graph,
std::uint32_t &connectivity_checksum)
{
Expand All @@ -88,7 +88,7 @@ inline void readGraph(const boost::filesystem::path &path,

// writes .osrm.mldgr file
template <typename MultiLevelGraphT>
inline void writeGraph(const boost::filesystem::path &path,
inline void writeGraph(const std::filesystem::path &path,
const MultiLevelGraphT &graph,
const std::uint32_t connectivity_checksum)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade

SharedRTree m_static_rtree;
std::unique_ptr<SharedGeospatialQuery> m_geospatial_query;
boost::filesystem::path file_index_path;
std::filesystem::path file_index_path;

std::optional<extractor::IntersectionBearingsView> intersection_bearings_view;

Expand Down
5 changes: 2 additions & 3 deletions include/engine/engine_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "storage/storage_config.hpp"
#include "osrm/datasets.hpp"

#include <boost/filesystem/path.hpp>

#include <filesystem>
#include <set>
#include <string>

Expand Down Expand Up @@ -83,7 +82,7 @@ struct EngineConfig final
boost::optional<double> default_radius = -1.0;
int max_alternatives = 3; // set an arbitrary upper bound; can be adjusted by user
bool use_shared_memory = true;
boost::filesystem::path memory_file;
std::filesystem::path memory_file;
bool use_mmap = true;
Algorithm algorithm = Algorithm::CH;
std::vector<storage::FeatureDataset> disable_feature_dataset;
Expand Down
13 changes: 6 additions & 7 deletions include/extractor/extractor_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef EXTRACTOR_CONFIG_HPP
#define EXTRACTOR_CONFIG_HPP

#include <boost/filesystem/path.hpp>
#include "storage/io_config.hpp"

#include <array>
#include <filesystem>
#include <string>

#include "storage/io_config.hpp"

namespace osrm::extractor
{

Expand Down Expand Up @@ -71,14 +70,14 @@ struct ExtractorConfig final : storage::IOConfig
{
}

void UseDefaultOutputNames(const boost::filesystem::path &base)
void UseDefaultOutputNames(const std::filesystem::path &base)
{
IOConfig::UseDefaultOutputNames(base);
}

boost::filesystem::path input_path;
boost::filesystem::path profile_path;
std::vector<boost::filesystem::path> location_dependent_data_paths;
std::filesystem::path input_path;
std::filesystem::path profile_path;
std::vector<std::filesystem::path> location_dependent_data_paths;
std::string data_version;

unsigned requested_num_threads = 0;
Expand Down