Skip to content
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

clean somehow results in empty jarfiles #105

Closed
tpolecat opened this issue Feb 20, 2020 · 12 comments
Closed

clean somehow results in empty jarfiles #105

tpolecat opened this issue Feb 20, 2020 · 12 comments

Comments

@tpolecat
Copy link
Contributor

We have a project which publishes for JVM/JS and Scala 2.12/2.13 and with v1.5.2 of the plugin the 2.13 jarfiles are always empty! Nothing but a manifest. Works fine with v.1.5.0.

It seems that this commit 5f0ca45 causes the classfiles to get wiped out prior to 2.13 packaging. I don't understand this thing well enough to explain how that's possible but it seems to be what's happening. Possibly something happening concurrently and it's nondeterministic but probable?

@tpolecat
Copy link
Contributor Author

/cc @softinio who provided this clue

@olafurpg
Copy link
Member

Thank you for reporting! This is an odd issue. Looks like the right thing to do is to release a revert first.

@tpolecat
Copy link
Contributor Author

tpolecat commented Feb 20, 2020

I'm surprised nobody else has reported, which makes me suspicious there's some other weird interaction in my build that's exposing it. I would definitely try to repro before reverting, I just don't know how to do so locally.

@olafurpg
Copy link
Member

ci-release is kind of an alias for doing

clean
sonatypeBundleClean
+publishSigned
soatypeBundleRelease

You can try to do that locally (although note that it triggers a proper release)

@tpolecat
Copy link
Contributor Author

Uh, well rolling back to 1.5.0 now the 2.12 jarfiles are empty. So there's some interaction between updates to sbt, sbt-ci-release, and/or sbt-scalajs-crossproject because all three have changed since the last successful cross-build. I will investigate more and report back.

@softinio
Copy link
Contributor

@tpolecat if helpful to your investigation I have 1.5.0 working on multiple projects as expected with no issue with the only difference being you are using crossproject and I am not so totally you are probably right in looking into this area.

Let me know if I can be of further help.

olafurpg pushed a commit to olafurpg/gsp-math that referenced this issue Feb 21, 2020
Previously, the build published the empty "root" project causing release
issues because the directory of the repo matches the module name of the
`gsp-math` project, which is supposed to get published.

* https://twitter.com/sjrdoeraene/status/1230773654910382080
* sbt/sbt-ci-release#105
@olafurpg
Copy link
Member

I opened gemini-hlsw/lucuma-core#71 disabling the publish step for the root project. It's not obvious at all that skip in publish is needed on the toplevel build.

I wish sbt would stop supporting the implicit "root" project. It used to be more common to use the root project but today I feel like most builds are multi-module and my impression is that the root project causes more confusion and harm than good.

@olafurpg
Copy link
Member

We should try to improve the documentation or error handling somehow to prevent this from happening. It should be possible to detect the scenario when the root project conflicts with the module name of another project.

@olafurpg
Copy link
Member

When I think of it, maybe sbt-ci-release should set skip in publish := true for all root projects 🤔 It's a better default IMO to assume there is no publishable module in the root project

@cb372
Copy link
Contributor

cb372 commented Feb 21, 2020

When I think of it, maybe sbt-ci-release should set skip in publish := true for all root projects 🤔 It's a better default IMO to assume there is no publishable module in the root project

That sounds like a reasonable default, but only if it's a multi-module project. Otherwise the root project is the one and only project you want to publish.

@tpolecat
Copy link
Contributor Author

tpolecat commented Feb 21, 2020

To me this seems like a bug in sbt. It should not allow multiple projects to have the same name ... although I guess with scala-js you expect them to have the same name. What a mess.

@tpolecat
Copy link
Contributor Author

In any case thanks @olafurpg, your PR fixed it. No problem with ci-release as far as I know, sorry for the trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants