1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Migration for Boost 1.85

Boost 1.85 removed some deprecated code in filesystem module which is
still used in columnstore:

- The boost/filesystem/convenience.hpp was removed but columnstore does
  not use any functionality from that file except indirect includes.
  Therefore this include is removed or replaced with more general
  boost/filesystem.hpp. The convenience.hpp header file was deprecated
  in filesystem V3 introduced in Boost 1.46.0.

- `normalize` method was removed and users are suggested to replace it
  with `lexically_normal` method, which was introduced in Boost 1.60.0.
  Original `normalize` call is preserved for backward compatibility with
  old Boost version, however`, `lexically_normal` method is preferably
  used with Boost 1.60.0 and newer.

- The `copy_option` was removed in favor of `copy_options` (note the
  trailing 's'), but enum values were renamed. Namely, `fail_if_exists`
  is replaced with `none` and `overwrite_if_exists` is replaced with
  `overwrite_existing`. The `copy_options` was introduced in Boost
  1.74.0.

  New form is used instead, but a backward compatibility layer for Boost
  1.73.0 and older was introduced in boost_copy_options_compat.hpp file.
  This solution seems to be less awkward than using multiple #if #else
  #endif blocks in source code.
This commit is contained in:
Petr Vaněk
2025-02-12 14:06:51 +01:00
committed by Leonid Fedorov
parent ef0647b74a
commit 86159cc899
15 changed files with 48 additions and 20 deletions

View File

@@ -21,6 +21,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include "boost_copy_options_compat.hpp"
#include "LocalStorage.h"
#include "Config.h"
@@ -94,7 +95,7 @@ inline void LocalStorage::addLatency()
int LocalStorage::copy(const bf::path& source, const bf::path& dest)
{
boost::system::error_code err;
bf::copy_file(source, dest, bf::copy_option::fail_if_exists, err);
bf::copy_file(source, dest, bf::copy_options::none, err);
if (err)
{
errno = err.value();

View File

@@ -77,7 +77,13 @@ bf::path Ownership::get(const bf::path& p, bool getOwnership)
bf::path::const_iterator pit;
int i, levels;
#if BOOST_VERSION >= 106000
// available since 1.60.0 released 2015-12-17
normalizedPath.lexically_normal();
#else
// removed in 1.85.0 release 2024-04-15
normalizedPath.normalize();
#endif
// cerr << "Ownership::get() param = " << normalizedPath.string() << endl;
if (prefixDepth > 0)
{