Skip to content

Move FileTransfer from libstore to libutil - #614

Draft
edolstra wants to merge 1 commit into
mainfrom
filetransfer-in-libutil
Draft

Move FileTransfer from libstore to libutil#614
edolstra wants to merge 1 commit into
mainfrom
filetransfer-in-libutil

Conversation

@edolstra

Copy link
Copy Markdown
Collaborator

Motivation

FileTransfer has nothing to do with the Nix store, and having it in libutil makes it possible to put other things that need to do uploads/downloads (such as OpenTelemetry export) in libutil directly.

This moves filetransfer.{cc,hh}, filetransfer-impl.hh and the S3/AWS machinery it depends on (s3-url.{cc,hh}, aws-creds.{cc,hh}) to libutil, along with:

  • the curl and aws-crt-cpp dependencies, the s3-aws-auth build option and the NIX_WITH_AWS_AUTH macro (now in nix/util/config.hh);

  • nixVersion / determinateNixVersion (used in the User-Agent header), now in nix/util/version.hh, re-exported from nix/store/globals.hh;

  • nixConfDir() / nixUserConfFiles() (used for the netrc-file default), i.e. global-paths.hh and the NIX_CONF_DIR define;

  • the curl_global_init() call, from initLibStore() to initLibUtil();

  • the filetransfer-request, filetransfer-retry and s3-url unit tests, from libstore-tests to libutil-tests.

libstore no longer links against curl or aws-crt-cpp.

Assisted-by: Claude Fable 5 noreply@anthropic.com

Context

FileTransfer has nothing to do with the Nix store, and having it in
libutil makes it possible to put other things that need to do
uploads/downloads (such as OpenTelemetry export) in libutil directly.

This moves filetransfer.{cc,hh}, filetransfer-impl.hh and the S3/AWS
machinery it depends on (s3-url.{cc,hh}, aws-creds.{cc,hh}) to
libutil, along with:

* the curl and aws-crt-cpp dependencies, the s3-aws-auth build option
  and the NIX_WITH_AWS_AUTH macro (now in nix/util/config.hh);

* nixVersion / determinateNixVersion (used in the User-Agent header),
  now in nix/util/version.hh, re-exported from nix/store/globals.hh;

* nixConfDir() / nixUserConfFiles() (used for the netrc-file default),
  i.e. global-paths.hh and the NIX_CONF_DIR define;

* the curl_global_init() call, from initLibStore() to initLibUtil();

* the filetransfer-request, filetransfer-retry and s3-url unit tests,
  from libstore-tests to libutil-tests.

libstore no longer links against curl or aws-crt-cpp.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant