GitHub user bradh352 closed a discussion: Building Cloudstack DEB packages for 
Ubuntu

What is the current recommended way to build cloudstack .deb packages on 
Ubuntu?  I need to test a PR (#11932) and a suggestion in there used a 
container for building, but its using Ubuntu 20.04 which is EOL and generates 
packages with `lenny` in the name.  I have no idea if these will work 
overriding the Cloudstack 4.22.0 packages or if that is a horrible idea.

The cloudstack official docs seem to reference Ubuntu 18.04, and that's 
likewise a nonstarter.

I tried with Ubuntu 24.04 basically following the same docs, but then hit 
roadblock with the build appearing to require Python 2.7 (which is of course 
EOL).

The docs don't really state what openjdk version to use, but I looked at my 
production servers and it appears openjdk 17 was installed.

So I'm falling back to a fresh Ubuntu 22.04 install for building since python 
2.7 is available there.  I'm guessing its only a build-time dependency and not 
runtime.

So this is what I have so far ...
```
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash - && \
sudo apt-get update && \
sudo apt-get install build-essential git devscripts debhelper openjdk-17-jdk 
libws-commons-util-java genisoimage libcommons-codec-java 
libcommons-httpclient-java liblog4j1.2-java maven nodejs 
python3-mysql.connector python2 python-setuptools jq && \
git clone -b 4.22.0.0 https://github.com/apache/cloudstack && \
wget 
https://patch-diff.githubusercontent.com/raw/apache/cloudstack/pull/11932.patch 
&& \
cd cloudstack && \
git config user.email "[email protected]" && \
git am < ../11932.patch && \
mvn -P deps -DskipTests -T `nproc` && \
cd packaging && \
./build-deb.sh
```

And its failing in the `build-deb.sh` with:
```
[ERROR] Tests run: 101, Failures: 0, Errors: 101, Skipped: 0, Time elapsed: 
0.231 s <<< FAILURE! - in com.cloud.utils.net.NetUtilsTest
[ERROR] test31BitPrefixEnd(com.cloud.utils.net.NetUtilsTest)  Time elapsed: 
0.003 s  <<< ERROR!
java.lang.IllegalStateException: Could not initialize plugin: interface 
org.mockito.plugins.MockMaker (alternate: null)
Caused by: java.lang.IllegalStateException: Internal problem occurred, please 
report it. Mockito is unable to load the default implementation of class that 
is a part of Mockito distribution. Failed to load interface 
org.mockito.plugins.MockMaker
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.mockito.exceptions.base.MockitoInitializationException:

Could not initialize inline Byte Buddy mock maker.

It appears as if your JDK does not supply a working agent attachment mechanism.
Java               : 17
JVM vendor name    : Ubuntu
JVM vendor version : 17.0.17+10-Ubuntu-122.04
JVM name           : OpenJDK 64-Bit Server VM
JVM version        : 17.0.17+10-Ubuntu-122.04
JVM info           : mixed mode, sharing
OS name            : Linux
OS version         : 5.15.0-161-generic

Caused by: java.lang.IllegalStateException: Could not self-attach to current VM 
using external process - set a property net.bytebuddy.agent.attacher.dump to 
dump the process output to a file at the specified location
```

I'm assuming I'm missing another step somewhere.

GitHub link: https://github.com/apache/cloudstack/discussions/12177

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to