-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile / sbt.Keys.packageBin := bundle.value
can cause infinite recursive loop
#104
Comments
I am not really familiar with how sbt-osgi is used, but do all sbt-osgi treat |
I am also familiarizing myself with the sbt-osgi as well, but from what I can tell users basically treat bundle in the same way as
From what I can tell this is definitely the ideal case, but there appears to be asynchronicity issues which is whats adding the complications here. Specifically sbt-osgi's
So in my specific case, the original problem I hit is that since sbt-osgi was changed to use
I am still somewhat unsure whether this is an actual problem or not, the reason behind wanting to use On the other hand, its not the best user experience because if you don't do this, you basically create broken jar's which you only figure out at runtime in another project that includes your jar's as a standard dependency. In short from what I can understand, ideally we would just use |
As a consequence of #95, its possible to create an infinite recursive loop which means that sbt never ends up fully starting.
To reproduce this, simply change https://github.com/sbt/sbt-osgi/blob/main/src/main/scala/com/typesafe/sbt/osgi/SbtOsgi.scala#L47 to
(fullClasspath in Compile).value.map(_.data)
and then navigate intosrc/sbt-test/sbt-osgi/test-05-exportJars/
to run the test (i.e. runsbt osgiBundle
).You will notice that sbt stalls forever, failing to start. My suspicion is that there is an interdependency between
bundle := Osgi.bundleTask
(fullClasspath in Compile).value.map(_.data)
Compile / sbt.Keys.packageBin := bundle.value
Which causes the sbt task graph to not complete when evaluated. Apparently the intention of #95 was to prevent asynchronicity issues (see #79 (comment)) by forcefully evaluating
Compile / sbt.Keys.packageBin
.@romainreuillon Maybe there is a better way to solve this otherwise I think I would have to revert the change since you can easily prevent sbt from even starting.
The text was updated successfully, but these errors were encountered: