Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Thursday, July 2, 2020

Building HBase 1.3.1 with JDK 8

HBase is a opensource NoSQL store built on top of Hadoop HDFS filesystem. Read more about it here

Building HBase 1.3.1 with JDK 8 will bring out some new problems (Well there are some other issues as well). This blog post is to help people who are walking on the same way as I am.


Assumptions

1. You have installed JDK 8
2. HBase uses maven for builds, you should have installed maven.
3. The sources are already downloaded and are present in /home/xyz/hbase

mvn install won't work?

No, you will hit some compilation issues and some shell script failures.

Compilation error
[ERROR] Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:3.0.0:findbugs (default) on project hbase: Unable to parse configuration of mojo org.codehaus.mojo:findbugs-maven-plugin:3.0.0:findbugs for parameter pluginArtifacts: Cannot assign configuration entry 'pluginArtifacts' with value '${plugin.artifacts}' of type java.util.Collections.UnmodifiableRandomAccessList to property of type java.util.ArrayList -> [Help 1]

Shell script failure
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (concat-NOTICE-files) on project hbase-assembly: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (concat-NOTICE-files) on project hbase-assembly: Command execution failed.

Ok how do I solve them?

1. Edit the file /home/xyz/hbase/pom.xml and make the following changes.

     Before
        ...
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>3.0.0</version>
          <!--NOTE: Findbugs 3.0.0 requires jdk7-->
        ...

     After
        ...
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>3.0.4</version>
          <!--NOTE: Findbugs 3.0.0 requires jdk7-->
        ...


2. Edit the file /home/xyz/hbase/hbase-assembly/pom.xml and make the following changes. New versions of bash seems to not accept the extra line at the end

     Before
        ...
            <argument>bash</argument>
            <argument>-c</argument>
            <argument>cat maven-shared-archive-resources/META-INF/NOTICE \
                `find ${project.build.directory}/dependency -iname NOTICE -or -iname NOTICE.txt` \
            </argument>
        ....
     After
        ...
            <argument>bash</argument>
            <argument>-c</argument>
            <argument>cat maven-shared-archive-resources/META-INF/NOTICE \
                `find ${project.build.directory}/dependency -iname NOTICE -or -iname NOTICE.txt`
            </argument>
        ...


-madhusoodan

Wednesday, July 1, 2020

Building JDK 8 on Fedora 31 (GCC 9.2.1)

This blog lists out the steps to build JDK 8 on Fedora 31. I had some compilation problems while building it, so you may find this useful.

1. I was building the openjdk 8u, so we have to clone it from the public repo

    $ hg clone http://hg.openjdk.java.net/jdk8u/jdk8u

2. This will just bring some source and scripts which are necessary to get the actual JDK and hotspot sources.

3. To get the actual sources, run the utility shell script

    $ ./get_source.sh

4. Configure the build for your system

    $ bash configure

5. Add below options if you want debug symbols

    $ bash configure --with-debug-level=slowdebug

6. Set the environment variable to resolve the compilation errors

    $ export CFLAGS="-Wno-return-type"

7. Run the build

    $ make

Little more info

gcc version

$ gcc --version
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.