Fix build for Nix 2.23

korrat
Oct 24, 2024, 9:43 AM
RPUKW357SJ6EXF5GBA4UOIKVM2Y5XVJXV3T3QVIGO3P3GBEAP3DAC

Dependencies

  • [2] U5AKEHEQ Fix build for Nix 2.19 to 2.21
  • [3] H5RKFV7Y Don't directly execute Pijul from fetcher
  • [4] 3KEFKH5F Import existing code

Change contents

  • replacement in src/fetcher.cpp at line 17
    [2.133][2.133:161]()
    #if NIX_VERSION >= 0x022100
    [2.133]
    [2.161]
    #if NIX_VERSION >= 0x022300
    #include <store-path-accessor.hh>
    #elif NIX_VERSION >= 0x022100
  • edit in src/fetcher.cpp at line 224
    [2.1831]
    [2.1831]
    #if NIX_VERSION >= 0x022300
    std::pair<ref<SourceAccessor>, Input> getAccessor(ref<Store> store, const Input &_input) const override
    #else
  • edit in src/fetcher.cpp at line 228
    [2.1938]
    [2.1938]
    #endif
  • replacement in src/fetcher.cpp at line 257
    [3.4838][3.4838:4970]()
    const Attrs impureKey{
    {"type", "pijul"},
    {"name", name},
    {"url", repoUrl},
    };
    [3.4838]
    [3.4970]
    #if NIX_VERSION >= 0x022300
    std::optional<Cache::Key> key;
    #else
  • edit in src/fetcher.cpp at line 261
    [3.5004]
    [3.5004]
    #endif
  • edit in src/fetcher.cpp at line 267
    [3.5098]
    [3.5098]
    #if NIX_VERSION >= 0x022300
    key = {"pijul", {
    {"name", name},
    {"channel", *channel},
    {"state", *state},
    }};
    if (auto res = getCache()->lookupStorePath(*key, store)) {
    return {std::move(res->storePath), std::move(res->value)};
    }
    #else
  • edit in src/fetcher.cpp at line 289
    [3.5473]
    [3.5473]
    #endif
  • edit in src/fetcher.cpp at line 292
    [3.5484]
    [3.5484]
    #if NIX_VERSION >= 0x022300
    const Cache::Key impureKey{"pijul", {
    {"name", name},
    {"url", repoUrl},
    }};
    if (auto res = getCache()->lookupStorePath(impureKey, store)) {
    auto &infoAttrs = res->value;
    if ((!channel || *channel == getStrAttr(infoAttrs, "channel")) && (!state || *state == getStrAttr(infoAttrs, "state"))) {
    return {std::move(res->storePath), std::move(infoAttrs)};
    }
    }
    #else
    const Attrs impureKey{
    {"type", "pijul"},
    {"name", name},
    {"url", repoUrl},
    };
  • edit in src/fetcher.cpp at line 319
    [3.5824]
    [3.5824]
    #endif
  • edit in src/fetcher.cpp at line 324
    [3.5924]
    [3.5924]
    #if NIX_VERSION >= 0x022300
    key = {"pijul", {
    {"name", name},
    }};
    #else
  • edit in src/fetcher.cpp at line 333
    [3.6026]
    [3.6026]
    #endif
  • edit in src/fetcher.cpp at line 336
    [3.6037]
    [3.6037]
    #if NIX_VERSION >= 0x022300
    mergeAttrs(key->second,
    #else
  • edit in src/fetcher.cpp at line 340
    [3.6062]
    [3.6062]
    #endif
  • edit in src/fetcher.cpp at line 353
    [3.6403]
    [3.6403]
    #if NIX_VERSION >= 0x022300
    getCache()->upsert(impureKey, store, infoAttrs, storePath);
    #else
  • edit in src/fetcher.cpp at line 357
    [3.6479]
    [3.6479]
    #endif
  • edit in src/fetcher.cpp at line 360
    [3.6490]
    [3.6490]
    #if NIX_VERSION >= 0x022300
    getCache()->upsert(*key, store, infoAttrs, storePath);
    #else
  • edit in src/fetcher.cpp at line 364
    [3.6556]
    [3.6556]
    #endif
  • replacement in src/fetcher.cpp at line 395
    [3.7976][2.2392:2420]()
    #if NIX_VERSION >= 0x022100
    [3.7976]
    [2.2420]
    #if NIX_VERSION >= 0x022300
    auto path = PosixSourceAccessor::createAtRoot(repoDir);
    auto storePath = store->addToStore(inputName, path);
    #elif NIX_VERSION >= 0x022100
  • replacement in src/fetcher.cpp at line 453
    [3.9697][2.2754:2782]()
    #if NIX_VERSION >= 0x022000
    [3.9697]
    [2.2782]
    #if NIX_VERSION >= 0x022300
    auto storePath = store->addToStore(input.getName(), {getFSSourceAccessor(), CanonPath(actualPath)}, FileIngestionMethod::Recursive, HashAlgorithm::SHA256, {}, filter);
    #elif NIX_VERSION >= 0x022000