beehive-lab / Maxine-VM

Maxine VM: A meta-circular research VM
GNU General Public License v2.0
323 stars 63 forks source link

"mx build" fails #26

Closed yurun-yuan closed 2 years ago

yurun-yuan commented 2 years ago

Hi,

I tried to build Maxine VM without docker, following the instructions presented on Building Maxine without Docker, only to find some errors.

$ mx build
JAVA_HOME: /usr/lib/jvm/openjdk-8u222-b10
1 unsatisfied dependencies were removed from build (use -v to list them)
Compiling com.oracle.mxtool.junit with javac-daemon(JDK 1.8)... [/mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.junit/bin/com/oracle/mxtool/junit/ModuleSupport.class does not exist]
Building com.oracle.jvmtiasmagent_amd64 with Ninja... [dependencies were added, removed or re-ordered]
/mnt/d/platformX/maxine-src/mx/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/FullThreadDumpDecorator.java:83: error: cannot find symbol
                        ti.getPriority(),
                          ^
  symbol:   method getPriority()
  location: variable ti of type ThreadInfo
/mnt/d/platformX/maxine-src/mx/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/FullThreadDumpDecorator.java:82: error: cannot find symbol
                        ti.isDaemon() ? "daemon" : "",
                          ^
  symbol:   method isDaemon()
  location: variable ti of type ThreadInfo
2 errors

Compiling com.oracle.mxtool.junit with javac-daemon(JDK 1.8): Failed due to error: 1
Compiling com.oracle.mxtool.junit with javac-daemon(JDK 1.8) failed
1 build tasks failed

The verbose output:

$ mx -v build
OS variant detected: none
[project com.oracle.mxtool.junit.jdk9 was removed as JDK 9 is not available]
[com.oracle.mxtool.junit.jdk9 was removed from distribution JUNIT_TOOL]
JAVA_HOME: /usr/lib/jvm/openjdk-8u222-b10
Dependencies removed from build:
 project com.oracle.mxtool.junit.jdk9 was removed as JDK 9 is not available
Starting daemon for /usr/lib/jvm/openjdk-8u222-b10/bin/java [-d64]
[all files are up to date - skipping com.oracle.mxtool.compilerserver]
/usr/lib/jvm/openjdk-8u222-b10/bin/java -d64 -cp /mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.compilerserver/bin:/usr/lib/jvm/openjdk-8u222-b10/lib/tools.jar com.oracle.mxtool.compilerserver.JavacDaemon -v -j 8
Started server on port 40525 [8 threads]
[Started javac-daemon on port 40525 for Java 1.8.0_222 (1.8) from /usr/lib/jvm/openjdk-8u222-b10]
[all files are up to date - skipping com.oracle.graal.api.runtime]
[all files are up to date - skipping com.sun.max.annotate]
[all files are up to date - skipping com.oracle.graal.options]
[all files are up to date - skipping com.oracle.graal.debug]
[all files are up to date - skipping com.oracle.graal.api.meta]
[all files are up to date - skipping com.oracle.graal.bytecode]
[all files are up to date - skipping com.sun.max.jdwp.vm]
[all files are up to date - skipping com.oracle.mxtool.checkcopy]
[all files are up to date - skipping com.oracle.max.elf]
[all files are up to date - skipping com.oracle.mxtool.compilerserver]
[skipping GCC_NINJA_TOOLCHAIN]
[all files are up to date - skipping com.oracle.graal.api.replacements]
[all files are up to date - skipping com.oracle.mxtool.webserver]
[all files are up to date - skipping com.oracle.truffle.api]
[all files are up to date - skipping com.oracle.graal.service.processor]
[all files are up to date - skipping com.oracle.graal.graph]
[all files are up to date - skipping test.jsr292]
[skipping Options]
[all files are up to date - skipping com.sun.cri]
[all files are up to date - skipping com.oracle.graal.replacements.verifier]
[skipping ServiceProcessor]
[all files are up to date - skipping com.oracle.graal.test]
[all files are up to date - skipping com.oracle.truffle.api.dsl]
[all files are up to date - skipping com.oracle.graal.api.code]
[all files are up to date - skipping com.oracle.graal.graph.test]
Cleaning /mnt/d/platformX/maxine-src/mx/mxbuild/com.oracle.mxtool.junit...
Cleaning /mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.junit/bin...
[all files are up to date - skipping com.oracle.graal.debug.test]
[all files are up to date - skipping com.oracle.mxtool.jmh_1_21]
Compiling com.oracle.mxtool.junit with javac-daemon(JDK 1.8)... [/mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.junit/bin/com/oracle/mxtool/junit/ModuleSupport.class does not exist]
/usr/lib/jvm/openjdk-8u222-b10/bin/javac -g -d /mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.junit/bin -classpath /root/.mx/cache/HAMCREST_42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest.jar:/root/.mx/cache/JUNIT_2973d150c0dc1fefe998f834810d68f278ea58ec/junit.jar -parameters -proc:none -target 1.8 -source 1.8 @/mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.junit/javafilelist.txt -Xlint:all,-auxiliaryclass,-processing,-options -XDignore.symbol.file -Werror -encoding UTF-8 -Xmaxerrs 10000
Compiling -g -d /mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.junit/bin -classpath /root/.mx/cache/HAMCREST_42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest.jar:/root/.mx/cache/JUNIT_2973d150c0dc1fefe998f834810d68f278ea58ec/junit.jar -parameters -proc:none -target 1.8 -source 1.8 @/mnt/d/platformX/maxine-src/mx/mxbuild/jdk8/com.oracle.mxtool.junit/javafilelist.txt -Xlint:all,-auxiliaryclass,-processing,-options -XDignore.symbol.file -Werror -encoding UTF-8 -Xmaxerrs 10000
[skipping DEFAULT_NINJA_TOOLCHAIN]
[all files are up to date - skipping com.oracle.max.cri]
[all files are up to date - skipping com.oracle.graal.api.meta.test]
[all files are up to date - skipping com.oracle.graal.asm]
[all files are up to date - skipping com.sun.max.jdwp]
[all files are up to date - skipping com.oracle.graal.amd64]
[all files are up to date - skipping com.oracle.max.criutils]
[skipping MX_MICRO_BENCHMARKS]
[all files are up to date - skipping com.oracle.graal.hsail]
[all files are up to date - skipping com.oracle.truffle.api.test]
[all files are up to date - skipping com.oracle.graal.api.test]
[all files are up to date - skipping com.oracle.graal.sparc]
[skipping ReplacementVerifier]
Checking whether to build com.oracle.jvmtiasmagent_amd64 with Ninja...
# Directory: /mnt/d/platformX/maxine-src/mx/mxbuild/linux-amd64-jdk8/com.oracle.jvmtiasmagent/amd64
env MX__SUITEMODEL=sibling MX_HOME=/mnt/d/platformX/maxine-src/mx MX_PRIMARY_SUITE_PATH=/mnt/d/platformX/maxine-src/maxine MX_SUBPROCESS_COMMAND_FILE=/tmp/mx_subprocess_command.2IPZO3 \
ninja -j 1 -n -d explain
[ninja: no work to do. - skipping com.oracle.jvmtiasmagent_amd64]
[all files are up to date - skipping com.oracle.graal.asm.ptx]
[all files are up to date - skipping com.oracle.graal.asm.test]
[all files are up to date - skipping com.oracle.graal.ptx]
[all files are up to date - skipping com.oracle.graal.asm.amd64]
[all files are up to date - skipping com.oracle.graal.asm.hsail]
[all files are up to date - skipping com.oracle.graal.asm.amd64.test]
[all files are up to date - skipping com.oracle.max.asm]
[all files are up to date - skipping com.oracle.mxtool.jacoco]
/mnt/d/platformX/maxine-src/mx/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/FullThreadDumpDecorator.java:83: error: cannot find symbol
                        ti.getPriority(),
                          ^
  symbol:   method getPriority()
  location: variable ti of type ThreadInfo
/mnt/d/platformX/maxine-src/mx/java/com.oracle.mxtool.junit/src/com/oracle/mxtool/junit/FullThreadDumpDecorator.java:82: error: cannot find symbol
                        ti.isDaemon() ? "daemon" : "",
                          ^
  symbol:   method isDaemon()
  location: variable ti of type ThreadInfo
2 errors
Result = 1
[exit code: 1]
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 17916, in <module>
    main()
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 17897, in main
    retcode = c(command_args)
  File "/mnt/d/platformX/maxine-src/mx/mx_commands.py", line 147, in __call__
    return self.command_function(*args, **kwargs)
  File "/mnt/d/platformX/maxine-src/maxine/mx.maxine/mx_maxine.py", line 98, in build
    mx.build(['--warning-as-error'] + args)
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 14542, in build
    task.proc.start()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 130, in start
    self._popen = Popen(self)
  File "/usr/lib/python2.7/multiprocessing/forking.py", line 126, in __init__
    code = process_obj._bootstrap()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 14523, in executeTask
    task.execute()
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 5162, in execute
    _built = self.build()
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 7585, in build
    self.compiler.compile(self.compileArgs)
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 7957, in compile
    return self.daemon.compile(nonJvmArgs)
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 8060, in compile
    abort(retcode)
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 4137, in abort
    traceback.print_stack()

Compiling com.oracle.mxtool.junit with javac-daemon(JDK 1.8): Failed due to error: 1
[all files are up to date - skipping com.oracle.truffle.dsl.processor]
[all files are up to date - skipping com.oracle.graal.nodes]
[all files are up to date - skipping com.sun.max]
Compiling com.oracle.mxtool.junit with javac-daemon(JDK 1.8) failed
[Stopped javac-daemon on port 40525 for Java 1.8.0_222 (1.8) from /usr/lib/jvm/openjdk-8u222-b10]
Shutting down
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 17916, in <module>
    main()
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 17897, in main
    retcode = c(command_args)
  File "/mnt/d/platformX/maxine-src/mx/mx_commands.py", line 147, in __call__
    return self.command_function(*args, **kwargs)
  File "/mnt/d/platformX/maxine-src/maxine/mx.maxine/mx_maxine.py", line 98, in build
    mx.build(['--warning-as-error'] + args)
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 14585, in build
    abort('{0} build tasks failed'.format(len(failed)))
  File "/mnt/d/platformX/maxine-src/mx/mx.py", line 4137, in abort
    traceback.print_stack()
1 build tasks failed
kotselidis commented 2 years ago

Thanks for the report, I have never seen this error before.. @orionpapadakis have you seen this before?

orionpapadakis commented 2 years ago

Hi Ryan,

Please try to clone the mx tool again but on the 5.194.3 tag this time ( use this command git clone -b 5.194.3 https://github.com/graalvm/mx instead of the one provided in the instructions). Then

cd $MAXINE_HOME mx clean mx build

If this resolve your issue, we apparently need to update our build tutorial.

zahrayousefijamarani commented 2 years ago

It works for me. but I get this error for "mx inspect ... ":

Traceback (most recent call last):
  File "/home/p4/maxim/mx/mx.py", line 18848, in <module>
    main()
  File "/home/p4/maxim/mx/mx.py", line 18829, in main
    retcode = c(command_args)
  File "/home/p4/maxim/mx/mx_commands.py", line 148, in __call__
    return self.command_function(*args, **kwargs)
  File "/home/p4/maxim/maxine/mx.maxine/mx_maxine.py", line 413, in inspect
    if mx.is_darwin() and not remote:
AttributeError: 'module' object has no attribute 'is_darwin'

and git clone -b 5.265.2 https://github.com/graalvm/mx solved the problem.

Thanks @orionpapadakis

yurun-yuan commented 2 years ago

Hi Ryan,

Please try to clone the mx tool again but on the 5.194.3 tag this time ( use this command git clone -b 5.194.3 https://github.com/graalvm/mx instead of the one provided in the instructions). Then

cd $MAXINE_HOME mx clean mx build

If this resolve your issue, we apparently need to update our build tutorial.

It works for me, thanks!