Skip to content

Commit 118d200

Browse files
committed
giving up on GraalVM. trying to pack JRE directly from installers
1 parent 3e5aa6d commit 118d200

6 files changed

Lines changed: 54 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,5 @@ core-tests/e2e-tests/spring/spring-rest-mysql/target
168168
/pypi-distribution/dist/
169169
/pypi-distribution/src/evomaster.egg-info/
170170
/build/
171+
/pypi-distribution/dmg/
172+
/pypi-distribution/src/evomaster/dmg/

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
<Specification-Title>${project.name}</Specification-Title>
417417
<Specification-Version>${project.version}</Specification-Version>
418418
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
419-
<!-- Keep this in sync with JdkIssue -->
419+
<!-- Keep this in sync with JdkIssue and makeExecutable.sh -->
420420
<Add-Opens>java.base/java.net java.base/java.util</Add-Opens>
421421
</manifestEntries>
422422
</transformer>

core/src/main/kotlin/org/evomaster/core/JdkIssue.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object JdkIssue {
2222
return true
2323
}catch (e: Exception){
2424

25-
//This needs to be kept in sync with core/pom.xml -> maven-assembly-plugin
25+
//This needs to be kept in sync with core/pom.xml -> maven-assembly-plugin and makeExecutable.sh
2626
val command = "--add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED"
2727

2828
LoggingUtil.getInfoLogger().error(inRed("It looks like you are running EvoMaster with JDK 17+," +

makeExecutable.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,28 @@ COPYRIGHT="Copyright 2016-$YEAR EvoMaster Team"
3838
VENDOR="EvoMaster Team"
3939

4040
$JPACKAGE --main-jar $JAR --input $BUILD --dest $RELEASE --name evomaster \
41-
--copyright "$COPYRIGHT" --license-file ./LICENSE --vendor "$VENDOR" --app-version $VERSION $OS
41+
--copyright "$COPYRIGHT" --license-file ./LICENSE --vendor "$VENDOR" --app-version $VERSION $OS \
42+
--java-options "--add-opens java.base/java.net=ALL-UNNAMED" \
43+
--java-options "--add-opens java.base/java.util=ALL-UNNAMED"
44+
# In theory, should not need --add-opens here, as in theory handled inside manifest of uber jar.
45+
# Unfortunately, it does not work when unpacking a DMG distribution without installing it.
46+
# After pulling enough hair understanding WTF was going on, an easy workaround was just to force the
47+
# --add-opens here as well.
48+
# IMPORTANT: must be kept in sync with maven-shade-plugin in pom.xml and JdkIssue
49+
50+
if [ "$TAG" == "WINDOWS" ]; then
51+
echo TODO WINDOWS
52+
elif [ "$TAG" == "OSX" ]; then
53+
# Need to convert, as no way in f*****g Mac you can install programmatically :(
54+
hdiutil convert release/evomaster-*.dmg -format UDTO -o evomaster.cdr
55+
hdiutil attach evomaster.cdr -nobrowse -noverify -noautoopen
56+
rm -fr pypi-distribution/src/evomaster/dmg
57+
cp -r /Volumes/evomaster pypi-distribution/src/evomaster/dmg
58+
hdiutil detach /Volumes/evomaster
59+
rm evomaster.cdr
60+
elif [ "$TAG" == "DEBIAN" ]; then
61+
echo TODO DEBIAN
62+
else
63+
echo Unrecognized tag "$TAG"
64+
exit 1
65+
fi

pypi-distribution/pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@ license = {text = "LGPL"}
1616
Homepage = "https://github.com/WebFuzzing/EvoMaster"
1717
Issues = "https://github.com/WebFuzzing/EvoMaster/issues"
1818

19+
[tool.setuptools.packages.find]
20+
where = ["src"]
21+
22+
[tool.setuptools.package-data]
23+
evomaster = ["dmg/**"]
24+
1925

2026
[project.scripts]
2127
evomaster = "evomaster.__main__:main"
2228

2329

30+
31+
2432
### Release
2533
# rm -r dist
2634
# python3 -m build
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
import sys
2+
import os
3+
import subprocess
4+
25

36
def main():
47
print("Work in Progress - The release of WebFuzzing/EvoMaster on PyPi will hopefully happen soon in 2026")
5-
sys.exit(0)
8+
9+
base = os.path.dirname(__file__)
10+
11+
exe = os.path.join(base, "dmg","evomaster.app", "Contents", "MacOS", "evomaster")
12+
13+
if not os.path.exists(exe):
14+
print("Error: could not find EvoMaster executable at:", exe, file=sys.stderr)
15+
sys.exit(1)
16+
17+
cmd = [exe] + sys.argv[1:]
18+
19+
# Forward exit code
20+
result = subprocess.run(cmd)
21+
sys.exit(result.returncode)
622

723
if __name__ == "__main__":
824
main()

0 commit comments

Comments
 (0)