Skip to content

Commit a3f5a26

Browse files
authored
Merge branch 'master' into sf-conan2
2 parents 46f0aa4 + d8680a0 commit a3f5a26

File tree

15 files changed

+105
-203
lines changed

15 files changed

+105
-203
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 10 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197

198198
- name: clang-18-release
199199
continue-on-error: false
200-
node: 18
200+
node: 20
201201
runs-on: ubuntu-24.04
202202
BUILD_TOOLS: ON
203203
BUILD_TYPE: Release
@@ -434,30 +434,12 @@ jobs:
434434
- name: Give tar root ownership
435435
if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
436436
run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar
437-
- name: Cache Boost
438-
if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
439-
id: cache-boost
440-
uses: actions/cache@v4
441-
with:
442-
path: |
443-
/usr/local/include/boost
444-
/usr/local/lib/libboost*
445-
key: v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }}
446-
restore-keys: |
447-
v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }}
448437

449-
- name: Install Boost
450-
if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
451-
run: |
452-
BOOST_VERSION="1.85.0"
453-
BOOST_VERSION_UNDERSCORE="${BOOST_VERSION//./_}"
454-
wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz
455-
tar xzf boost_${BOOST_VERSION_UNDERSCORE}.tar.gz
456-
cd boost_${BOOST_VERSION_UNDERSCORE}
457-
sudo ./bootstrap.sh
458-
sudo ./b2 install
459-
cd ..
460-
sudo rm -rf boost_${BOOST_VERSION_UNDERSCORE}*
438+
- name: Install boost
439+
uses: MarkusJx/install-boost@v2
440+
id: install-boost
441+
with:
442+
boost_version: 1.85.0
461443

462444
- name: Install dev dependencies
463445
run: |
@@ -553,6 +535,8 @@ jobs:
553535
echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV
554536
fi
555537
popd
538+
env:
539+
Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
556540
- name: Build example
557541
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_CONAN != 'ON' }}
558542
run: |
@@ -655,130 +639,9 @@ jobs:
655639
ccache -p
656640
ccache -s
657641
658-
benchmarks:
659-
if: github.event_name == 'pull_request'
660-
needs: [format-taginfo-docs]
661-
runs-on: self-hosted
662-
env:
663-
CCOMPILER: clang-16
664-
CXXCOMPILER: clang++-16
665-
CC: clang-16
666-
CXX: clang++-16
667-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
668-
PR_NUMBER: ${{ github.event.pull_request.number }}
669-
GITHUB_REPOSITORY: ${{ github.repository }}
670-
RUN_BIG_BENCHMARK: ${{ contains(github.event.pull_request.labels.*.name, 'Performance') }}
671-
steps:
672-
- name: Checkout PR Branch
673-
uses: actions/checkout@v4
674-
with:
675-
ref: ${{ github.head_ref }}
676-
path: pr
677-
- name: Activate virtualenv
678-
run: |
679-
python3 -m venv .venv
680-
source .venv/bin/activate
681-
echo PATH=$PATH >> $GITHUB_ENV
682-
pip install "conan==2.7.1" "requests==2.31.0" "numpy==1.26.4"
683-
- name: Prepare data
684-
run: |
685-
if [ "$RUN_BIG_BENCHMARK" = "true" ]; then
686-
rm -rf ~/data.osm.pbf
687-
wget http://download.geofabrik.de/europe/poland-latest.osm.pbf -O ~/data.osm.pbf --quiet
688-
gunzip -c ./pr/test/data/poland_gps_traces.csv.gz > ~/gps_traces.csv
689-
else
690-
if [ ! -f "~/data.osm.pbf" ]; then
691-
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf
692-
else
693-
echo "Using cached data.osm.pbf"
694-
fi
695-
gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv
696-
fi
697-
- name: Prepare environment
698-
run: |
699-
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
700-
mkdir -p $HOME/.ccache
701-
ccache --zero-stats
702-
ccache --max-size=256M
703-
- name: Checkout Base Branch
704-
uses: actions/checkout@v4
705-
with:
706-
ref: ${{ github.event.pull_request.base.ref }}
707-
path: base
708-
- name: Build Base Branch
709-
run: |
710-
cd base
711-
npm ci --ignore-scripts
712-
cd ..
713-
mkdir base/build
714-
cd base/build
715-
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON ..
716-
make -j$(nproc)
717-
make -j$(nproc) benchmarks
718-
cd ..
719-
make -C test/data
720-
- name: Build PR Branch
721-
run: |
722-
cd pr
723-
npm ci --ignore-scripts
724-
cd ..
725-
mkdir -p pr/build
726-
cd pr/build
727-
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON ..
728-
make -j$(nproc)
729-
make -j$(nproc) benchmarks
730-
cd ..
731-
make -C test/data
732-
# we run benchmarks in tmpfs to avoid impact of disk IO
733-
- name: Create folder for tmpfs
734-
run: |
735-
# if by any chance it was mounted before(e.g. due to previous job failed), unmount it
736-
sudo umount ~/benchmarks | true
737-
rm -rf ~/benchmarks
738-
mkdir -p ~/benchmarks
739-
# see https://llvm.org/docs/Benchmarking.html
740-
- name: Run PR Benchmarks
741-
run: |
742-
sudo cset shield -c 2-3 -k on
743-
sudo mount -t tmpfs -o size=4g none ~/benchmarks
744-
cp -rf pr/build ~/benchmarks/build
745-
cp -rf pr/lib ~/benchmarks/lib
746-
mkdir -p ~/benchmarks/test
747-
cp -rf pr/test/data ~/benchmarks/test/data
748-
cp -rf pr/profiles ~/benchmarks/profiles
749-
750-
sudo cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
751-
sudo umount ~/benchmarks
752-
sudo cset shield --reset
753-
- name: Run Base Benchmarks
754-
run: |
755-
sudo cset shield -c 2-3 -k on
756-
sudo mount -t tmpfs -o size=4g none ~/benchmarks
757-
cp -rf base/build ~/benchmarks/build
758-
cp -rf base/lib ~/benchmarks/lib
759-
mkdir -p ~/benchmarks/test
760-
cp -rf base/test/data ~/benchmarks/test/data
761-
cp -rf base/profiles ~/benchmarks/profiles
762-
763-
# TODO: remove it when base branch will have this file at needed location
764-
if [ ! -f ~/benchmarks/test/data/portugal_to_korea.json ]; then
765-
cp base/src/benchmarks/portugal_to_korea.json ~/benchmarks/test/data/portugal_to_korea.json
766-
fi
767-
# we intentionally use scripts from PR branch to be able to update them and see results in the same PR
768-
sudo cset shield --exec -- cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
769-
sudo umount ~/benchmarks
770-
sudo cset shield --reset
771-
- name: Post Benchmark Results
772-
run: |
773-
python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results
774-
- name: Show CCache statistics
775-
run: |
776-
ccache -p
777-
ccache -s
778-
779642
ci-complete:
780-
runs-on: ubuntu-22.04
781-
needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks]
643+
runs-on: ubuntu-latest
644+
needs: [build-test-publish, docker-image-matrix, windows-release-node]
782645
steps:
783646
- run: echo "CI complete"
784647

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- ADDED: Add support for opposite approach request parameter. [#6842](https://github.com/Project-OSRM/osrm-backend/pull/6842)
1010
- ADDED: Add support for accessing edge flags in `process_segment` [#6658](https://github.com/Project-OSRM/osrm-backend/pull/6658)
1111
- Build:
12+
- CHANGED: Fix compilation with upcoming Boost 1.87.0 [#7073](https://github.com/Project-OSRM/osrm-backend/pull/7073)
1213
- CHANGED: Upgrade clang-format to version 15. [#6919](https://github.com/Project-OSRM/osrm-backend/pull/6919)
1314
- CHANGED: Use Debian Bookworm as base Docker image [#6904](https://github.com/Project-OSRM/osrm-backend/pull/6904)
1415
- CHANGED: Upgrade CI actions to latest versions [#6893](https://github.com/Project-OSRM/osrm-backend/pull/6893)
@@ -26,6 +27,7 @@
2627
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
2728
- Misc:
2829
- CHANGED: Migrate to Conan 2.x. [#7042](https://github.com/Project-OSRM/osrm-backend/pull/7042)
30+
- CHANGED: Use std::string_view for key type in json::Object. [#7062](https://github.com/Project-OSRM/osrm-backend/pull/7062)
2931
- CHANGED: Use thread_local instead of boost::thread_specific_ptr. [#6991](https://github.com/Project-OSRM/osrm-backend/pull/6991)
3032
- CHANGED: Bump flatbuffers to v24.3.25 version. [#6988](https://github.com/Project-OSRM/osrm-backend/pull/6988)
3133
- CHANGED: Add .reserve(...) to assembleGeometry function. [#6983](https://github.com/Project-OSRM/osrm-backend/pull/6983)
@@ -78,6 +80,7 @@
7880
- FIXED: Ensure required file check in osrm-routed is correctly enforced. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
7981
- FIXED: Correct HTTP docs to reflect summary output dependency on steps parameter. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
8082
- ADDED: Extract prerelease/build information from package semver [#6839](https://github.com/Project-OSRM/osrm-backend/pull/6839)
83+
- CHANGED: Replaced PL:trunk with PL:expressway to match the latest changes in Polish tagging [#7079](https://github.com/Project-OSRM/osrm-backend/pull/7079)
8184
- Profiles:
8285
- FIXED: Bicycle and foot profiles now don't route on proposed ways [#6615](https://github.com/Project-OSRM/osrm-backend/pull/6615)
8386
- ADDED: Add optional support of cargo bike exclusion and width to bicyle profile [#7044](https://github.com/Project-OSRM/osrm-backend/pull/7044)

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ endif()
7979
if (POLICY CMP0074)
8080
cmake_policy(SET CMP0074 NEW)
8181
endif()
82+
if (POLICY CMP0167)
83+
cmake_policy(SET CMP0167 NEW)
84+
endif()
8285
project(OSRM C CXX)
8386

8487

@@ -377,9 +380,8 @@ if (ENABLE_CONAN)
377380
# note: we avoid calling find_package(Osmium ...) here to ensure that the
378381
# expat and bzip2 are used from conan rather than the system
379382
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
380-
381383
else()
382-
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
384+
find_package(Boost REQUIRED CONFIG COMPONENTS ${BOOST_COMPONENTS})
383385
find_package(TBB REQUIRED)
384386
find_package(EXPAT REQUIRED)
385387
find_package(BZip2 REQUIRED)

docker/Dockerfile-alpine

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
FROM alpine:3.20.0 as alpine-mimalloc
1+
FROM alpine:3.21.2 AS alpine-mimalloc
22

3-
RUN apk add --no-cache mimalloc
3+
RUN apk update && \
4+
apk upgrade && \
5+
apk add --no-cache \
6+
boost-iostreams \
7+
boost-program_options \
8+
boost-thread \
9+
mimalloc
410

511
ENV LD_PRELOAD=/usr/lib/libmimalloc.so.2
612
ENV MIMALLOC_LARGE_OS_PAGES=1
713

814

9-
FROM alpine-mimalloc as builder
15+
FROM alpine-mimalloc AS builder
1016
ARG DOCKER_TAG
1117
ARG BUILD_CONCURRENCY
12-
RUN mkdir -p /src && mkdir -p /opt
1318

14-
RUN apk add --no-cache \
15-
cmake make git clang libbz2 libxml2 \
16-
boost-dev boost-program_options boost-filesystem boost-iostreams boost-thread \
17-
lua5.4-dev onetbb-dev expat-dev
19+
RUN mkdir -p /src /opt && \
20+
apk add --no-cache \
21+
boost-dev \
22+
boost-filesystem \
23+
clang \
24+
cmake \
25+
expat-dev \
26+
git \
27+
libbz2 \
28+
libxml2 \
29+
lua5.4-dev \
30+
make \
31+
onetbb-dev
1832

1933
COPY . /src
2034
WORKDIR /src
@@ -39,16 +53,18 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
3953
rm -rf /src
4054

4155

42-
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
56+
# Multistage build to reduce image size - https://docs.docker.com/build/building/multi-stage/#use-multi-stage-builds
4357
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
44-
FROM alpine-mimalloc as runstage
58+
FROM alpine-mimalloc AS runstage
4559

4660
COPY --from=builder /usr/local /usr/local
4761
COPY --from=builder /opt /opt
4862

4963
RUN apk add --no-cache \
50-
boost-program_options boost-date_time boost-iostreams boost-thread \
51-
expat lua5.4 onetbb && \
64+
boost-date_time \
65+
expat \
66+
lua5.4 \
67+
onetbb && \
5268
ldconfig /usr/local/lib
5369

5470
RUN /usr/local/bin/osrm-extract --help && \
@@ -60,3 +76,4 @@ RUN /usr/local/bin/osrm-extract --help && \
6076
WORKDIR /opt
6177

6278
EXPOSE 5000
79+

docker/Dockerfile-debian

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
FROM debian:bookworm-slim as builder
1+
FROM debian:bookworm-slim AS builder
22
ARG DOCKER_TAG
33
ARG BUILD_CONCURRENCY
4-
RUN mkdir -p /src && mkdir -p /opt
54

6-
RUN apt-get update && \
7-
apt-get -y --no-install-recommends install ca-certificates cmake make git gcc g++ libbz2-dev libxml2-dev wget \
8-
libzip-dev libboost1.81-all-dev lua5.4 liblua5.4-dev pkg-config -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
9-
10-
RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
11-
ldconfig /usr/local/lib && \
12-
git clone --branch v2021.12.0 --single-branch https://github.com/oneapi-src/oneTBB.git && \
13-
cd oneTBB && \
14-
mkdir build && \
15-
cd build && \
16-
cmake -DTBB_TEST=OFF -DCMAKE_BUILD_TYPE=Release .. && \
17-
cmake --build . && \
18-
cmake --install .
5+
RUN mkdir -p /src /opt && \
6+
apt-get update && \
7+
apt-get -y --no-install-recommends --no-install-suggests install \
8+
ca-certificates \
9+
cmake \
10+
g++ \
11+
gcc \
12+
git \
13+
libboost1.81-all-dev \
14+
libbz2-dev \
15+
liblua5.4-dev \
16+
libtbb-dev \
17+
libxml2-dev \
18+
libzip-dev \
19+
lua5.4 \
20+
make \
21+
pkg-config
1922

2023
COPY . /src
2124
WORKDIR /src
@@ -41,19 +44,24 @@ RUN NPROC=${BUILD_CONCURRENCY:-$(nproc)} && \
4144
rm -rf /src
4245

4346

44-
# Multistage build to reduce image size - https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds
47+
# Multistage build to reduce image size - https://docs.docker.com/build/building/multi-stage/#use-multi-stage-builds
4548
# Only the content below ends up in the image, this helps remove /src from the image (which is large)
46-
FROM debian:bookworm-slim as runstage
49+
FROM debian:bookworm-slim AS runstage
4750

4851
COPY --from=builder /usr/local /usr/local
4952
COPY --from=builder /opt /opt
5053

5154
RUN apt-get update && \
52-
apt-get install -y --no-install-recommends \
53-
libboost-program-options1.81.0 libboost-date-time1.81.0 libboost-iostreams1.81.0 libboost-thread1.81.0 \
54-
expat liblua5.4-0 && \
55+
apt-get install -y --no-install-recommends --no-install-suggests \
56+
expat \
57+
libboost-date-time1.81.0 \
58+
libboost-iostreams1.81.0 \
59+
libboost-program-options1.81.0 \
60+
libboost-thread1.81.0 \
61+
liblua5.4-0 \
62+
libtbb12 && \
5563
rm -rf /var/lib/apt/lists/* && \
56-
# add /usr/local/lib to ldconfig to allow loading libraries from there
64+
# Add /usr/local/lib to ldconfig to allow loading libraries from there
5765
ldconfig /usr/local/lib
5866

5967
RUN /usr/local/bin/osrm-extract --help && \
@@ -65,3 +73,4 @@ RUN /usr/local/bin/osrm-extract --help && \
6573
WORKDIR /opt
6674

6775
EXPOSE 5000
76+

include/nodejs/json_v8_renderer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct V8Renderer
3030
{
3131
Napi::Value child;
3232
std::visit(V8Renderer(env, child), keyValue.second);
33-
obj.Set(keyValue.first, child);
33+
obj.Set(keyValue.first.data(), child);
3434
}
3535
out = obj;
3636
}

include/server/server.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ class Server
5353
const auto port_string = std::to_string(port);
5454

5555
boost::asio::ip::tcp::resolver resolver(io_context);
56-
boost::asio::ip::tcp::resolver::query query(address, port_string);
57-
boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
56+
boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(address, port_string).begin();
5857

5958
acceptor.open(endpoint.protocol());
6059
#ifdef SO_REUSEPORT

0 commit comments

Comments
 (0)