1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-22 18:29:36 +01:00

build(libstore): add NIX_WITH_CURL_S3 build option

Introduce a new build option 'curl-s3-store' for the curl-based S3
implementation, separate from the existing AWS SDK-based 's3-store'.
The two options are mutually exclusive to avoid conflicts.

Users can enable the new implementation with:
  -Dcurl-s3-store=enabled -Ds3-store=disabled
This commit is contained in:
Bernardo Meurer Costa 2025-10-03 00:45:49 +00:00
parent 8a8a0c2a4b
commit 27f6417128
No known key found for this signature in database
8 changed files with 45 additions and 6 deletions

View file

@ -164,6 +164,33 @@ if aws_s3.found()
endif
deps_other += aws_s3
# Curl-based S3 store support (alternative to AWS SDK)
# Check if curl supports AWS SigV4 (requires >= 7.75.0)
curl_supports_aws_sigv4 = curl.version().version_compare('>= 7.75.0')
# AWS CRT C++ for lightweight credential management
aws_crt_cpp = cxx.find_library('aws-crt-cpp', required : false)
curl_s3_store_opt = get_option('curl-s3-store').require(
curl_supports_aws_sigv4,
error_message : 'curl-based S3 support requires curl >= 7.75.0',
).require(
aws_crt_cpp.found(),
error_message : 'curl-based S3 support requires aws-crt-cpp',
)
# Make AWS SDK and curl-based S3 mutually exclusive
if aws_s3.found() and curl_s3_store_opt.enabled()
error(
'Cannot enable both AWS SDK S3 support and curl-based S3 support. Please choose one.',
)
endif
if curl_s3_store_opt.enabled()
deps_other += aws_crt_cpp
endif
configdata_pub.set('NIX_WITH_CURL_S3', curl_s3_store_opt.enabled().to_int())
subdir('nix-meson-build-support/generate-header')
generated_headers = []