[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49990: [core-updates-frozen] Ant-bootstrap broken by classpath-boots

From: Julien Lepiller
Subject: bug#49990: [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:

Unable to create directory as a file already exists with that name:

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:

Unable to create directory as a file already exists with that name:

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");

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
[env]$ jamvm Test

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

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:


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@1, with
a lot of useless debug lines... Unfortunately icedtea itself ends in a
failure after building quite a lot.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]