Skip to content

Commit ffbc33f

Browse files
committed
libstore/meson: Rename curl-s3-store to s3-aws-auth
We now unconditionally compile support for s3:// URLs and stores without authentication. The whole curl version check can be greatly simplified by the previous commit, which bumps the minimum required curl version.
1 parent a80fc25 commit ffbc33f

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

src/libstore/meson.build

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,27 +142,16 @@ deps_public += nlohmann_json
142142
sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19')
143143
deps_private += sqlite
144144

145-
# Curl-based S3 store support
146-
# Check if curl supports AWS SigV4 (requires >= 7.75.0)
147-
curl_supports_aws_sigv4 = curl.version().version_compare('>= 7.75.0')
148-
# AWS CRT C++ for lightweight credential management
149-
aws_crt_cpp = cxx.find_library('aws-crt-cpp', required : false)
150-
151-
curl_s3_store_opt = get_option('curl-s3-store').require(
152-
curl_supports_aws_sigv4,
153-
error_message : 'curl-based S3 support requires curl >= 7.75.0',
154-
).require(
155-
aws_crt_cpp.found(),
156-
error_message : 'curl-based S3 support requires aws-crt-cpp',
157-
)
145+
s3_aws_auth = get_option('s3-aws-auth')
146+
aws_crt_cpp = cxx.find_library('aws-crt-cpp', required : s3_aws_auth)
158147

159-
if curl_s3_store_opt.enabled()
148+
if s3_aws_auth.enabled()
160149
deps_other += aws_crt_cpp
161150
aws_c_common = cxx.find_library('aws-c-common', required : true)
162151
deps_other += aws_c_common
163152
endif
164153

165-
configdata_pub.set('NIX_WITH_AWS_AUTH', curl_s3_store_opt.enabled().to_int())
154+
configdata_pub.set('NIX_WITH_AWS_AUTH', s3_aws_auth.enabled().to_int())
166155

167156
subdir('nix-meson-build-support/generate-header')
168157

@@ -346,7 +335,7 @@ sources = files(
346335
)
347336

348337
# AWS credentials code requires AWS CRT, so only compile when enabled
349-
if curl_s3_store_opt.enabled()
338+
if s3_aws_auth.enabled()
350339
sources += files('aws-creds.cc')
351340
endif
352341

src/libstore/meson.options

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ option(
3535
)
3636

3737
option(
38-
'curl-s3-store',
38+
's3-aws-auth',
3939
type : 'feature',
40-
value : 'disabled',
41-
description : 'Enable curl-based S3 binary cache store support (requires aws-crt-cpp and curl >= 7.75.0)',
40+
description : 'build support for AWS authentication with S3',
4241
)

src/libstore/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ mkMesonLibrary (finalAttrs: {
7575
mesonFlags = [
7676
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
7777
(lib.mesonBool "embedded-sandbox-shell" embeddedSandboxShell)
78-
(lib.mesonEnable "curl-s3-store" withAWS)
78+
(lib.mesonEnable "s3-aws-auth" withAWS)
7979
]
8080
++ lib.optionals stdenv.hostPlatform.isLinux [
8181
(lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")

0 commit comments

Comments
 (0)