-
Notifications
You must be signed in to change notification settings - Fork 581
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
util/util-logging: Add Scala3 cross-build #295
Conversation
@@ -285,7 +285,7 @@ class FileHandlerTest extends AnyWordSpec with TempFolder { | |||
|
|||
val handler = FileHandler( | |||
filename = folderName + "/test.log", | |||
rollPolicy = Policy.MaxSize(maxSize.bytes), | |||
rollPolicy = Policy.MaxSize(maxSize.toLong.bytes), |
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 conversion is necessary in Scala3 because the extension method is only defined on Long
, and it no longer implicitly converts to Int
. In #290 I added an implicit conversion as forwarder but that's not landed in develop
yet.
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 strip out the forwarders into a separate 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.
I can make a PR based on what I've already added in #290 to keep source compatibility for Scala3
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.
The separate PR is here: #296
Codecov Report
@@ Coverage Diff @@
## develop #295 +/- ##
========================================
Coverage 52.62% 52.62%
========================================
Files 316 316
Lines 16864 16864
Branches 1035 1045 +10
========================================
Hits 8875 8875
Misses 7989 7989
Continue to review full report at Codecov.
|
Not sure why |
util-logging/src/main/scala/com/twitter/logging/FileHandler.scala
Outdated
Show resolved
Hide resolved
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.
looks great, thanks so much @felixbr!
This fixes lost source-compatibility for unit conversions from Int values in Scala3. As discussed in #295 I extracted/adapted this from #290 (previous discussion). Previously something like 1.toInt.second did compile in Scala2 (with default settings) but didn't in Scala3. I added forwarders for all units which use Long as base, as that seemed reasonable and safe. I didn't add an implicit conversion from Float to Double because floating-point types are dumb and I don't trust the conversion to be lossless in all cases. Signed-off-by: Yufan Gong <[email protected]> Differential Revision: https://phabricator.twitter.biz/D759923
7fc6905
to
23767e6
Compare
I rebased the PR onto I think the PR can now be merged, if you like. 🙂 |
Cross build util-logging with Scala 3. Util PR #295 Signed-off-by: Hamdi Allam <[email protected]> JIRA Issues: CSL-11409 Differential Revision: https://phabricator.twitter.biz/D764508
Merged! b8a30a7 |
This adds Scala3 cross-buliding for the module
util-logging
as discussed in #290