GNU bug report logs - #49990
[core-updates-frozen] Ant-bootstrap broken by classpath-bootstrap

Previous Next

Package: guix;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Tue, 10 Aug 2021 21:39:01 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#49990: closed ([core-updates-frozen] Ant-bootstrap broken by
 classpath-bootstrap)
Date: Fri, 03 Sep 2021 10:12:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 03 Sep 2021 12:11:42 +0200
with message-id <87fsum2ckh.fsf <at> gnu.org>
and subject line Re: bug#49990: [core-updates-frozen] Ant-bootstrap broken by classpath-bootstrap
has caused the debbugs.gnu.org bug report #49990,
regarding [core-updates-frozen] Ant-bootstrap broken by classpath-bootstrap
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
49990: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49990
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Julien Lepiller <julien <at> lepiller.eu>
To: bug-guix <at> gnu.org
Subject: [core-updates-frozen] Ant-bootstrap broken by classpath-bootstrap
Date: Tue, 10 Aug 2021 23:38:01 +0200
Hi Guix!

I've finally taken the time to investigate the build failure of
ant-bootstrap. It is failing after reporting a file exists:

```
/tmp/guix-build-ant-bootstrap-1.8.4.drv-0/apache-ant-1.8.4/build.xml:558:
Unable to create directory as a file already exists with that name:
/tmp/guix-build-ant-bootstrap-1.8.4.drv-0/apache-ant-1.8.4/build
```

So, I set an environment variable to pass a different build directory
to ant (-Dbuild.dir=bootstrapped-build), but it fails in the same way:

```
/tmp/guix-build-ant-bootstrap-1.8.4.drv-0/apache-ant-1.8.4/build.xml:558:
Unable to create directory as a file already exists with that name:
/tmp/guix-build-ant-bootstrap-1.8.4.drv-0/apache-ant-1.8.4/bootstrapped-build
```

However, using -K, I could check the directory does not exist. After
investigating a bit, I found that File.isFile() is not working as
expected. With the following file (Test.java):

```
import java.io.File;
public class Test {
  public static void main(String[] args) {
    File f = new File("non-existent");
    if(f.isFile())
      System.out.println("yes");
    else
      System.out.println("no");
  }
}
```

compiled in a guix environment for ant-bootstrap (I had to temporarily
export it):

```
$ ./pre-inst-env guix environment ant-bootstrap
[env]$ CLASSPATH=$GUIX_ENVIRONMENT/lib/rt.jar jikes Test.java
[env]$ java Test
no
[env]$ jamvm Test
yes
```

(java comes from outside the environment). jamvm from master is
working, and I don't see any difference in it, classpath or jikes
recipes.

After investigation, it turns out that java.io.File is actually
implemented in classpath, not jamvm, and there is a comment that refers
to another similar issue:

https://issues.guix.gnu.org/issue/36685

I tried the obvious, that is to introduce a new memory leak, but that
did not work. So, to better understand what was going on, I instead
added some printing:

```
@@ -256,7 +256,9 @@ only faster.")
            (lambda _
              (substitute* "native/jni/java-io/java_io_VMFile.c"
                (("result = cpio_isFileExists.*" m)
-                (string-append m "\n//")))
+                (string-append m "\n//"))
+               (("result = cpio_checkType.*" m)
+                (string-append m "\nfprintf(stderr, \"type? %s : %d --
%d -- %d;\\n\", filename, result, entryType, ((result == CPNATIVE_OK &&
entryType == CPFILE_FILE) ? 1 : 0));\n"))) #t)) (add-after 'install
'install-data (lambda _ (invoke "make" "install-data"))))))
```

and surprisingly, this prints the expected values, and it is enough to
get the correct answer from the java side too. With the above diff, I'm
able to build ant-bootstrap and all the dependencies of icedtea <at> 1, with
a lot of useless debug lines... Unfortunately icedtea itself ends in a
failure after building quite a lot.


[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: muradm <mail <at> muradm.net>, Maxime Devos <maximedevos <at> telenet.be>,
 49990-done <at> debbugs.gnu.org
Subject: Re: bug#49990: [core-updates-frozen] Ant-bootstrap broken by
 classpath-bootstrap
Date: Fri, 03 Sep 2021 12:11:42 +0200
Hi there!

I pushed a variant of the patch proposed earlier, adding a similar
workaround to ‘Java_java_io_VMFile_exists’ and
‘Java_java_io_VMFile_isDirectory’:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?h=core-updates-frozen&id=7f50543d55b20cd528b28d7e15f1bb81001a8da9

With this, I can build ‘ant-bootstrap’ just fine.  \o/

Next up: icedtea 1.13.13 chokes on obscure C++ issues:

--8<---------------cut here---------------start------------->8---
In file included from /tmp/guix-build-icedtea-1.13.13.drv-0/icedtea6-1.13.13/openjdk-ecj/hotspot/src/share/vm/asm/assembler.hpp:29,
                 from /tmp/guix-build-icedtea-1.13.13.drv-0/icedtea6-1.13.13/openjdk-ecj/hotspot/src/share/vm/precompiled/precompiled.hpp:29:
/tmp/guix-build-icedtea-1.13.13.drv-0/icedtea6-1.13.13/openjdk-ecj/hotspot/src/share/vm/code/relocInfo.hpp:374:27: error: friend declaration of ‘relocInfo prefix_relocInfo(int)’ specifies default arguments and isn’t a definition [-fpermissive]
  374 |   inline friend relocInfo prefix_relocInfo(int datalen = 0);
      |                           ^~~~~~~~~~~~~~~~
In file included from /tmp/guix-build-icedtea-1.13.13.drv-0/icedtea6-1.13.13/openjdk-ecj/hotspot/src/share/vm/asm/assembler.hpp:29,
                 from /tmp/guix-build-icedtea-1.13.13.drv-0/icedtea6-1.13.13/openjdk-ecj/hotspot/src/share/vm/precompiled/precompiled.hpp:29:
/tmp/guix-build-icedtea-1.13.13.drv-0/icedtea6-1.13.13/openjdk-ecj/hotspot/src/share/vm/code/relocInfo.hpp:472:18: error: friend declaration of ‘relocInfo prefix_relocInfo(int)’ specifies default arguments and isn’t the only declaration [-fpermissive]
  472 | inline relocInfo prefix_relocInfo(int datalen) {
      |                  ^~~~~~~~~~~~~~~~
--8<---------------cut here---------------end--------------->8---

Anyway, we’re making progress!

Ludo’.


This bug report was last modified 3 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.