-
Notifications
You must be signed in to change notification settings - Fork 205
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 Scala 2.13.8 #12506
Upgrade to Scala 2.13.8 #12506
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
nix/nixpkgs.nix
Outdated
version = "2.13.6"; | ||
name = "scala-2.13.6"; | ||
version = "2.13.8"; | ||
name = "scala-2.13.8"; | ||
src = pkgs.fetchurl { | ||
url = "https://www.scala-lang.org/files/archive/${name}.tgz"; | ||
sha256 = "0hzd6pljc8z5fwins5a05rwpx2w7wmlb6gb8973c676i7i895ps9"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my mistake, you need to update this.
If you change it to all zeroes and then try and run scala -version
, Nix will print out the correct value for you.
d246e58
to
a6e59d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
name: QualifiedName, | ||
tyVars: ImmArraySeq[Ast.TypeVarName], | ||
enum: Ast.DataEnum, | ||
`enum`: Ast.DataEnum, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid using back-tick.
`enum`: Ast.DataEnum, | |
enumeration: Ast.DataEnum, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will apply that across the board!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid using back-tick.
Can you also add an explanation to your request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add an explanation to your request?
Here are some of my motivations :
- Simplicity is almost always better. Why using this advance feature when a simple renaming makes the trick ?
- It is more difficult to type.
- it makes my life more complicate when I want to use regexp to search/refactor something
- intelliJ does not handle them faultless.
I prefer reserving backticks for two following usages :
- In pattern machine for matching constant.
- to "hide" implicits.
daml-script/export/src/main/scala/com/daml/script/export/Encode.scala
Outdated
Show resolved
Hide resolved
@@ -46,6 +46,7 @@ class MetricsCollector[T](exposedMetrics: Option[ExposedMetrics[T]], clock: Cloc | |||
import MetricsCollector.Message._ | |||
import MetricsCollector.Response._ | |||
|
|||
@scala.annotation.nowarn("msg=.*is unchecked since it is eliminated by erasure") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to fix it but I don't know yet how I can fix it correctly here without causing big cascades of changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed this one.
I'm fine with muting this warning. I'll probably need to revisit this piece of code.
7abefc6
to
7748ae6
Compare
daml-script/export/src/test/scala/com/daml/script/export/ActionsFromTreesSpec.scala
Outdated
Show resolved
Hide resolved
daml-script/export/src/test/scala/com/daml/script/export/EncodeInstancesSpec.scala
Outdated
Show resolved
Hide resolved
@@ -52,6 +52,7 @@ da_scala_library( | |||
scalacopts = [ | |||
"-Wconf:cat=unused-imports&site=com\\.daml\\.sample\\..*:s", | |||
"-Wconf:msg=parameter value ev.. in method ContractIdNT (Value)|(LfEncodable) is never used:s", | |||
"-Wconf:msg=Wrap `enum` in backticks to use it as an identifier:s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because the generated scala code contains enum
as variable name 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ @stefanobaghino-da you might want to fix that in the scala codegen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Stefano agrees to it I can take care of that too. However I wanted to keep the scope of this PR as much limited as possible so I would do it in a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ @stefanobaghino-da you might want to fix that in the scala codegen.
I'll add a ticket to track this, I don't think we should be working on this right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ledger/ledger-api-common/BUILD.bazel
Outdated
@@ -21,6 +21,9 @@ da_scala_library( | |||
"@maven//:io_spray_spray_json", | |||
"@maven//:org_scalaz_scalaz_core", | |||
], | |||
scalacopts = [ | |||
"-Wconf:msg=class DeduplicationTime in object DeduplicationPeriod is deprecated:s", # deprecated field that needs to be tested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we nowarn
this closer to the actual reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, prefer cat=deprecation
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That tweet seems wise. The author is clearly a brilliant individual.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Only request from my side is to rename export
to scriptExport
instead of exporting
.
@@ -21,35 +21,40 @@ import spray.json._ | |||
|
|||
private[export] object Encode { | |||
|
|||
def encodeArgs(export: Export): JsObject = { | |||
def encodeArgs(exporting: Export): JsObject = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call it scriptExport
instead? Seems a bit clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many thanks for the suggestion! Will apply that in an instant.
@@ -52,6 +52,7 @@ da_scala_library( | |||
scalacopts = [ | |||
"-Wconf:cat=unused-imports&site=com\\.daml\\.sample\\..*:s", | |||
"-Wconf:msg=parameter value ev.. in method ContractIdNT (Value)|(LfEncodable) is never used:s", | |||
"-Wconf:msg=Wrap `enum` in backticks to use it as an identifier:s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ @stefanobaghino-da you might want to fix that in the scala codegen.
@@ -46,6 +46,7 @@ class MetricsCollector[T](exposedMetrics: Option[ExposedMetrics[T]], clock: Cloc | |||
import MetricsCollector.Message._ | |||
import MetricsCollector.Response._ | |||
|
|||
@scala.annotation.nowarn("msg=.*is unchecked since it is eliminated by erasure") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has been open for 11 days now. Please either merge it or close it. |
already on my list, need to do a last rebase and then the CI should pass. |
61e3995
to
abb2ca8
Compare
we're slowly getting there, only Linux is left! Hopefully it succeeds this time! 😅 |
abb2ca8
to
6371430
Compare
/** We validate only using current time because we set the currentTime as submitTime so no need to check both | ||
*/ | ||
@scala.annotation.nowarn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import nowarn
, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary, especially if it's used only once. But as mentioned there's no need to to include scala
in the fully qualified name.
I think the code is fixed now; please merge/rebase |
6371430
to
aa200e7
Compare
/** We validate only using current time because we set the currentTime as submitTime so no need to check both | ||
*/ | ||
@nowarn( | ||
"msg=class DeduplicationTime in object DeduplicationPeriod is deprecated" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use cat=deprecation&origin=^com\.daml\.ledger\.api\.v1\.commands\.Commands\.DeduplicationPeriod\.DeduplicationTime$
in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I finally understand how that one works, thanks!
Yaaay finally merged, took long enough lol |
Not completely sure this is done correctly but lets see.
changelog_begin
changelog_end
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.