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

Upgrade to sbt 1.2.6 #1954

Merged
merged 9 commits into from
Apr 8, 2019
Merged

Upgrade to sbt 1.2.6 #1954

merged 9 commits into from
Apr 8, 2019

Conversation

farmdawgnation
Copy link
Member

This PR gets the Lift build running under SBT 1.2.6, aside from the yui compressor plugin. We'll want to replace that with something from sbt-web, I suspect.

@Shadowfiend
Copy link
Member

Hmmm… That feels dangerous. Is YUI compressor failing to work in sbt 1.2.6?

Main issue I see: say someone is using CSP with hashes. The hash for the lift.js file will probably change if we use a different compressor, which will cause the page to fail to load correctly.

Feels niche-y, but worth mentioning.

@farmdawgnation
Copy link
Member Author

Yeah. I don’t think it’s unreasonable to need to update CSP hashes when upgrading. Those hashes will change with any change to the code.

The problem is the yui compressor plugin isn’t maintained by anyone other than us and is nontrivial enough to have run afoul of the sbt API - unlike the lift build plugin. We’ll get a better ROI from a plugin maintained by the community if it works. I did some finagling with it unsuccessfully. But I was in an impatient mood so maybe a second look will yield something.

@Shadowfiend
Copy link
Member

Nah, reasoning seems fair, if there's something else to switch to I say let's do it.

The previous presence of the CVMapping helper means we didn't need %%
previously
Previously, we could reference scala.xml as just "xml". This is no
longer valid, it seems.
@farmdawgnation
Copy link
Member Author

@Shadowfiend I think this build will pass now. Had to do some munging that I suspect is related to changes in how the default import visibility is set up for scala.xml? In any event, we shouldn't have been referencing that by just xml in the first place. Convenient shortcut, but potentially ambiguous.

@@ -83,7 +83,9 @@ object Dependencies {
lazy val mockito_all = "org.mockito" % "mockito-all" % "1.9.0" % "test"
lazy val scalacheck = "org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test"
lazy val specs2 = "org.specs2" %% "specs2-core" % "3.8.6" % "test"
lazy val specs2Main = "org.specs2" %% "specs2-core" % "3.8.6"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we need this main-classpath variant?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webkit provides some things that depend on specs2 (e.g. MockWeb)

Copy link
Member

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of additional questions here.

build.sbt Outdated
(sources / aggregate) in (Compile, doc),
aggregatedSetting(dependencyClasspath in(Compile, doc)),
publishArtifact := false
)*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we can nuke now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, I had planned to replace this with the unidoc plugin but under either implementation I'm getting..... fun errrors:

[error] (lift-mapper / Compile / doc) java.net.URISyntaxException: Illegal character in path at index 45: http://www.scala-lang.org/api/SettingKey(This / This / This / version)/scala/xml/NodeSeq.html

build.sbt Outdated
specs2.copy(configurations = Some("provided")),
specs2Matchers.copy(configurations = Some("provided")),
specs2Main,
specs2MatchersMain,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new one puts it on the classpath, while the old one marked it provided (~= not on the classpath via sbt, but on the classpath via external means?). Not fully following the difference in what we were doing vs what we're doing now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhhh right you are.

@Shadowfiend
Copy link
Member

Looks like maybe Util.scala needs some more scala.xml-ification?

[error] … net/liftweb/mapper/view/Util.scala:51:14: object Elem is not a member of package xml

@farmdawgnation
Copy link
Member Author

:shakefist:

aggregatedSetting(dependencyClasspath in(Compile, doc)),
publishArtifact := false
)*/
.enablePlugins(ScalaUnidocPlugin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to check---is this still officially a workaround for scala/scala-dev#249 per the comment above it? Happy to make this edit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. To be clear this comment about the Scala bug is for the block above, not the block below 😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are about the compiled mega docs. It’s currently misbehaving but I think this PR is still a win.

Copy link
Member

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks gooooood to me 🚀

@Shadowfiend
Copy link
Member

Going to let this sit for a few but probably merging by EOD.

@Shadowfiend
Copy link
Member

:shipit:

@Shadowfiend Shadowfiend merged commit 975aa11 into master Apr 8, 2019
@Shadowfiend Shadowfiend deleted the sbt-126 branch April 8, 2019 20:25
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

Successfully merging this pull request may close these issues.

2 participants