Skip to content

Commit 1f71030

Browse files
committed
refactor(libstore): withCurlS3 -> withAWS
Now that the legacy S3 implementation is gone, we can go back to calling things `NIX_WITH_S3_SUPPORT`.
1 parent 9295c14 commit 1f71030

File tree

19 files changed

+42
-44
lines changed

19 files changed

+42
-44
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,29 @@ jobs:
6767
instrumented: false
6868
primary: true
6969
stdenv: stdenv
70-
withCurlS3: true
70+
withAWS: true
7171
# TODO: remove once curl-based-s3 fully lands
7272
- scenario: on ubuntu (no s3)
7373
runs-on: ubuntu-24.04
7474
os: linux
7575
instrumented: false
7676
primary: false
7777
stdenv: stdenv
78-
withCurlS3: false
78+
withAWS: false
7979
- scenario: on macos
8080
runs-on: macos-14
8181
os: darwin
8282
instrumented: false
8383
primary: true
8484
stdenv: stdenv
85-
withCurlS3: true
85+
withAWS: true
8686
- scenario: on ubuntu (with sanitizers / coverage)
8787
runs-on: ubuntu-24.04
8888
os: linux
8989
instrumented: true
9090
primary: false
9191
stdenv: clangStdenv
92-
withCurlS3: true
92+
withAWS: true
9393
name: tests ${{ matrix.scenario }}
9494
runs-on: ${{ matrix.runs-on }}
9595
timeout-minutes: 60
@@ -113,13 +113,13 @@ jobs:
113113
nix build --file ci/gha/tests/wrapper.nix componentTests -L \
114114
--arg withInstrumentation ${{ matrix.instrumented }} \
115115
--argstr stdenv "${{ matrix.stdenv }}" \
116-
${{ format('--arg withCurlS3 {0}', matrix.withCurlS3) }}
116+
${{ format('--arg withAWS {0}', matrix.withAWS) }}
117117
- name: Run VM tests
118118
run: |
119119
nix build --file ci/gha/tests/wrapper.nix vmTests -L \
120120
--arg withInstrumentation ${{ matrix.instrumented }} \
121121
--argstr stdenv "${{ matrix.stdenv }}" \
122-
${{ format('--arg withCurlS3 {0}', matrix.withCurlS3) }}
122+
${{ format('--arg withAWS {0}', matrix.withAWS) }}
123123
if: ${{ matrix.os == 'linux' }}
124124
- name: Run flake checks and prepare the installer tarball
125125
run: |
@@ -131,7 +131,7 @@ jobs:
131131
nix build --file ci/gha/tests/wrapper.nix codeCoverage.coverageReports -L \
132132
--arg withInstrumentation ${{ matrix.instrumented }} \
133133
--argstr stdenv "${{ matrix.stdenv }}" \
134-
${{ format('--arg withCurlS3 {0}', matrix.withCurlS3) }} \
134+
${{ format('--arg withAWS {0}', matrix.withAWS) }} \
135135
--out-link coverage-reports
136136
cat coverage-reports/index.txt >> $GITHUB_STEP_SUMMARY
137137
if: ${{ matrix.instrumented }}

ci/gha/tests/default.nix

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
componentTestsPrefix ? "",
1313
withSanitizers ? false,
1414
withCoverage ? false,
15-
withCurlS3 ? null,
15+
withAWS ? null,
1616
...
1717
}:
1818

@@ -58,9 +58,7 @@ rec {
5858
nix-expr = prev.nix-expr.override { enableGC = !withSanitizers; };
5959

6060
# Override AWS configuration if specified
61-
nix-store = prev.nix-store.override (
62-
lib.optionalAttrs (withCurlS3 != null) { inherit withCurlS3; }
63-
);
61+
nix-store = prev.nix-store.override (lib.optionalAttrs (withAWS != null) { inherit withAWS; });
6462

6563
mesonComponentOverrides = lib.composeManyExtensions componentOverrides;
6664
# Unclear how to make Perl bindings work with a dynamically linked ASAN.
@@ -229,7 +227,7 @@ rec {
229227

230228
vmTests = {
231229
}
232-
// lib.optionalAttrs (withCurlS3 == true) {
230+
// lib.optionalAttrs (withAWS == true) {
233231
# S3 binary cache store test using curl implementation
234232
inherit (nixosTests) curl-s3-binary-cache-store;
235233
}

ci/gha/tests/wrapper.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
stdenv ? "stdenv",
66
componentTestsPrefix ? "",
77
withInstrumentation ? false,
8-
withCurlS3 ? null,
8+
withAWS ? null,
99
}@args:
1010
import ./. (
1111
args
1212
// {
1313
getStdenv = p: p.${stdenv};
1414
withSanitizers = withInstrumentation;
1515
withCoverage = withInstrumentation;
16-
inherit withCurlS3;
16+
inherit withAWS;
1717
}
1818
)

src/libstore-tests/s3-binary-cache-store.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "nix/store/s3-binary-cache-store.hh"
22

3-
#if NIX_WITH_CURL_S3
3+
#if NIX_WITH_S3_SUPPORT
44

55
# include "nix/store/http-binary-cache-store.hh"
66
# include "nix/store/filetransfer.hh"

src/libstore-tests/s3-url.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "nix/store/s3-url.hh"
22
#include "nix/util/tests/gmock-matchers.hh"
33

4-
#if NIX_WITH_CURL_S3
4+
#if NIX_WITH_S3_SUPPORT
55

66
# include <gtest/gtest.h>
77
# include <gmock/gmock.h>

src/libstore/aws-creds.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "nix/store/aws-creds.hh"
22

3-
#if NIX_WITH_CURL_S3
3+
#if NIX_WITH_S3_SUPPORT
44

55
# include <aws/crt/Types.h>
66
# include "nix/store/s3-url.hh"

src/libstore/builtins/fetchurl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static void builtinFetchurl(const BuiltinBuilderContext & ctx)
4141
FileTransferRequest request(VerbatimURL{url});
4242
request.decompress = false;
4343

44-
#if NIX_WITH_CURL_S3
44+
#if NIX_WITH_S3_SUPPORT
4545
// Use pre-resolved credentials if available
4646
if (ctx.awsCredentials && request.uri.scheme() == "s3") {
4747
debug("[pid=%d] Using pre-resolved AWS credentials from parent process", getpid());

src/libstore/filetransfer.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "store-config-private.hh"
1111
#include <optional>
12-
#if NIX_WITH_CURL_S3
12+
#if NIX_WITH_S3_SUPPORT
1313
# include "nix/store/aws-creds.hh"
1414
# include "nix/store/s3-url.hh"
1515
#endif
@@ -435,7 +435,7 @@ struct curlFileTransfer : public FileTransfer
435435
}
436436
}
437437

438-
#if NIX_WITH_CURL_S3
438+
#if NIX_WITH_S3_SUPPORT
439439
// Set up AWS SigV4 signing if this is an S3 request
440440
// Note: AWS SigV4 support guaranteed available (curl >= 7.75.0 checked at build time)
441441
// The username/password (access key ID and secret key) are set via the general
@@ -820,7 +820,7 @@ struct curlFileTransfer : public FileTransfer
820820
void enqueueItem(std::shared_ptr<TransferItem> item)
821821
{
822822
if (item->request.data && item->request.uri.scheme() != "http" && item->request.uri.scheme() != "https"
823-
#if NIX_WITH_CURL_S3
823+
#if NIX_WITH_S3_SUPPORT
824824
&& item->request.uri.scheme() != "s3"
825825
#endif
826826
)
@@ -841,7 +841,7 @@ struct curlFileTransfer : public FileTransfer
841841
{
842842
/* Ugly hack to support s3:// URIs. */
843843
if (request.uri.scheme() == "s3") {
844-
#if NIX_WITH_CURL_S3
844+
#if NIX_WITH_S3_SUPPORT
845845
// New curl-based S3 implementation
846846
auto modifiedRequest = request;
847847
modifiedRequest.setupForS3();
@@ -876,7 +876,7 @@ ref<FileTransfer> makeFileTransfer()
876876
return makeCurlFileTransfer();
877877
}
878878

879-
#if NIX_WITH_CURL_S3
879+
#if NIX_WITH_S3_SUPPORT
880880
void FileTransferRequest::setupForS3()
881881
{
882882
auto parsedS3 = ParsedS3URL::parse(uri.parsed());

src/libstore/include/nix/store/aws-creds.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
///@file
33
#include "nix/store/config.hh"
44

5-
#if NIX_WITH_CURL_S3
5+
#if NIX_WITH_S3_SUPPORT
66

77
# include "nix/store/s3-url.hh"
88
# include "nix/util/error.hh"

src/libstore/include/nix/store/builtins.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "nix/store/derivations.hh"
55
#include "nix/store/config.hh"
66

7-
#if NIX_WITH_CURL_S3
7+
#if NIX_WITH_S3_SUPPORT
88
# include "nix/store/aws-creds.hh"
99
#endif
1010

@@ -18,7 +18,7 @@ struct BuiltinBuilderContext
1818
std::string caFileData;
1919
Path tmpDirInSandbox;
2020

21-
#if NIX_WITH_CURL_S3
21+
#if NIX_WITH_S3_SUPPORT
2222
/**
2323
* Pre-resolved AWS credentials for S3 URLs in builtin:fetchurl.
2424
* When present, these should be used instead of creating new credential providers.

0 commit comments

Comments
 (0)