Closed JakkuSakura closed 3 years ago
@qiujiangkun thanks for the detailed bug request. Would it be possible to provide the example projects as github repositories? This makes it easier to look at from my mobile devices and see what the issue is. :hugs:
IIRC we have some sort of heuristic to generate the name of the start script. Is there are hard requirement that you have the main entrypoints named all the same? IMHO unique names for your entrypoints solve this issue and make your colleagues happy as it's easier to find the right stuff :smile:
Sure, I have done it.
https://github.com/qiujiangkun/bug-report-1 is the test
, which turns out normal
https://github.com/qiujiangkun/bug-report-2 is the pg-poller-test
which is broken
I can work around the bug by renaming, after spending days on docker itself...
Okay, seeing the package names I guess the heuristic is tripping over the _
. The code is in the ScriptUtils.scala. I'm happy to merge a pull request that fixes this behaviour :heart:
You probably found [this documentation on script names|https://sbt-native-packager.readthedocs.io/en/latest/archetypes/java_app/index.html#a-note-on-script-names]
I have a project called
test
and the main function calledTest::main()
Expected behaviour
sbt stage
generates a script file calledtest
for the project level start point and a script for each main function. At least it gives a warning for clashing names.Actual behaviour
sbt stage
generates a single script file calledtest
for either the project level start point or for the main function. If the project level start point overwrites the main function script, the main function fails to start. If the main function script overwrites the project level one, the whole project fails to start and an infinite recursion begins:shell level (1000) too high
Information
What sbt-native-packager are you using
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.4")
What sbt version [info] welcome to sbt 1.4.6 (Azul Systems, Inc. Java 1.8.0_282)
What is your build system (e.g. Ubuntu, MacOS, Windows, Debian ) MacOS M1 Big Sur
What package are you building (e.g. docker, rpm, ...)
sbt stage
andsbt docker:publichLoacal
What is your target system (e.g. Ubuntu 16.04, CentOS 7) Linux
Minimal Example Project
This project is the case that the project-level script overwrites the main function one. test.zip Changing the names of the project and main function plus other main functions may produce another case. Here's a minimal example pg-poller-test.zip file
pg-poller
which causes infinite recursion