Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
7458ee1
linux works
nilsnolde Apr 16, 2026
d4e62f9
add to agent.md
nilsnolde Apr 16, 2026
9fe055b
trigger CI
nilsnolde Apr 16, 2026
77de8bd
try CI
nilsnolde Apr 16, 2026
a752d92
try windows
nilsnolde Apr 16, 2026
e16b525
trigger CI
nilsnolde Apr 16, 2026
54ec941
more ci
nilsnolde Apr 16, 2026
0dd6b0d
suppress clang warnings
nilsnolde Apr 16, 2026
91855bc
suppress more
nilsnolde Apr 16, 2026
cfa1065
fix mac & win
nilsnolde Apr 17, 2026
3f3e452
fix path to conanrun.bat
nilsnolde Apr 17, 2026
3713f44
add sdist so that version resolves properly for linux
nilsnolde Apr 17, 2026
2493aeb
fix sdist to wheel
nilsnolde Apr 17, 2026
d2f5e1a
debug
nilsnolde Apr 17, 2026
a3d2ef7
try embedding in huge workflow
nilsnolde Apr 17, 2026
da8e068
trigger CI
nilsnolde Apr 17, 2026
ab38ab8
minor fix
nilsnolde Apr 17, 2026
3c5770f
huh, needs explicit vesion
nilsnolde Apr 17, 2026
062c020
more excluded for sdist
nilsnolde Apr 17, 2026
216bc0d
osx diagnostics
nilsnolde Apr 17, 2026
7dbde9a
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde Apr 17, 2026
427b420
trigger CI
nilsnolde Apr 17, 2026
a1209b0
more ci
nilsnolde Apr 17, 2026
89b2322
try again macos
nilsnolde Apr 20, 2026
636123b
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde Apr 20, 2026
f932c2e
let's try
nilsnolde Apr 21, 2026
1a6c95a
change caching behavior, try to remove libiconv workaround for macos
nilsnolde Apr 21, 2026
a964f66
change runner back to 15. alternatively python bindings could become …
nilsnolde Apr 21, 2026
74a9b4d
disable all other workflows
nilsnolde Apr 21, 2026
63c50f1
try pinning boost to 1.85
nilsnolde Apr 21, 2026
e203d40
push clang diagnostic around boost crc header include
nilsnolde Apr 21, 2026
5f713d0
trigger CI
nilsnolde Apr 21, 2026
4ccad42
use ccache cache on osx & linux for cibuildwheel
nilsnolde Apr 21, 2026
25d54d4
try forcing brew headers to be -isystem
nilsnolde Apr 21, 2026
f26f848
try windows now
nilsnolde Apr 22, 2026
1f3c201
try release on my fork
nilsnolde Apr 22, 2026
c958bf5
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde Apr 22, 2026
b57cd7b
strip to only use python stuff and release that
nilsnolde Apr 22, 2026
54b9347
use workflows from this branch
nilsnolde Apr 22, 2026
7eed6d3
chore: bump version to 26.4.4
github-actions[bot] Apr 22, 2026
ddd0a44
oops
nilsnolde Apr 22, 2026
ee44b63
Merge branch 'nn-py-bindings' of github.com:nilsnolde/osrm-backend in…
nilsnolde Apr 22, 2026
a1ba443
chore: bump version to 26.4.5
github-actions[bot] Apr 22, 2026
17174d1
revert CI testing stuff
nilsnolde Apr 22, 2026
e5a1e6c
Merge branch 'nn-py-bindings' of github.com:nilsnolde/osrm-backend in…
nilsnolde Apr 22, 2026
6bacda3
revert js package*.json
nilsnolde Apr 22, 2026
b08cf08
add other yml
nilsnolde Apr 22, 2026
d58f146
more uncommenting
nilsnolde Apr 22, 2026
f86e062
last fixes
nilsnolde Apr 22, 2026
b361809
add maintenancen commnet
nilsnolde Apr 22, 2026
9ab861d
update development.md
nilsnolde Apr 22, 2026
5b8412d
run pre-commit and add job to check python .pyi stub
nilsnolde Apr 22, 2026
2bcb003
revert version update
nilsnolde Apr 22, 2026
b65c287
docs update
nilsnolde Apr 22, 2026
760b656
change to real pypi
nilsnolde Apr 22, 2026
75d1b9c
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde Apr 28, 2026
0e5dac4
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde Apr 29, 2026
89e2d35
finalize switch to vcpkg
nilsnolde Apr 29, 2026
ccf96bb
add some testing config to upload wheels as artifacts
nilsnolde Apr 29, 2026
a6ade64
fix linux
nilsnolde Apr 29, 2026
c7fcf89
fix specifier
nilsnolde Apr 29, 2026
246dddb
fix both win & macos ci
nilsnolde Apr 29, 2026
38d3d78
some renames and remove non-existent library from delvewheel command
nilsnolde Apr 29, 2026
7294070
make all macos-15 runners actually target macos 15.0
nilsnolde Apr 30, 2026
5717e5e
Merge branch 'master' into nn-py-bindings
nilsnolde Apr 30, 2026
307b0a5
oops
nilsnolde Apr 30, 2026
708670d
Merge branch 'nn-py-bindings' of github.com:nilsnolde/osrm-backend in…
nilsnolde Apr 30, 2026
8a08909
trigger CI
nilsnolde Apr 30, 2026
f9f54a6
that stupid x64 mac..
nilsnolde Apr 30, 2026
bdaa43d
revert ci testing stuff
nilsnolde May 1, 2026
e926d2b
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde May 3, 2026
4ed0a95
don't fetch full history, v6 removed that bug
nilsnolde May 3, 2026
1920ce0
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde May 3, 2026
b22002b
Merge remote-tracking branch 'origin/master' into nn-py-bindings
nilsnolde May 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 177 additions & 22 deletions .github/workflows/osrm-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ concurrency:
cancel-in-progress: true

jobs:
vcpkg-windows-release-node:
vcpkg-windows-release-bindings:
needs: format-taginfo-docs
strategy:
matrix:
os: [windows-2025]
runs-on: ${{ matrix.os }}
Comment on lines +35 to +38
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

just so we can use ${{ matrix.os }} in the cache key, for when we update the runner OS

if: github.repository == 'Project-OSRM/osrm-backend'
runs-on: windows-2025
continue-on-error: false
env:
BUILD_TYPE: Release
Expand All @@ -49,9 +52,9 @@ jobs:
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/.vcpkg-bincache
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-overlay-ports/**') }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

was copy/paste error I guess

key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json', 'vcpkg-overlay-ports/**') }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ runner.arch }}-
vcpkg-${{ runner.os }}-
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
Expand All @@ -64,9 +67,17 @@ jobs:
run: |
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
# cibuildwheel parses [tool.cibuildwheel.windows].environment in
# pyproject.toml as bash export statements. lukka/run-vcpkg sets
# VCPKG_ROOT with native backslashes (D:\a\...), and bash eats those
# as escapes during $VAR expansion, mangling CMAKE_TOOLCHAIN_FILE
# into "D:aosrm-backend...". Rewrite with forward slashes — CMake
# accepts both separators on Windows.
echo "VCPKG_ROOT=${VCPKG_ROOT//\\//}" >> "$GITHUB_ENV"
- run: npm install --ignore-scripts
- run: npm link --ignore-scripts
- name: Build
id: build
shell: bash
run: |
cmake --preset ci-windows -DENABLE_NODE_BINDINGS=ON
Expand Down Expand Up @@ -106,6 +117,22 @@ jobs:
omitNameDuringUpdate: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run CIBuildWheel
if: github.event_name != 'pull_request'
uses: pypa/cibuildwheel@v3.4.0
with:
output-dir: dist
# The wheel-build CMAKE_ARGS (vcpkg toolchain + triplet) and the
# delvewheel --add-path for vcpkg-installed runtime DLLs live in
# [tool.cibuildwheel.windows] in pyproject.toml. VCPKG_ROOT is
# exported by lukka/run-vcpkg above and inherited by cibuildwheel.
- name: Upload Windows wheel
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

release-monthly.yml publishes the wheels

if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: wheels-windows
path: dist/*.whl
if-no-files-found: error

format-taginfo-docs:
if: github.repository == 'Project-OSRM/osrm-backend'
Expand All @@ -129,6 +156,11 @@ jobs:
sudo apt-get install -y clang-format-18
npm ci --ignore-scripts
clang-format-18 --version
- uses: actions/setup-python@v6
with:
python-version: '3.12'
Comment thread
DennisOSRM marked this conversation as resolved.
- name: Run `pre-commit`
uses: pre-commit/action@v3.0.1
- name: Run checks
run: |
./scripts/check_taginfo.py taginfo.json profiles/car.lua
Expand Down Expand Up @@ -314,8 +346,8 @@ jobs:
CXXCOMPILER: g++-12
CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized'

- name: vcpkg-linux-release-node
build_node_package: true
- name: vcpkg-linux-release-bindings
build_bindings: true
continue-on-error: false
node: 24
runs-on: ubuntu-24.04
Expand All @@ -324,8 +356,7 @@ jobs:
CXXCOMPILER: clang++-16
NODE_PACKAGE_TESTS_ONLY: ON

- name: vcpkg-linux-debug-node
build_node_package: true
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

is there a reason why debug was used to build the node package?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure. Might have been an oversight

- name: vcpkg-linux-debug
continue-on-error: false
node: 24
runs-on: ubuntu-24.04
Expand All @@ -343,8 +374,7 @@ jobs:
CXXCOMPILER: clang++-18
ENABLE_LTO: OFF

- name: vcpkg-macos-x64-release-node
build_node_package: true
- name: vcpkg-macos-x64-release
continue-on-error: true
node: 24
runs-on: macos-26-intel # x86_64
Expand All @@ -353,8 +383,7 @@ jobs:
CXXCOMPILER: clang++
ENABLE_ASSERTIONS: ON

- name: vcpkg-macos-arm64-release-node
build_node_package: true
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

both node & python packages are now built on lower macos-15. for python it's kinda necessary for ABI compat, not sure about node, but it can't hurt either.

- name: vcpkg-macos-arm64-release
continue-on-error: true
node: 24
runs-on: macos-26 # arm64
Expand All @@ -363,6 +392,27 @@ jobs:
CXXCOMPILER: clang++
ENABLE_ASSERTIONS: ON

# only for python & nodeJS release, needs a low macos version
- name: vcpkg-macos-x64-release-bindings
build_bindings: true
continue-on-error: true
node: 24
runs-on: macos-15-intel # x86_64
Copy link
Copy Markdown
Contributor Author

@nilsnolde nilsnolde Apr 22, 2026

Choose a reason for hiding this comment

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

the python bindings (and the node ones as well maybe? didn't look) prefer the oldest OS version we can build on, so the widest range of OSs are compatible (same story for linux, where we build on glibc 2.28, current 2.43).

should I create a new job for macos-26 so we cover both min & max? (also creates more CI tension for concurrent branches)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we should probably need an additional job for this

BUILD_TYPE: Release
CCOMPILER: clang
CXXCOMPILER: clang++
ENABLE_ASSERTIONS: ON

- name: vcpkg-macos-arm64-release-bindings
build_bindings: true
continue-on-error: true
node: 24
runs-on: macos-15 # arm64
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

similarly the macos-26 job should stay unchanged

BUILD_TYPE: Release
CCOMPILER: clang
CXXCOMPILER: clang++
ENABLE_ASSERTIONS: ON

name: ${{ matrix.name}}
continue-on-error: ${{ matrix.continue-on-error }}
runs-on: ${{ matrix.runs-on }}
Expand All @@ -382,8 +432,11 @@ jobs:
OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }}
OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }}
ENABLE_LTO: ${{ matrix.ENABLE_LTO }}
BUILD_BINDINGS: ${{ matrix.build_bindings }}
steps:
- uses: actions/checkout@v6
with:
fetch-tags: true
- name: Build machine architecture
run: uname -m
- name: Use Node.js
Expand All @@ -397,8 +450,9 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enable compiler cache
uses: actions/cache@v5
- name: Restore compiler cache
id: ccache-restore
uses: actions/cache/restore@v5
Comment on lines -400 to +455
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I split these up into restore/save to have more control which cache doesn't get uploaded (unsuccessful build stage)

with:
path: ~/.ccache
key: ccache-${{ matrix.name }}-${{ github.sha }}
Expand Down Expand Up @@ -467,16 +521,15 @@ jobs:
fi
echo "CC=${CCOMPILER}" >> $GITHUB_ENV
echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV
if [[ "${RUNNER_OS}" == "macOS" ]]; then
# missing from GCC path, needed when vcpkg builds libiconv, etc.
sudo xcode-select --switch /Library/Developer/CommandLineTools
echo "LIBRARY_PATH=${LIBRARY_PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" >> $GITHUB_ENV
echo "CPATH=${CPATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this created all kinds of problems with reproducible tool chain setups. I tried removing it and the problems went away.

fi

- name: Build and install OSRM
id: build
run: |
echo "Using ${JOBS} jobs"
# so vcpkg's bincache is consistent with cibuildwheel (python bindings)
if [[ "${RUNNER_OS}" == "macOS" && "${BUILD_BINDINGS}" == "true" ]]; then
export MACOSX_DEPLOYMENT_TARGET=15.0
fi
pushd ${OSRM_BUILD_DIR}

ccache --zero-stats
Expand Down Expand Up @@ -562,10 +615,10 @@ jobs:
path: test/logs/

- name: Build Node package
if: ${{ matrix.build_node_package }}
if: ${{ env.BUILD_BINDINGS }}
run: ./scripts/ci/node_package.sh
- name: Publish Node package
if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }}
if: ${{ env.BUILD_BINDINGS && env.PUBLISH == 'On' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
Expand All @@ -577,14 +630,116 @@ jobs:
omitNameDuringUpdate: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}

# Python bindings

- name: Set up Python
if: ${{ env.BUILD_BINDINGS }}
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build sdist
if: ${{ env.BUILD_BINDINGS && runner.os == 'Linux' }}
run: |
python -m pip install build
python -m build --sdist

- name: Locate sdist
if: ${{ env.BUILD_BINDINGS && runner.os == 'Linux' }}
id: sdist
shell: bash
run: echo "path=$(ls dist/*.tar.gz | head -n1)" >> "$GITHUB_OUTPUT"

- name: Run cibuildwheel
uses: pypa/cibuildwheel@v3.4.1
if: ${{ env.BUILD_BINDINGS }}
with:
# for linux build the wheel from the sdist
package-dir: ${{ runner.os == 'Linux' && steps.sdist.outputs.path || '.' }}
output-dir: dist
env:
# The full Linux env (LD_LIBRARY_PATH, CCACHE_DIR, CMAKE_ARGS for the
# vcpkg toolchain) lives in [tool.cibuildwheel.linux].environment in
# pyproject.toml. Setting CIBW_ENVIRONMENT_LINUX here would *replace*
# that whole block (cibuildwheel doesn't merge), so we don't.
CIBW_CONTAINER_ENGINE: "docker; create_args: --volume /home/runner/.ccache:/ccache"
CIBW_CONFIG_SETTINGS_MACOS: "cmake.define.CMAKE_CXX_COMPILER_LAUNCHER=ccache cmake.define.CMAKE_C_COMPILER_LAUNCHER=ccache"

- name: Upload wheels and sdist
if: ${{ env.BUILD_BINDINGS && env.PUBLISH == 'On' }}
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.name }}
path: |
dist/*.whl
dist/*.tar.gz
if-no-files-found: error

- name: Upload Linux wheel for stub check
if: ${{ env.BUILD_BINDINGS && runner.os == 'Linux' && github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: wheel-linux-stub-check
path: dist/*.whl
if-no-files-found: error
retention-days: 1

- name: Show CCache statistics
run: |
ccache -p
ccache -s

# Verify that committed .pyi stubs match the actual C++ bindings when Python
# C++ sources changed. Installs the Linux wheel built by build-matrix,
# regenerates stubs via nanobind, ruff-formats them, and diffs against the repo.
check-python-stubs:
name: Check Python stubs are up to date
needs: build-matrix
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
python_cpp:
- 'src/python/src/**'
- 'src/python/include/**'
- 'src/python/CMakeLists.txt'
- uses: actions/setup-python@v6
Comment on lines +707 to +711
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

only run the actual check if this file filter is true for changed files

if: steps.changes.outputs.python_cpp == 'true'
with:
python-version: '3.12'
- uses: actions/download-artifact@v4
if: steps.changes.outputs.python_cpp == 'true'
with:
name: wheel-linux-stub-check
path: wheelhouse
- name: Install wheel and regenerate stubs
if: steps.changes.outputs.python_cpp == 'true'
run: |
pip install nanobind ruff
pip install wheelhouse/*.whl
python -m nanobind.stubgen -m osrm.osrm_ext -o src/python/osrm/osrm_ext.pyi
ruff format src/python/osrm/osrm_ext.pyi
- name: Check for differences
if: steps.changes.outputs.python_cpp == 'true'
run: |
git diff --exit-code src/python/osrm/osrm_ext.pyi \
|| (echo "::error::Stubs are out of date. Rebuild locally and commit the updated .pyi file." && exit 1)

ci-complete:
runs-on: ubuntu-latest
<<<<<<< HEAD
needs: [build-matrix, vcpkg-windows-release-bindings, docker-image-matrix, check-python-stubs]
=======
needs: [build-matrix, vcpkg-windows-release-node, docker-image-matrix]
if: github.repository == 'Project-OSRM/osrm-backend'
>>>>>>> origin/master
steps:
- name: Fail if any dependency failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
- run: echo "CI complete"
39 changes: 39 additions & 0 deletions .github/workflows/release-monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
contents: write
id-token: write
actions: write
outputs:
tag: ${{ steps.version.outputs.tag }}
version: ${{ steps.version.outputs.version }}
run_id: ${{ steps.wait_ci.outputs.run_id }}
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -178,6 +182,7 @@ jobs:
prerelease: false

- name: Wait for CI to complete
id: wait_ci
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand Down Expand Up @@ -210,6 +215,7 @@ jobs:
if [ "$STATUS" = "completed" ]; then
if [ "$CONCLUSION" = "success" ]; then
echo "✓ CI workflow completed successfully, proceeding with npm publish"
echo "run_id=$RUN_ID" >> "$GITHUB_OUTPUT"
exit 0
else
echo "✗ CI workflow completed with conclusion=$CONCLUSION (expected success)"
Expand All @@ -229,9 +235,42 @@ jobs:
echo "✗ Timed out waiting for CI workflow to complete for tag $TAG"
exit 1


publish:
needs: release
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.release.outputs.tag }}

- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies (skip native build scripts)
run: npm ci --ignore-scripts

- name: Publish to npm
run: npm publish

- name: Download wheels from CI run
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
run-id: ${{ needs.release.outputs.run_id }}
github-token: ${{ github.token }}

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this action only works on a linux runner, so it's another job syncing the wheel artifacts from the osrm-backend.yml run's upload

with:
skip-existing: true
verbose: true
# repository-url: https://test.pypi.org/legacy/

Loading