Skip to content

Commit

Permalink
build: Disable UPX by default. (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-simons committed Apr 13, 2023
1 parent 40500b0 commit 888c87f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ jobs:
run: >
./mvnw --no-transfer-progress -Pnative -DskipTests -pl eu.michael-simons.neo4j:neo4j-migrations-cli package -am
- name: 'Smoke test'
run: >
./neo4j-migrations-cli/target/neo4j-migrations -V
- name: 'Upload build artifact'
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -128,7 +132,11 @@ jobs:

- name: 'Create distribution'
run: >
./mvnw --no-transfer-progress -Pnative -DskipCompress -DskipTests -pl eu.michael-simons.neo4j:neo4j-migrations-cli package -am
./mvnw --no-transfer-progress -Pnative -DskipTests -pl eu.michael-simons.neo4j:neo4j-migrations-cli package -am
- name: 'Smoke test'
run: >
./neo4j-migrations-cli/target/neo4j-migrations -V
- name: 'Upload build artifact'
uses: actions/upload-artifact@v2
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ Run it with:

[source,console,subs="verbatim,attributes"]
----
./mvnw -Dnative -DskipCompress clean package
./mvnw -Dnative clean package
----

The resulting migration tool can only be used to load Cypher script based migrations in file locations.
It won't find classes, as those are instantiated dynamically via reflection, which is not supported in full in a native image.

NOTE: The binaries are compressed by default via https://upx.github.io[upx]. While it has some downsides on the RSS memory
NOTE: You can try to use https://upx.github.io[upx] to compress your binaries. While it has some downsides on the RSS memory
usage as explained by the folks over at https://quarkus.io/blog/upx/[the Quarkus team], the advantages of having a 2/3
smaller binary are bigger. Especially due to the fact that the CLI isn't a permanent memory guest.
smaller binary are bigger.
+
If you want to enable the compression in your build, remove the above `-DskipCompress` argument.
If you want to enable the compression in your build, add `-DskipCompress=false` to the build.

=== Fast build

NOTE: This is useful if you want to just have an install of a snapshot version. No tests are run, no verification is done.
NOTE: This is useful if you want to just have an installation of a snapshot version. No tests are run, no verification is done.

[source,console,subs="verbatim,attributes"]
[[build-default-bash]]
Expand Down Expand Up @@ -84,7 +84,7 @@ Use the provided script to bump the minor or major version:
./bin/bump-version.sh 3.0
----

Version can be either a new major or minor version (such as 3, 3.0 etc) or a fully qualified snapshot version (such as 3.0.0-SNAPSHOT).
Version can be either a new major or minor version (such as 3, 3.0 etc.) or a fully qualified snapshot version (such as 3.0.0-SNAPSHOT).

=== Building the documentation

Expand Down
2 changes: 1 addition & 1 deletion neo4j-migrations-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<executable-suffix />
<java-module-name>ac.simons.neo4j.migrations.cli</java-module-name>
<name-of-main-class>ac.simons.neo4j.migrations.cli.MigrationsCli</name-of-main-class>
<skipCompress>false</skipCompress>
<skipCompress>true</skipCompress>
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
</properties>

Expand Down

0 comments on commit 888c87f

Please sign in to comment.