]> dgit.raspbian.org Git - git-annex.git/commitdiff
minimize lenth of path to gpg agent socket
authorJoey Hess <joeyh@joeyh.name>
Thu, 26 Mar 2020 17:04:24 +0000 (13:04 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 26 Mar 2020 17:04:24 +0000 (13:04 -0400)
Considered using the system tmp dir rather than putting it inside .t/,
but then if TEMP were set to a long path, that would be a problem.
Relative path seems the best approach, and will always be nice and
short.

The only downside of it is, if git-annex somehow changes the cwd
while running, it would break. But git-annex does not do that, and
should never do that.

Test.hs
doc/bugs/tests_fail___40__gpg-agent_related__63____41___when_running_build_inside_singularity_container/comment_2_c61b14b76cf06c0b10257c1a84d9478a._comment [new file with mode: 0644]

diff --git a/Test.hs b/Test.hs
index 7b784d661d55ab8f02f585146de9a622684050cb..29f891dc4eea416515cf9f20a5eba00f6ea9bd67 100644 (file)
--- a/Test.hs
+++ b/Test.hs
@@ -1574,10 +1574,13 @@ test_crypto = do
   where
        gpgcmd = Utility.Gpg.mkGpgCmd Nothing
        testscheme scheme = do
-               gpgtmp <- (</> "gpgtest") <$> absPath tmpdir
+               abstmp <- absPath tmpdir
+               testscheme' scheme abstmp
+       testscheme' scheme abstmp = intmpclonerepo $ whenM (Utility.Path.inPath (Utility.Gpg.unGpgCmd gpgcmd)) $ do
+               -- Use a relative path to avoid too long path to gpg's
+               -- agent socket.
+               gpgtmp <- (</> "gpgtmp") <$> relPathCwdToFile abstmp
                createDirectoryIfMissing False gpgtmp
-               testscheme' scheme gpgtmp
-       testscheme' scheme gpgtmp = intmpclonerepo $ whenM (Utility.Path.inPath (Utility.Gpg.unGpgCmd gpgcmd)) $ do
                Utility.Gpg.testTestHarness gpgtmp gpgcmd 
                        @? "test harness self-test failed"
                Utility.Gpg.testHarness gpgtmp gpgcmd $ do
diff --git a/doc/bugs/tests_fail___40__gpg-agent_related__63____41___when_running_build_inside_singularity_container/comment_2_c61b14b76cf06c0b10257c1a84d9478a._comment b/doc/bugs/tests_fail___40__gpg-agent_related__63____41___when_running_build_inside_singularity_container/comment_2_c61b14b76cf06c0b10257c1a84d9478a._comment
new file mode 100644 (file)
index 0000000..1e96fe5
--- /dev/null
@@ -0,0 +1,17 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2020-03-26T16:55:30Z"
+ content="""
+Tried to reproduce it here running in a directory with the same lenth, but
+no failures. It could have to do with the old version of gpg-agent.
+
+(I don't see how gpg inside the container could talk to gpg-agent outside
+the container at all, unless the container shares a filesystem, and even
+then, gpg inside the container is being run with a nonstandard home
+directory, so it will not try to talk to a gpg-agent socket in the usual
+home directory.)
+
+I have a patch that makes the path to the socket file relative, but can't
+verify if it will fix the problem. I've applied it anyway.
+"""]]