You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2024/01/03 21:35:17 UTC
[PR] fix ByteStringBuilder.addAll [incubator-pekko]
pjfanning opened a new pull request, #903:
URL: https://github.com/apache/incubator-pekko/pull/903
see #900
++= is an alias for addAll but super.++= incorrectly aliases the subclass addAll not the super.addAll.
My test in this PR reproduced the stackoverflow and started working after my code change to ByteStringBuilder
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1440989639
##########
actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala:
##########
Review Comment:
@pjfanning What about the scala-2.12/scala-3 version of `ByteString`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441048984
##########
actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala:
##########
Review Comment:
I think I've sorted out the scala variants now. As I said above, Scala 2.12 builder does not support addAll - so I haven't added support there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441098631
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
> It doesn't appear to handle `scala-2.13+` automatically.
Indeed sbt doesn't handle this automatically, it would be ideal find the existing code in the build definition that does this so we can reuse it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1440992387
##########
actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala:
##########
Review Comment:
I'm looking at those now. I had just noticed that the code varied by Scala version.
Scala 2.12 builder does not support addAll. Testing Scala 3.3 now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441080522
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
That code does not handle the '+' in `2.13+` - I don't want to duplicate the test that is in 2.13+. If I duplicated the test code intp `scala-3` and `scala-2.13` - sbt handles those source dirs automatically. It doesn't appear to handle `scala-2.13+` automatically.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441072906
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
This looks fishy, why are we doing this? Pekko has already been setup to handle all the different types of `scala-*` folders if we wan't to write tests for specific Scala versions and in cases like this I would prefer to KISS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441077984
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
https://github.com/apache/incubator-pekko/blob/7bee80e05847cd7a1198775b45f831f5ce3227f3/build.sbt#L132-L135 Is probably what you want then
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441193328
##########
actor-tests/src/test/scala-2.13+/org/apache/pekko/util/ByteStringBuilderSpec.scala:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pekko.util
+
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+class ByteStringBuilderSpec extends AnyWordSpec with Matchers {
+ "ByteStringBuilder" should {
+ "handle addAll" in {
Review Comment:
`handle linearseq of bytes with addAll` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441552628
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
I use IDEA and it is ignoring that file. If I search for strings, it ignores that file - won't even let me open the file to view it. I modified it with a text editor and `sbt ++2.13 "show actor-tests/Test/unmanagedSourceDirectories"` has the right results now. I have committed a change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441080522
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
That code does not handle the '+' in `2.13+` - I don't want to duplicate the test that is in 2.13+. If I duplicated the code in `scala-3` and `scala-2.13` - sbt handles those source dirs automatically. It doesn't appear to handle `scala-2.13+` automatically.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441074331
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
the tests in `scala-2.13+` did not execute without this change - they were ignored in scala 2.13 and scala 3 builds
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441074331
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
the tests in `scala-2.13+` did not execute without this change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441193328
##########
actor-tests/src/test/scala-2.13+/org/apache/pekko/util/ByteStringBuilderSpec.scala:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pekko.util
+
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+class ByteStringBuilderSpec extends AnyWordSpec with Matchers {
+ "ByteStringBuilder" should {
+ "handle addAll" in {
Review Comment:
`handle linerseq of bytes with addAll` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441193328
##########
actor-tests/src/test/scala-2.13+/org/apache/pekko/util/ByteStringBuilderSpec.scala:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pekko.util
+
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+class ByteStringBuilderSpec extends AnyWordSpec with Matchers {
+ "ByteStringBuilder" should {
+ "handle addAll" in {
Review Comment:
Can adds liner sequence of bytes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441070419
##########
actor/src/main/scala-2.13/org/apache/pekko/util/ByteString.scala:
##########
Review Comment:
Thanks, resolving
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441530711
##########
build.sbt:
##########
@@ -140,6 +140,14 @@ lazy val actor = pekkoModule("actor")
lazy val actorTests = pekkoModule("actor-tests")
.dependsOn(testkit % "compile->compile;test->test", actor)
.settings(Dependencies.actorTests)
+ .settings(Test / unmanagedSourceDirectories ++= {
Review Comment:
Ah I found it https://github.com/apache/incubator-pekko/blob/main/project/PekkoBuild.scala#L161-L168 . I think if you modify this so it also affects `Test / unmanagedSourceDirectories` then it should fix the same issue in a more principled way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix ByteStringBuilder.addAll [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #903:
URL: https://github.com/apache/incubator-pekko/pull/903#discussion_r1441544986
##########
actor-tests/src/test/scala-2.13+/org/apache/pekko/util/ByteStringBuilderSpec.scala:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pekko.util
+
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+class ByteStringBuilderSpec extends AnyWordSpec with Matchers {
+ "ByteStringBuilder" should {
+ "handle addAll" in {
Review Comment:
I updated the test names
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org