Closed jayvdb closed 6 months ago
Definitely a bug; there were a lot of build tooling changes between 0.15 and 0.16.
Try 0.16.629, it should have the main attribute now.
Now it finds the Main-Class in the manifest as cljstyle.main
but cant load it.
['jgo', '--repository', 'clojars.org=https://repo.clojars.org', 'mvxcvi:cljstyle:0.16.629', 'fix', '/home/jayvdb/python/py2many/tests/build/demorgan.smt'] (code: 1): b'INFO 2024-01-08 19:06:20,823: First time start-up may be slow. Downloaded dependencies will be cached for shorter start-up times in subsequent executions.\nINFO 2024-01-08 19:06:33,757: Inferring main class from jar manifest\nINFO 2024-01-08 19:06:33,758: Inferred main class: cljstyle.main\nError: Could not find or load main class cljstyle.main\nCaused by: java.lang.ClassNotFoundException: cljstyle.main\n'b''
Ah, probably because the namespaces aren't getting AOT compiled anymore. 🤔 I was hesitant to do this since it basically makes it into an uberjar, but I doubt people are going to pull cljstyle in as a library in most cases...
Perhaps also publish a cljstyle-cli , which is the uberjar ?
I'll consider turning AOT back on for the published jar. In the meantime, I pushed 0.16.630
which fixed a different issue, but also now enables this workaround leveraging clojure.main
as the entry point:
% jgo \
--repository clojars.org=https://repo.clojars.org/ \
mvxcvi:cljstyle:0.16.630:clojure.main \
-m cljstyle.main \
check --report
# Checked 665 of 1095 files in 6.11 sec (108.9 fps)
# Checked 3947.2 KB of source files (646.5 KBps)
# 665 correct
# 362 unrelated
# 68 ignored
In practice you could use RELEASE
instead of the specific version number. Is this good enough to solve the issue here?
That worked locally. Doing a PR https://github.com/py2many/py2many/pull/587 . thanks.
With prior releases I could use jgo like this
Now that fails with
There doesnt appear to be any other 0.16 releases uploaded, so I have switched to the more explicit
This works for me for now, but it would be good if cljstyle could specify its Main-Class in the jar metadata for future releases.