Fix build for Nix 2.24

korrat
Oct 24, 2024, 10:00 AM
HZA67MNO6Z6ODY3YFPZK5NRVSSUZ4RHX4MBXX6TXV5AJBBLQD7KQC

Dependencies

  • [2] YW5FM2MI Put code for new Nix versions at the top in if/else macros
  • [3] GCOWWL5G Crusty debug header
  • [4] RPUKW357 Fix build for Nix 2.23
  • [5] 7YS2X7JJ Fix compilation against older Nix versions (tested with 2.13.6)
  • [6] H5RKFV7Y Don't directly execute Pijul from fetcher
  • [7] 3KEFKH5F Import existing code
  • [8] U5AKEHEQ Fix build for Nix 2.19 to 2.21

Change contents

  • replacement in src/fetcher.cpp at line 40
    [5.956][2.0:28]()
    #if NIX_VERSION >= 0x021800
    [5.956]
    [2.28]
    #if NIX_VERSION >= 0x022400
    [[nodiscard]] std::optional<Input> inputFromURL(const Settings &settings, const ParsedURL &url, bool requireTree) const override
    #elif NIX_VERSION >= 0x021800
  • edit in src/fetcher.cpp at line 71
    [5.1702]
    [5.1702]
    #if NIX_VERSION >= 0x022400
    return inputFromAttrs(settings, attrs);
    #else
  • edit in src/fetcher.cpp at line 75
    [5.1740]
    [3.40]
    #endif
  • edit in src/fetcher.cpp at line 80
    [5.1747]
    [5.1747]
    #if NIX_VERSION >= 0x022400
    [[nodiscard]] std::optional<Input> inputFromAttrs(const Settings &settings, const Attrs &attrs) const override
    #else
  • edit in src/fetcher.cpp at line 84
    [5.1836]
    [5.1836]
    #endif
  • edit in src/fetcher.cpp at line 102
    [5.2277]
    [5.2277]
    #if NIX_VERSION >= 0x022400
    Input input(settings);
    #else
  • edit in src/fetcher.cpp at line 106
    [5.2298]
    [5.2298]
    #endif
  • replacement in src/fetcher.cpp at line 438
    [5.8774][5.8774:8819]()
    if (!fetchSettings.allowDirty) {
    [5.8774]
    [5.8819]
    #if NIX_VERSION >= 0x022400
    auto settings = *input.settings;
    #else
    auto settings = fetchSettings;
    #endif
    if (!settings.allowDirty) {
  • replacement in src/fetcher.cpp at line 448
    [5.8897][5.8897:8940]()
    if (fetchSettings.warnDirty) {
    [5.8897]
    [5.8940]
    if (settings.warnDirty) {
  • replacement in src/fetcher.cpp at line 473
    [5.9697][4.1922:1950]()
    #if NIX_VERSION >= 0x022300
    [5.9697]
    [4.1950]
    #if NIX_VERSION >= 0x022400
    auto storePath = store->addToStore(input.getName(), {getFSSourceAccessor(), CanonPath(actualPath)}, ContentAddressMethod::Raw::NixArchive, HashAlgorithm::SHA256, {}, filter);
    #elif NIX_VERSION >= 0x022300