Repository navigation
Snug 0.17.6
The build now tells you what it did.
Every build writes a log recording the options it actually used and where each one came from, every diagnostic raised, and where the output went. Every diagnostic carries a stable code you can quote in a bug report. And the checks the documentation had been promising for a while are now actually performed.
Since the last release (0.16.2) this is 31 commits and one new CLI flag.
Highlights
A build log for every build
Every build writes a log - snug.build.log in the directory you ran snug from, or wherever --build-log <PATH> points. Each build replaces the one before it.
The part worth reading is the effective-options table, because the origin column answers the question a surprising setting raises:
Effective build options:
input: MyApplication.jar [command line]
output: MyApplication.exe [inferred from input]
min-java: 25 [default]
name: My Application [snug.options:74]
A value can come from the command line, an options file, a JAR manifest, or a built-in default. When a higher-priority source overrides a lower one, the losing value is recorded underneath the winner, with both origins - so the
override is visible rather than inferred.
The log opens first and reports failures into it, so a build that dies early still leaves a record of why. Paths are relative to the working directory, which is stated on the log's first line; a path outside it stays absolute. stdout carries only --emit-payload bytes, and the same report goes to stderr, so the console and the log agree.
Note that --build-log does not create parent directories. Snug will not make a directory tree out of a mistyped path, so a missing parent is an error rather than a surprise.
Coded diagnostics
Diagnostics carry stable codes, and the severity leads:
[ ERROR ] SNUG-INPUT-001: the input file could not be opened
hint: check the path and try again
An error stops the build; a warning does not. The code is what you quote in a bug report, and it does not change when the wording does - so docs/diagnostics.md
is a real reference rather than a duplicate of the messages. It also states what each check does not cover.
There are 23 codes, and a test drives one real build per code, so no code can be declared that no build can raise, and no raised code can go undeclared.
The promised checks now run
These were described in the documentation and were not being performed. They
are now:
- Every supplied archive is opened as a ZIP - even when
--main-classoverrides the manifest. - The selected class must be on the embedded classpath.
- The entry class must not need a newer Java than
--min-java. The scan reads the version header of every class in the archive, so it covers the whole archive, and it is multi-release aware: the highest overlay at or below the configured release counts. - Preview bytecode is reported.
- The entry point is checked for startability, by walking the superclass chain - the JVM searches superclasses, so a class that inherits
mainlaunches fine and is not reported. Neither is a JavaFXApplication, which the launcher starts throughApplication.launch.
Behaviour change: a build with no entry point is now an error. It used to succeed silently and produce an executable that could not start, failing on your machine instead of on the build machine.
One copy of each JAR, shared between applications
Two applications built from the same library stack used to write the same JAR out twice - identical bytes, neither copy knowing about the other.
A content-addressed store now sits beside the per-application roots:
%LOCALAPPDATA%\snug\jars\<sha256>\app.jar holds one copy of each distinct JAR, and an application's entry becomes a hard link to it. Two applications that ship the same library now hold the bytes once between them. The store's copy and both applications' copies report the same file index, with a link count of three.
On a filesystem without hard links (FAT32, exFAT) the store is not used at all - a store that silently copied would be worse than no store, since the bytes would be written twice and copied again on every launch. The store is also switched off when --cache-dir relocates the cache root, because a link cannot cross a volume.
Each application's own root now keeps one generation rather than three. The store's retention is by reference and by age: an entry is kept while any application's root still points at it - which is what makes a rollback cheap - and otherwise evicted after 30 days without a use.
The licence texts ship with the release
LICENSE, LICENSE-MIT, LICENSE-APACHE and NOTICE now travel with the artefacts, inside the snug/ folder of the archive and beside the bare binary. The packager refuses to build an archive that is missing one of them, so this is enforced rather than left to whoever runs the release.
The demo ships pre-built
snug-javafx-demo-windows.exe is now published beside the demo JAR. The demo is the same one, already built by snug — download it and double-click it; there is no build step to run. The JAR it was built from is published next to it, so you can see the input and the result side by side.
Also in this release
--dry-runnow validates resources (icon, splash, manifest) rather than skipping them.- A build-log path that collides with an existing file is guarded before truncation.
- Snug Quick Build writes the authoritative build log into its own folder rather than beside the dropped JAR, and keeps a
snug-build.logtranscript. scripts\windows\clean.cmdreclaims the Rust build intermediates.target\is the largest thing in a working copy and cargo never discards it on its own - measured at 5.4 GB here, of whichtarget\debug\alone was 4.3 GB.- Fixed a build-log collision that could truncate a file before the guard noticed.
Upgrading
Nothing to do. The build log appears automatically; delete snug.build.log if you would rather not have it.
If your build previously succeeded with no entry point, it will now fail with a diagnostic. That executable could not have started, so this is the build telling you what it already knew.
Known limitations
- The shared JAR store is Windows-only for now.
- The Windows x64 ZIP is the only artefact here.
- Snug is unsigned. Windows may show a warning on first run.
Verification
fmt, clippy -D warnings, the launcher-stub freshness check, and the full Windows test suite: 670 passed, 2 ignored on Windows at 0.17.6.
Windows x64. Snug turns a Java fat JAR into a native .exe launcher. It does not bundle a JVM — the target machine needs a compatible Java install (Java 25 by default), or Snug can offer to download Eclipse Temurin.