Bug#973135: Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.syst
Hi, On Thu, Oct 29, 2020 at 03:24:29PM +0100, Markus Koschany wrote: > Am 29.10.20 um 15:11 schrieb Andreas Tille: > > Hi, > > > > here is a suggested patch for commons-io that would prevent making the > > test in libsis-base-java fail. > > It seems this is a six year old unresolved upstream bug. > > https://issues.apache.org/jira/browse/IO-449 > > This should be fixed upstream in my opinion and not only in Debian. Other > projects may rely exactly on that behavior. Given that there is no clear consensus about what the exact behaviour should be, I guess it's probably best to disable this test for now. I can confirm that just commenting out the 2 tests in src/test/java/org/codehaus/plexus/components/io/attributes/SymlinkUtilsTest.java fixes the build. As a side node: it seems that some of the builds succeed in the reproducible-builds tests, while others do not. So the issue doesn't show up in all cases. Maybe it's related to the type of filesystem used. https://tests.reproducible-builds.org/debian/history/plexus-io.html Cheers, Ivo
Bug#973135: Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.syst
Hi, Am 29.10.20 um 15:11 schrieb Andreas Tille: Hi, here is a suggested patch for commons-io that would prevent making the test in libsis-base-java fail. It seems this is a six year old unresolved upstream bug. https://issues.apache.org/jira/browse/IO-449 This should be fixed upstream in my opinion and not only in Debian. Other projects may rely exactly on that behavior. Markus
Bug#973135: Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.syst
Hi, here is a suggested patch for commons-io that would prevent making the test in libsis-base-java fail. Kind regards Andreas. - Forwarded message from Bernd Rinn - Date: Wed, 28 Oct 2020 21:40:29 +0100 From: Bernd Rinn To: Andreas Tille CC: 973...@bugs.debian.org Subject: Re: Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.syst Hi Andreas, I can confirm that this bug is in commons-io 2.8.0 while commons-io 2.6 workes fine. The bug is in PathUtils.deleteFile(), line 360 and 361: """ final boolean exists = Files.exists(file, LinkOption.NOFOLLOW_LINKS); final long size = exists ? Files.size(file) : 0; """ It determines "exists" based on not following the symlink by using LinkOption.NOFOLLOW_LINKS, but then in the next line uses Files.size(file) to determine the size which *does* follow the symlink. Kaboom. This will prevent PathUtils.deleteFile() to delete any dangling symlink (which it has to in my test case). I have attached a patch for commons-io 2.8.0 which fixes this bug. Cheers, Bernd On 10/28/20 8:29 PM, Andreas Tille wrote: > Control: forwarded -1 Bernd Rinn > > Hi, > > I'd recommend reading the bug report log from here to get some hints > about recommended changes in the code: > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973070#17 > > For the moment I've excluded the affected tests. > > Kind regards > >Andreas. > > - Forwarded message from Markus Koschany - > > Date: Wed, 28 Oct 2020 19:34:35 +0100 > From: Markus Koschany > To: Debian Java List > Cc: 973...@bugs.debian.org > Subject: Bug#973070: Bug#973070: Help needed: Bug#973070: libsis-base-java: > FTBFS: Could not delete the directory > targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests because: 1 > exceptions: [java.io.IOException: Unable to delete file: > > targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests/someDanglingLink] > X-Debian-PR-Message: followup 973070 > X-Debian-PR-Package: src:libsis-base-java > X-Debian-PR-Keywords: bullseye ftbfs help sid > X-Debian-PR-Source: libsis-base-java > > > > Am 28.10.20 um 16:01 schrieb olivier sallou: > [...] > > *dumb* patch would be to simply remove those tests from code... > > Either this or you can keep the override for dh_auto_test-arch empty. > > The test creates a broken symlink but then FileUtils.deleteDirectory > fails to delete the file, obviously because it is not a directory but > I'm not sure how it really handles symlinks within directories. See also > [1]. Probably upstream should switch to the java.nio.file API (they > still use java.io.File), test for the existence of symlinks and then try > File.delete instead of FileUtils.deleteDirectory first. Not tested, just > a guess. > > Markus > > > [1] https://issues.apache.org/jira/browse/IO-576 > > > > > > ___ > Debian-med-packaging mailing list > debian-med-packag...@alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging > > > - End forwarded message - --- org/apache/commons/io/file/PathUtils.java.orig 2020-01-22 15:10:16.0 +0100 +++ org/apache/commons/io/file/PathUtils.java 2020-10-28 21:32:24.874024999 +0100 @@ -358,7 +358,8 @@ } final PathCounters pathCounts = Counters.longPathCounters(); final boolean exists = Files.exists(file, LinkOption.NOFOLLOW_LINKS); -final long size = exists ? Files.size(file) : 0; +final boolean existsFollowLink = Files.exists(file); +final long size = existsFollowLink ? Files.size(file) : 0; if (overrideReadOnly(options) && exists) { setReadOnly(file, false, LinkOption.NOFOLLOW_LINKS); } - End forwarded message - -- http://fam-tille.de
Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.syst
Hi Andreas, I can confirm that this bug is in commons-io 2.8.0 while commons-io 2.6 workes fine. The bug is in PathUtils.deleteFile(), line 360 and 361: """ final boolean exists = Files.exists(file, LinkOption.NOFOLLOW_LINKS); final long size = exists ? Files.size(file) : 0; """ It determines "exists" based on not following the symlink by using LinkOption.NOFOLLOW_LINKS, but then in the next line uses Files.size(file) to determine the size which *does* follow the symlink. Kaboom. This will prevent PathUtils.deleteFile() to delete any dangling symlink (which it has to in my test case). I have attached a patch for commons-io 2.8.0 which fixes this bug. Cheers, Bernd On 10/28/20 8:29 PM, Andreas Tille wrote: Control: forwarded -1 Bernd Rinn Hi, I'd recommend reading the bug report log from here to get some hints about recommended changes in the code: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973070#17 For the moment I've excluded the affected tests. Kind regards Andreas. - Forwarded message from Markus Koschany - Date: Wed, 28 Oct 2020 19:34:35 +0100 From: Markus Koschany To: Debian Java List Cc: 973...@bugs.debian.org Subject: Bug#973070: Bug#973070: Help needed: Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests because: 1 exceptions: [java.io.IOException: Unable to delete file: targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests/someDanglingLink] X-Debian-PR-Message: followup 973070 X-Debian-PR-Package: src:libsis-base-java X-Debian-PR-Keywords: bullseye ftbfs help sid X-Debian-PR-Source: libsis-base-java Am 28.10.20 um 16:01 schrieb olivier sallou: [...] *dumb* patch would be to simply remove those tests from code... Either this or you can keep the override for dh_auto_test-arch empty. The test creates a broken symlink but then FileUtils.deleteDirectory fails to delete the file, obviously because it is not a directory but I'm not sure how it really handles symlinks within directories. See also [1]. Probably upstream should switch to the java.nio.file API (they still use java.io.File), test for the existence of symlinks and then try File.delete instead of FileUtils.deleteDirectory first. Not tested, just a guess. Markus [1] https://issues.apache.org/jira/browse/IO-576 ___ Debian-med-packaging mailing list debian-med-packag...@alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging - End forwarded message - --- org/apache/commons/io/file/PathUtils.java.orig 2020-01-22 15:10:16.0 +0100 +++ org/apache/commons/io/file/PathUtils.java 2020-10-28 21:32:24.874024999 +0100 @@ -358,7 +358,8 @@ } final PathCounters pathCounts = Counters.longPathCounters(); final boolean exists = Files.exists(file, LinkOption.NOFOLLOW_LINKS); -final long size = exists ? Files.size(file) : 0; +final boolean existsFollowLink = Files.exists(file); +final long size = existsFollowLink ? Files.size(file) : 0; if (overrideReadOnly(options) && exists) { setReadOnly(file, false, LinkOption.NOFOLLOW_LINKS); } smime.p7s Description: S/MIME Cryptographic Signature
Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.syst
Control: forwarded -1 Bernd Rinn Hi, I'd recommend reading the bug report log from here to get some hints about recommended changes in the code: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973070#17 For the moment I've excluded the affected tests. Kind regards Andreas. - Forwarded message from Markus Koschany - Date: Wed, 28 Oct 2020 19:34:35 +0100 From: Markus Koschany To: Debian Java List Cc: 973...@bugs.debian.org Subject: Bug#973070: Bug#973070: Help needed: Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests because: 1 exceptions: [java.io.IOException: Unable to delete file: targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests/someDanglingLink] X-Debian-PR-Message: followup 973070 X-Debian-PR-Package: src:libsis-base-java X-Debian-PR-Keywords: bullseye ftbfs help sid X-Debian-PR-Source: libsis-base-java Am 28.10.20 um 16:01 schrieb olivier sallou: [...] > *dumb* patch would be to simply remove those tests from code... Either this or you can keep the override for dh_auto_test-arch empty. The test creates a broken symlink but then FileUtils.deleteDirectory fails to delete the file, obviously because it is not a directory but I'm not sure how it really handles symlinks within directories. See also [1]. Probably upstream should switch to the java.nio.file API (they still use java.io.File), test for the existence of symlinks and then try File.delete instead of FileUtils.deleteDirectory first. Not tested, just a guess. Markus [1] https://issues.apache.org/jira/browse/IO-576 ___ Debian-med-packaging mailing list debian-med-packag...@alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging - End forwarded message - -- http://fam-tille.de