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 (building maxine with docker) #28

Closed Buenbk closed 2 years ago

Buenbk commented 2 years ago

I ran "mx build" in the "maxine-dev" docker container, but got some errors. It seems that we should not use "ThreadInfo.getPriority()" in jdk 1.8? That appears in jdk 1.9 and above.

** /root/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 /root/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 **

orionpapadakis commented 2 years ago

Hello,

Please replace Dockerfile (maxine-src/maxine/docker/Dockerfile) lines 6-11 with the following:

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    make gcc gdb g++ python python2.7 libnuma-dev \
    git screen rsync ssh wget \
    # Font Libraries
    libfontconfig1 \
    && apt-get clean

# Java 8 u222
RUN wget --no-check-certificate -O /tmp/openjdk-8u222b10.tar.gz https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_x64_linux_8u222b10.tar.gz \
    && mkdir /usr/lib/jvm \
    && tar xzvf /tmp/openjdk-8u222b10.tar.gz --directory /usr/lib/jvm/ \
    && mv /usr/lib/jvm/openjdk-8u222-b10 /usr/lib/jvm/java-8-openjdk-amd64

# Install CA certificates
RUN apt-get update && \
    apt-get install -y ca-certificates && \
    update-ca-certificates

to fetch and use openjdk 8u222. Then rebuild the container from scratch and try mx build again. If that works please let us know since we apparently need to update stuff.

orionpapadakis commented 2 years ago

Also clone mx tool as stated in #26

Buenbk commented 2 years ago

Hello,

Please replace Dockerfile (maxine-src/maxine/docker/Dockerfile) lines 6-11 with the following:

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    make gcc gdb g++ python python2.7 libnuma-dev \
    git screen rsync ssh wget \
    # Font Libraries
    libfontconfig1 \
    && apt-get clean

# Java 8 u222
RUN wget --no-check-certificate -O /tmp/openjdk-8u222b10.tar.gz https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_x64_linux_8u222b10.tar.gz \
    && mkdir /usr/lib/jvm \
    && tar xzvf /tmp/openjdk-8u222b10.tar.gz --directory /usr/lib/jvm/ \
    && mv /usr/lib/jvm/openjdk-8u222-b10 /usr/lib/jvm/java-8-openjdk-amd64

# Install CA certificates
RUN apt-get update && \
    apt-get install -y ca-certificates && \
    update-ca-certificates

to fetch and use openjdk 8u222. Then rebuild the container from scratch and try mx build again. If that works please let us know since we apparently need to update stuff.

Thank you. It works for me. But when I run "mx -v helloworld" ---> File "/root/maxine-src/mx/mx.py", line 11214, in run env_diff = env.viewitems() - _original_environ.viewitems() AttributeError: _Environ instance has no attribute 'viewitems'

and when I run "mx makejdk" ---> File "/root/maxine-src/maxine/mx.maxine/mx_maxine.py", line 522, in makejdk if mx.is_darwin(): AttributeError: 'module' object has no attribute 'is_darwin'

I don't kown if it's because of my wrong operations.