Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c2116ac
compiler(msvc): add MSVC versions of RAWSPEED attribute macros
Abas-Tim Aug 27, 2026
5135ea1
compiler(msvc): guard printf-format attribute on writeLog
Abas-Tim Aug 27, 2026
896c0e0
fix(msvc): explicit Array1DRef<const DngSliceElement> template args
Abas-Tim Aug 27, 2026
bd543a3
fix(msvc): explicit Array1DRef template args in LJpegDecompressor
Abas-Tim Aug 27, 2026
d9dc164
build: vendor pugixml and zlib-ng for offline in-tree builds
Abas-Tim Aug 27, 2026
6ac2e8f
build(msvc): tolerate zlib-ng alias targets in bundled zlib module
Abas-Tim Aug 27, 2026
94dc10d
build: include zlib-ng tree and generated dirs for zconf.h
Abas-Tim Aug 27, 2026
1ebbc05
build: force ZLIB_COMPAT for bundled zlib-ng
Abas-Tim Aug 27, 2026
516a40c
build: vendor madler zlib 1.3.1 instead of zlib-ng
Abas-Tim Aug 27, 2026
dc26936
build: stop tracking generated zconf.h in vendored zlib
Abas-Tim Aug 27, 2026
05ef909
ci: publish rawspeed-cli releases from this fork
Abas-Tim Aug 27, 2026
28dc920
ci: drop --verify-tag when uploading the release
Abas-Tim Aug 27, 2026
a27f1ba
ci: upload release assets via REST instead of gh CLI
Abas-Tim Aug 27, 2026
b782160
feat: add rawspeed-cli with MSVC build support and publish CI
Abas-Tim Sep 5, 2026
f504b20
build: default bundled pugixml/zlib paths to the vendored trees
Abas-Tim Sep 5, 2026
9f12432
style: clang-format rawspeed-cli and AbstractDngDecompressor sources
Abas-Tim Sep 5, 2026
864c4d1
ci: exclude vendored third_party from the clang-format check
Abas-Tim Sep 5, 2026
af133b6
fix: make rawspeed-cli warning-clean under the CI -Weverything set
Abas-Tim Sep 5, 2026
30373b0
build: disable example binaries in the bundled zlib build
Abas-Tim Sep 5, 2026
5716209
fix: address clang-tidy findings in rawspeed-cli
Abas-Tim Sep 5, 2026
9b7c937
build: ignore C2y-extensions warnings for clang
Abas-Tim Sep 5, 2026
d28f713
ci: pin CodeChecker-based analysis flavors to clang-19
Abas-Tim Sep 5, 2026
b8b2305
ci: do not fail the pipeline on codecov upload errors
Abas-Tim Sep 5, 2026
7e0d05a
ci: trim inherited upstream triggers to keep Actions usage minimal
Abas-Tim Sep 6, 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
1 change: 1 addition & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
**/*\.yml$
**/\.clang-tidy$
**/CMakeLists\.txt$
^third_party/
\.ci/**/*
\.clang-format$
\.clang-format-ignore$
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/CI-codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
name: ${{ env.JOB_NAME }}.Unittests
root_dir: ${{ github.workspace }}/rawspeed
directory: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_PREFIX }}/linux/unittests
fail_ci_if_error: true
fail_ci_if_error: false
- name: Upload coverage to Codecov (linux, benchmarks)
timeout-minutes: 1
uses: codecov/codecov-action@v5
Expand All @@ -77,7 +77,7 @@ jobs:
name: ${{ env.JOB_NAME }}.Benchmarks
root_dir: ${{ github.workspace }}/rawspeed
directory: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_PREFIX }}/linux/benchmarks
fail_ci_if_error: true
fail_ci_if_error: false
- name: Upload coverage to Codecov (linux, integration)
timeout-minutes: 1
uses: codecov/codecov-action@v5
Expand All @@ -93,7 +93,7 @@ jobs:
name: ${{ env.JOB_NAME }}.Integration
root_dir: ${{ github.workspace }}/rawspeed
directory: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_PREFIX }}/linux/integration
fail_ci_if_error: true
fail_ci_if_error: false
- name: Upload coverage to Codecov (macOS, unit tests)
timeout-minutes: 1
uses: codecov/codecov-action@v5
Expand All @@ -109,7 +109,7 @@ jobs:
name: ${{ env.JOB_NAME }}.Unittests
root_dir: ${{ github.workspace }}/rawspeed
directory: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_PREFIX }}/macOS/unittests
fail_ci_if_error: true
fail_ci_if_error: false
- name: Upload coverage to Codecov (macOS, benchmarks)
timeout-minutes: 1
uses: codecov/codecov-action@v5
Expand All @@ -125,7 +125,7 @@ jobs:
name: ${{ env.JOB_NAME }}.Benchmarks
root_dir: ${{ github.workspace }}/rawspeed
directory: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_PREFIX }}/macOS/benchmarks
fail_ci_if_error: true
fail_ci_if_error: false
- name: Upload coverage to Codecov (windows, unit tests)
timeout-minutes: 1
uses: codecov/codecov-action@v5
Expand All @@ -141,7 +141,7 @@ jobs:
name: ${{ env.JOB_NAME }}.Unittests
root_dir: ${{ github.workspace }}/rawspeed
directory: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_PREFIX }}/windows/unittests
fail_ci_if_error: true
fail_ci_if_error: false
- name: Upload coverage to Codecov (windows, benchmarks)
timeout-minutes: 1
uses: codecov/codecov-action@v5
Expand All @@ -157,4 +157,4 @@ jobs:
name: ${{ env.JOB_NAME }}.Benchmarks
root_dir: ${{ github.workspace }}/rawspeed
directory: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_PREFIX }}/windows/benchmarks
fail_ci_if_error: true
fail_ci_if_error: false
2 changes: 0 additions & 2 deletions .github/workflows/CI-rpuu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
outputs:
rpuu-cache-key:
value: ${{ jobs.linux.outputs.rpuu-cache-key }}
schedule:
- cron: "30 0 * * SUN"
workflow_dispatch:

concurrency:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
name: CI

on:
push:
branches: [ develop, stable ]
pull_request:

concurrency:
Expand Down Expand Up @@ -76,10 +74,10 @@ jobs:
compiler: { distro: "debian:trixie-slim", family: LLVM, version: 18, CC: clang-18, CXX: clang++-18, CLANG_TIDY: clang-tidy-18 } # FIXME: should be LLVM21-based.
flavor: ClangTidy
- os: linux
compiler: { distro: "debian:forky-slim", family: LLVM, version: 21, CC: clang-21, CXX: clang++-21 }
compiler: { distro: "debian:forky-slim", family: LLVM, version: 19, CC: clang-19, CXX: clang++-19 } # FIXME: clang-21 dropped -dumpfullversion, breaking CodeChecker.
flavor: ClangStaticAnalysis
- os: linux
compiler: { distro: "debian:forky-slim", family: LLVM, version: 21, CC: clang-21, CXX: clang++-21 }
compiler: { distro: "debian:forky-slim", family: LLVM, version: 19, CC: clang-19, CXX: clang++-19 } # FIXME: clang-21 dropped -dumpfullversion, breaking CodeChecker.
flavor: ClangCTUStaticAnalysis
- os: linux
compiler: { distro: "debian:forky-slim", family: LLVM, version: 21, CC: clang-21, CXX: clang++-21 }
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Ensure that the code is properly clang-formatted

on:
push:
branches: [ develop, stable ]
pull_request_target:

concurrency:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defaults:

jobs:
build-docs:
if: github.repository == 'darktable-org/rawspeed'
strategy:
matrix:
os: [ linux ]
Expand All @@ -40,6 +41,7 @@ jobs:
compiler-CXX: ${{ matrix.compiler.CXX }}
flavor: ${{ matrix.flavor }}
publish-pages:
if: github.repository == 'darktable-org/rawspeed'
needs: build-docs
runs-on: ubuntu-latest
environment:
Expand Down
155 changes: 155 additions & 0 deletions .github/workflows/rawspeed-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: rawspeed-cli publish

on:
push:
tags:
- "rawspeed-cli-v*"

permissions:
contents: write

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure
shell: pwsh
run: |
cmake -S . -B build -A x64 `
'-DCMAKE_CXX_FLAGS=/Zc:preprocessor /EHsc /utf-8' `
'-DBUILD_TESTING=OFF' `
'-DBUILD_BENCHMARKING=OFF' `
'-DBUILD_FUZZERS=OFF' `
'-DBUILD_DOCS=OFF' `
'-DBUILD_TOOLS=ON' `
'-DRAWSPEED_ENABLE_DEBUG_INFO=OFF' `
'-DRAWSPEED_ENABLE_WERROR=OFF' `
'-DUSE_XMLLINT=OFF' `
'-DWITH_OPENMP=OFF' `
'-DWITH_JPEG=OFF' `
'-DWITH_PUGIXML=ON' `
'-DUSE_BUNDLED_PUGIXML=ON' `
"-DPUGIXML_PATH=$env:GITHUB_WORKSPACE/third_party/pugixml-1.14" `
'-DALLOW_DOWNLOADING_PUGIXML=OFF' `
'-DWITH_ZLIB=ON' `
'-DUSE_BUNDLED_ZLIB=ON' `
"-DZLIB_PATH=$env:GITHUB_WORKSPACE/third_party/zlib-1.3.1" `
'-DALLOW_DOWNLOADING_ZLIB=OFF' `
'-DCMAKE_BUILD_TYPE=Release'

- name: Build
shell: pwsh
run: cmake --build build --config Release --target rawspeed-cli --parallel

- name: Smoke test
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$exe = Get-ChildItem -Path build -Recurse -File -Filter rawspeed-cli.exe |
Select-Object -First 1
if ($null -eq $exe) {
throw "rawspeed-cli.exe not found under build/"
}
$output = (& $exe.FullName 2>&1 | Out-String)
$exitCode = $LASTEXITCODE
"exe: $($exe.FullName)" | Add-Content $env:GITHUB_STEP_SUMMARY
"exit: $exitCode" | Add-Content $env:GITHUB_STEP_SUMMARY
"output: $output" | Add-Content $env:GITHUB_STEP_SUMMARY
if ($exitCode -ne 2 -or $output -notmatch '(?m)usage:\s+rawspeed-cli\b') {
throw "rawspeed-cli smoke test failed: exe=$($exe.FullName) exit=$exitCode output=[$output]"
}
Write-Output "smoke test ok: $($exe.FullName)"

- name: Stage and checksum
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$tag = $env:GITHUB_REF_NAME
if ($tag -notmatch '^rawspeed-cli-v(?<version>[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?)$') {
throw "Unexpected release tag: $tag"
}
$version = $Matches.version
$exe = Get-ChildItem -Path build -Recurse -File -Filter rawspeed-cli.exe |
Select-Object -First 1
if ($null -eq $exe) {
throw "rawspeed-cli.exe not found under build/"
}

$packageDir = Join-Path $env:GITHUB_WORKSPACE "pkg"
Remove-Item $packageDir -Recurse -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $packageDir | Out-Null
Copy-Item $exe.FullName (Join-Path $packageDir "rawspeed-cli.exe") -Force
Get-ChildItem -Path $exe.DirectoryName -File -Filter *.dll |
Copy-Item -Destination $packageDir -Force

$zipName = "rawspeed-cli-win-x64-v$version.zip"
$zipPath = Join-Path $env:GITHUB_WORKSPACE $zipName
Compress-Archive -Path (Join-Path $packageDir "*") `
-DestinationPath $zipPath -CompressionLevel Optimal
$checksum = (Get-FileHash $zipPath -Algorithm SHA256).Hash.ToLowerInvariant()
Set-Content -Path "$zipPath.sha256" -Value $checksum -NoNewline -Encoding ascii
"RELEASE_TAG=$tag" >> $env:GITHUB_ENV
"RELEASE_VERSION=$version" >> $env:GITHUB_ENV
"RELEASE_ZIP=$zipName" >> $env:GITHUB_ENV

- name: Upload to release
env:
GITHUB_TOKEN: ${{ github.token }}
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$headers = @{
Authorization = "Bearer $env:GITHUB_TOKEN"
Accept = "application/vnd.github+json"
"X-GitHub-Api-Version" = "2022-11-28"
}
$repo = $env:GITHUB_REPOSITORY
$tag = [uri]::EscapeDataString($env:RELEASE_TAG)
$releaseUrl = "https://api.github.com/repos/$repo/releases/tags/$tag"
try {
$release = Invoke-RestMethod -Method Get -Uri $releaseUrl -Headers $headers
} catch {
$statusCode = if ($null -ne $_.Exception.Response) {
[int]$_.Exception.Response.StatusCode
} else {
0
}
if ($statusCode -ne 404) {
throw
}
$payload = @{
tag_name = $env:RELEASE_TAG
name = "rawspeed-cli v$env:RELEASE_VERSION"
body = "Prebuilt rawspeed-cli Windows x64 binary from commit $env:GITHUB_SHA."
} | ConvertTo-Json
$release = Invoke-RestMethod -Method Post `
-Uri "https://api.github.com/repos/$repo/releases" `
-Headers $headers -Body $payload -ContentType "application/json"
}

$assetNames = @(
$env:RELEASE_ZIP,
"$env:RELEASE_ZIP.sha256"
)
foreach ($assetName in $assetNames) {
$asset = @($release.assets) |
Where-Object { $_.name -eq $assetName } |
Select-Object -First 1
if ($null -ne $asset) {
Invoke-RestMethod -Method Delete -Uri $asset.url -Headers $headers
}
}

foreach ($fileName in $assetNames) {
$filePath = Join-Path $env:GITHUB_WORKSPACE $fileName
$escapedName = [uri]::EscapeDataString($fileName)
$uploadUrl = "https://uploads.github.com/repos/$repo/releases/$($release.id)/assets?name=$escapedName"
Invoke-RestMethod -Method Post -Uri $uploadUrl -Headers $headers `
-ContentType $(if ($fileName.EndsWith(".zip")) { "application/zip" } else { "text/plain" }) `
-InFile $filePath | Out-Null
}
Write-Output "release assets uploaded for $env:RELEASE_TAG"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ bw-output/
*.gcno
*.gcda
*.gcov
third_party/zlib-1.3.1/zconf.h
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ endif()

option(WITH_PUGIXML "Enable XML support for cameras.xml reading" ON)
if(WITH_PUGIXML)
option(USE_BUNDLED_PUGIXML "Build and use pugixml in-tree" OFF)
option(USE_BUNDLED_PUGIXML "Build and use pugixml in-tree" ON)
else()
set(USE_BUNDLED_PUGIXML OFF CACHE BOOL "Build and use pugixml in-tree" FORCE)
set(USE_BUNDLED_PUGIXML OFF CACHE BOOL "Build and use pugixml in-tree")
endif()
if(WITH_PUGIXML AND USE_BUNDLED_PUGIXML)
option(ALLOW_DOWNLOADING_PUGIXML "If pugixml src tree is not found in location specified by PUGIXML_PATH, do fetch the archive from internet" OFF)
Expand All @@ -82,9 +82,9 @@ endif()
option(WITH_JPEG "Enable JPEG support for DNG Lossy JPEG support" ON)
option(WITH_ZLIB "Enable ZLIB support for DNG deflate support" ON)
if(WITH_ZLIB)
option(USE_BUNDLED_ZLIB "Build and use zlib in-tree" OFF)
option(USE_BUNDLED_ZLIB "Build and use zlib in-tree" ON)
else()
set(USE_BUNDLED_ZLIB OFF CACHE BOOL "Build and use zlib in-tree" FORCE)
set(USE_BUNDLED_ZLIB OFF CACHE BOOL "Build and use zlib in-tree")
endif()
if(WITH_ZLIB AND USE_BUNDLED_ZLIB)
option(ALLOW_DOWNLOADING_ZLIB "If ZLIB src tree is not found in location specified by ZLIB_PATH, do fetch the archive from internet" OFF)
Expand Down Expand Up @@ -123,9 +123,11 @@ endif()
set(GOOGLETEST_PATH "/usr/src/googletest" CACHE PATH
"Path to the googletest root tree. Should contain googletest and googlemock subdirs. And CMakeLists.txt in root, and in both of these subdirs")

set(PUGIXML_PATH "/usr/src/pugixml" CACHE PATH "Path to the pugixml root tree.")
set(PUGIXML_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/pugixml-1.14" CACHE PATH
"Path to the pugixml root tree.")

set(ZLIB_PATH "/usr/src/zlib" CACHE PATH "Path to the zlib root tree.")
set(ZLIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib-1.3.1" CACHE PATH
"Path to the zlib root tree.")

set(GOOGLEBENCHMARK_PATH "/usr/src/googlebenchmark" CACHE PATH
"Path to the googlebenchmark root tree.")
Expand Down
15 changes: 12 additions & 3 deletions cmake/Modules/Zlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,27 @@ include(${ZLIB_PREFIX}/zlib-paths.cmake)

# XXX make sure that zlib is using it's own headers
# see https://github.com/madler/zlib/issues/218
include_directories(BEFORE SYSTEM ${ZLIB_PREFIX}/zlib-src)
include_directories(BEFORE SYSTEM ${ZLIB_PREFIX}/zlib-build)
include_directories(BEFORE SYSTEM ${ZLIB_SOURCE_DIR})
include_directories(BEFORE SYSTEM ${ZLIB_BINARY_DIR})

# Add zlib directly to our build. This defines
# the gtest and gtest_main targets.
set(ZLIB_COMPAT ON CACHE BOOL "Compile with zlib compatible API" FORCE)

set(ZLIB_BUILD_EXAMPLES OFF CACHE BOOL "Enable Zlib Examples" FORCE)

add_subdirectory(${ZLIB_SOURCE_DIR}
${ZLIB_BINARY_DIR})

set(_zlib_lib zlib) # shared
set(_zlib_lib zlibstatic) # static

set_target_properties(${_zlib_lib} PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_zlib_lib},INTERFACE_INCLUDE_DIRECTORIES>)
if(TARGET ${_zlib_lib})
get_target_property(_zlib_alias_target ${_zlib_lib} ALIASED_TARGET)
if(NOT _zlib_alias_target)
set_target_properties(${_zlib_lib} PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_zlib_lib},INTERFACE_INCLUDE_DIRECTORIES>)
endif()
endif()

set(ZLIB_LIBRARIES ${_zlib_lib})

Expand Down
20 changes: 14 additions & 6 deletions cmake/compiler-flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(MSVC)
add_compile_options(/EHsc)
endif()

# Workaround cmake-3.28 referencing (non-existant) `@foo.modmap`
# in compilation commands.
set(CMAKE_CXX_SCAN_FOR_MODULES NO)
Expand Down Expand Up @@ -81,8 +85,10 @@ if(RAWSPEED_ENABLE_LTO)
)
endif()

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
if(NOT MSVC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(coverage_compilation "-fprofile-instr-generate=\"default-%m-%p.profraw\" -fcoverage-mapping")
Expand Down Expand Up @@ -214,8 +220,10 @@ MARK_AS_ADVANCED(
CMAKE_SHARED_LINKER_FLAGS_TSAN
CMAKE_SHARED_MODULE_FLAGS_TSAN )

set(CMAKE_C_FLAGS_RELEASEWITHASSERTS "${CMAKE_C_FLAGS_RELEASEWITHASSERTS} -O3")
set(CMAKE_CXX_FLAGS_RELEASEWITHASSERTS "${CMAKE_CXX_FLAGS_RELEASEWITHASSERTS} -O3")
if(NOT MSVC)
set(CMAKE_C_FLAGS_RELEASEWITHASSERTS "${CMAKE_C_FLAGS_RELEASEWITHASSERTS} -O3")
set(CMAKE_CXX_FLAGS_RELEASEWITHASSERTS "${CMAKE_CXX_FLAGS_RELEASEWITHASSERTS} -O3")

set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
endif()
Loading
Loading