Skip to content

Conversation

@joan38
Copy link
Collaborator

@joan38 joan38 commented Oct 28, 2020

No description provided.

Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Sorry for the bikeshedding below, but I looked way too long at this snippet trying to understand why there is a split.last.

"-c",
s"env ${sys.env.map { case (k, v) => s""""$k=$v"""" }.toSeq.mkString(" ")} $millPath -i ${BSP.getClass.getCanonicalName.split("\\$").last}/start"
),
Seq(s"$millPath -i ${BSP.getClass.getCanonicalName.split("\\$").last}/start"),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Seq(s"$millPath -i ${BSP.getClass.getCanonicalName.split("\\$").last}/start"),
Seq(s"$millPath -i ${BSP.getClass.getCanonicalName.split("\\$").head}/start"),

Although, this is effectively an array of length 1 and both will give the same result, semantically, we want the first part of the split, not the last.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point

@lefou
Copy link
Member

lefou commented Oct 31, 2020

A run on my own Travis-CI account (https://travis-ci.org/github/lefou/mill/builds/740495671) gave the following error:

[info] Compiling 9 Scala sources to /home/travis/build/lefou/mill/out/bsp/compile/dest/classes ...
[error] /home/travis/build/lefou/mill/bsp/src/mill/bsp/BSP.scala:67:73: value first is not a member of Array[String]
[error] Error occurred in an application involving default arguments.
[error]         Seq(s"$millPath -i ${BSP.getClass.getCanonicalName.split("\\$").first}/start"),
[error]                                                                         ^

Method .first isn't valid, but .head (my initial suggestion) is.

@joan38
Copy link
Collaborator Author

joan38 commented Nov 2, 2020

Lol, I don't know why I wrote first.
Corrected

@lefou lefou merged commit ff1ef40 into com-lihaoyi:master Nov 2, 2020
@lefou
Copy link
Member

lefou commented Nov 2, 2020

Thanks!

@lefou lefou added this to the after 0.8.0 milestone Nov 2, 2020
@joan38 joan38 deleted the bsp-env branch November 10, 2020 21:31
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