Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: borgbackup-1.2.6 on x86_64-darwin #267536

Open
bcc32 opened this issue Nov 14, 2023 · 9 comments
Open

Build failure: borgbackup-1.2.6 on x86_64-darwin #267536

bcc32 opened this issue Nov 14, 2023 · 9 comments
Labels
0.kind: build failure A package fails to build 6.topic: darwin Running or building packages on Darwin

Comments

@bcc32
Copy link
Contributor

bcc32 commented Nov 14, 2023

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix build 'nixpkgs#borgbackup'

Build log

https://gist.github.com/bcc32/d32b32d2a3b93f09b51b7b2c02eef2ba

I wasn't able to figure out how to prevent nix log from outputting escape sequences (even when redirecting to a file), but if there's a good way I'm happy to run it again and provide the output.

Additional context

This package builds fine on an x86_64-linux box I have.

Notify maintainers

@dotlambda @globin

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 23.0.0, macOS 10.16`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(aaron): `"home-manager-23.05.tar.gz, nixpkgs-23.05-darwin"`
 - channels(root): `"home-manager, nixpkgs-22.05pre382257.2ed5b6b0f5d"`
 - nixpkgs: `/Users/aaron/.nix-defexpr/channels/nixpkgs`
@bcc32 bcc32 added the 0.kind: build failure A package fails to build label Nov 14, 2023
@dotlambda
Copy link
Member

Is this on aarch64-darwin as the title says or x86_64-darwin as nix-info says?

@bcc32 bcc32 changed the title Build failure: borgbackup-1.2.6 on aarch64-darwin Build failure: borgbackup-1.2.6 on x86_64-darwin Nov 17, 2023
@bcc32
Copy link
Contributor Author

bcc32 commented Nov 17, 2023

Sorry for the error. It's x86_64-darwin. I have fixed the title.

@bcc32
Copy link
Contributor Author

bcc32 commented Dec 13, 2023

I updated to 23.11 recently, and this issue is still affecting me.

It seems that the build has been broken for x86_64-darwin since 2023-07: https://hydra.nixos.org/build/227859438

@bcc32
Copy link
Contributor Author

bcc32 commented Jan 1, 2024

@dotlambda @globin How do you feel about disabling the offending tests? I have personally installed a version of borg by just disabling tests and it seems to work fine.

diff --git a/pkgs/tools/backup/borgbackup/default.nix b/pkgs/tools/backup/borgbackup/default.nix
index 33c5aa527218..fdcf3e02c37d 100644
--- a/pkgs/tools/backup/borgbackup/default.nix
+++ b/pkgs/tools/backup/borgbackup/default.nix
@@ -102,6 +102,9 @@ python3Packages.buildPythonApplication rec {
     "test_get_config_dir"
     # https://github.com/borgbackup/borg/issues/6573
     "test_basic_functionality"
+    "test_overwrite"
+    "test_sparse_file"
+    "test_can_read_repo_even_if_nonce_is_deleted"
   ];
 
   preCheck = ''

@szethh
Copy link

szethh commented Sep 5, 2024

hi, I just ran into this issue on 24.05 on x86_64-darwin. trying to compile borgmatic (which has borgbackup as dependency) results in these tests failing:

archiver.py::ArchiverTestCase::test_overwrite
archiver.py::RemoteArchiverTestCase::test_overwrite (inherited from ArchiverTestCase)
archiver.py::RemoteArchiverTestCase::test_can_read_repo_even_if_nonce_is_deleted

Another puzzling thing is that sometimes, RemoteArchiverTestCase::test_overwrite does not fail, so I end up with 2 failures instead of 3. This variation occurs without any modification, just rerunning the program.

The errors seem to be from some file operation which does not end up as expected. I am not familiar with the borg codebase so I don't know what this is or why it happens.

Here's the part of the logs that includes the failures:

=================================== FAILURES ===================================
_______________________ ArchiverTestCase.test_overwrite ________________________
[gw5] darwin -- Python 3.11.9 /nix/store/jlliafmjyfcfnzsy1z57zqzfak2c29lc-python3-3.11.9/bin/python3.11

self = <borg.testsuite.archiver.ArchiverTestCase testMethod=test_overwrite>

    def test_overwrite(self):
        self.create_regular_file('file1', size=1024 * 80)
        self.create_regular_file('dir2/file2', size=1024 * 80)
        self.cmd('init', '--encryption=repokey', self.repository_location)
        self.cmd('create', self.repository_location + '::test', 'input')
        # Overwriting regular files and directories should be supported
        os.mkdir('output/input')
        os.mkdir('output/input/file1')
        os.mkdir('output/input/dir2')
        with changedir('output'):
            self.cmd('extract', self.repository_location + '::test')
>       self.assert_dirs_equal('input', 'output/input')


self = <borg.testsuite.archiver.ArchiverTestCase testMethod=test_overwrite>

    def test_overwrite(self):
        self.create_regular_file('file1', size=1024 * 80)
        self.create_regular_file('dir2/file2', size=1024 * 80)
        self.cmd('init', '--encryption=repokey', self.repository_location)
        self.cmd('create', self.repository_location + '::test', 'input')
        # Overwriting regular files and directories should be supported
        os.mkdir('output/input')
        os.mkdir('output/input/file1')
        os.mkdir('output/input/dir2')
        with changedir('output'):
            self.cmd('extract', self.repository_location + '::test')
>       self.assert_dirs_equal('input', 'output/input')

/nix/store/bqdiwqnskmszm2bf0zwbz48yvd220y13-borgbackup-1.2.8/lib/python3.11/site-packages/borg/testsuite/archiver.py:1568: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/bqdiwqnskmszm2bf0zwbz48yvd220y13-borgbackup-1.2.8/lib/python3.11/site-packages/borg/testsuite/__init__.py:189: in assert_dirs_equal
    self._assert_dirs_equal_cmp(diff, **kwargs)
/nix/store/bqdiwqnskmszm2bf0zwbz48yvd220y13-borgbackup-1.2.8/lib/python3.11/site-packages/borg/testsuite/__init__.py:238: in _assert_dirs_equal_cmp
    self.assert_equal(d1, d2)
E   AssertionError: Lists differ: ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552624204883000, {}] != ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552624204882000, {}]
E   
E   First differing element 7:
E   1725552624204883000
E   1725552624204882000
E   
E   - ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552624204883000, {}]
E   ?                                                              ^
E   
E   + ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552624204882000, {}]
E   ?                                                              ^
______ RemoteArchiverTestCase.test_can_read_repo_even_if_nonce_is_deleted ______
[gw10] darwin -- Python 3.11.9 /nix/store/jlliafmjyfcfnzsy1z57zqzfak2c29lc-python3-3.11.9/bin/python3.11

self = <borg.testsuite.archiver.RemoteArchiverTestCase testMethod=test_can_read_repo_even_if_nonce_is_deleted>

    def test_can_read_repo_even_if_nonce_is_deleted(self):
        """Nonce is only used for encrypting new data.
    
        It should be possible to retrieve the data from an archive even if
        both the client and the server forget the nonce"""
        self.create_regular_file('file1', contents=b'Hello, borg')
        self.cmd('init', '--encryption=repokey', self.repository_location)
        self.cmd('create', self.repository_location + '::test', 'input')
        # Oops! We have removed the repo-side memory of the nonce!
        # See https://github.com/borgbackup/borg/issues/5858
        os.remove(os.path.join(self.repository_path, 'nonce'))
        # Oops! The client has lost the nonce too!
        os.remove(os.path.join(self.get_security_dir(), 'nonce'))
    
        # The repo should still be readable
        repo_info = self.cmd('info', self.repository_location)
        assert 'All archives:' in repo_info
        repo_list = self.cmd('list', self.repository_location)
        assert 'test' in repo_list
        # The archive should still be readable
        archive_info = self.cmd('info', self.repository_location + '::test')
        assert 'Archive name: test\n' in archive_info
        archive_list = self.cmd('list', self.repository_location + '::test')
        assert 'file1' in archive_list
        # Extracting the archive should work
        with changedir('output'):
            self.cmd('extract', self.repository_location + '::test')
>       self.assert_dirs_equal('input', 'output/input')

/nix/store/bqdiwqnskmszm2bf0zwbz48yvd220y13-borgbackup-1.2.8/lib/python3.11/site-packages/borg/testsuite/archiver.py:3752: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/bqdiwqnskmszm2bf0zwbz48yvd220y13-borgbackup-1.2.8/lib/python3.11/site-packages/borg/testsuite/__init__.py:189: in assert_dirs_equal
    self._assert_dirs_equal_cmp(diff, **kwargs)
/nix/store/bqdiwqnskmszm2bf0zwbz48yvd220y13-borgbackup-1.2.8/lib/python3.11/site-packages/borg/testsuite/__init__.py:238: in _assert_dirs_equal_cmp
    self.assert_equal(d1, d2)
E   AssertionError: Lists differ: ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552709740378000, {}] != ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552709740377000, {}]
E   
E   First differing element 7:
E   1725552709740378000
E   1725552709740377000
E   
E   - ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552709740378000, {}]
E   ?                                                              ^
E   
E   + ['file1', '0o100600', 301, 30000, None, 1, 0, 1725552709740377000, {}]
E   ?   

@szethh
Copy link

szethh commented Sep 6, 2024

archiver.py::RemoteArchiverTestCase::test_sparse_file

trying to compile the package a few more times shows that this test case also fails, randomly (sometimes it does, sometimes it doesn't), with no changes to nix code.

@szethh
Copy link

szethh commented Sep 6, 2024

an overlay disabling those tests does the trick:

#  ../packages/overlays/borgbackup.nix
final: prev: {
  borgbackup = prev.borgbackup.overrideAttrs (oldAttrs: rec {
    disabledTests =
      oldAttrs.disabledTests
      ++ prev.lib.optionals prev.stdenv.isDarwin [
        "test_overwrite"
        "test_can_read_repo_even_if_nonce_is_deleted"
        "test_sparse_file"
      ];
  });
}
# darwin.nix
nixpkgs.overlays = [ (import ../packages/overlays/borgbackup.nix) ];

@azuwis
Copy link
Contributor

azuwis commented Nov 1, 2024

The build succeeded in current master https://hydra.nixos.org/job/nixpkgs/trunk/borgbackup.x86_64-darwin/all, maybe fixed by #346043.

@szethh
Copy link

szethh commented Nov 26, 2024

i tried to build it again with the current master but it is still failing. I actually had to disable an additional test this time, test_extract_xattrs_resourcefork, since that one was failing as well.

not sure if it's an issue with my machine? no clue how to debug that honestly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

5 participants