rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

Scala rules for Bazel

Results 199 rules_scala issues
Sort by recently updated
recently updated
newest added

WIP - Create rule for a `scala_service_provider`

[{"_id":"637f33c770db72139b0fb7c1","body":"\nThanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).\n\n:memo: **Please visit <https:\/\/cla.developers.google.com\/> to sign.**\n\nOnce you've signed (or fixed any issues), please reply here with `@googlebot I signed it!` and we'll verify it.\n\n----\n\n#### What to do if you already signed the CLA\n\n##### Individual signers\n\n* It's possible we don't have your GitHub username or you're using a different email address on your commit. Check [your existing CLA data](https:\/\/cla.developers.google.com\/clas) and verify that your [email is set on your git commits](https:\/\/help.github.com\/articles\/setting-your-email-in-git\/).\n\n##### Corporate signers\n\n* Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to [go\/cla#troubleshoot](http:\/\/go\/cla#troubleshoot) ([Public version](https:\/\/opensource.google\/docs\/cla\/#troubleshoot)).\n* The email used to register you as an authorized contributor must be the email used for the Git commit. Check [your existing CLA data](https:\/\/cla.developers.google.com\/clas) and verify that your [email is set on your git commits](https:\/\/help.github.com\/articles\/setting-your-email-in-git\/).\n* The email used to register you as an authorized contributor must also be [attached to your GitHub account](https:\/\/github.com\/settings\/emails).\n\t\t\n\n\u2139\ufe0f **Googlers: [Go here](https:\/\/goto.google.com\/prinfo\/https%3A%2F%2Fgithub.com%2Fbazelbuild%2Frules_scala%2Fpull%2F1063) for more info**.\n\n<!-- need_sender_cla -->","issue_id":1660222175855,"origin_id":652356313,"user_origin_id":5384588,"create_time":1593601959,"update_time":1593601959,"id":1669280711411,"updated_at":"2022-11-24T09:05:11.411000Z","created_at":"2022-11-24T09:05:11.411000Z"},{"_id":"637f33c770db72139b0fb7c2","body":"I signed the CLA. Commenting to see whether that retriggers the CLA bot.","issue_id":1660222175855,"origin_id":653012143,"user_origin_id":5790907,"create_time":1593697233,"update_time":1593697233,"id":1669280711415,"updated_at":"2022-11-24T09:05:11.415000Z","created_at":"2022-11-24T09:05:11.415000Z"},{"_id":"637f33c770db72139b0fb7c3","body":"I think you need to reply with @googlebot I signed it!","issue_id":1660222175855,"origin_id":653336285,"user_origin_id":1378327,"create_time":1593749849,"update_time":1593749849,"id":1669280711418,"updated_at":"2022-11-24T09:05:11.418000Z","created_at":"2022-11-24T09:05:11.418000Z"},{"_id":"637f33c770db72139b0fb7c4","body":"CLAs look good, thanks!\n\n\u2139\ufe0f **Googlers: [Go here](https:\/\/goto.google.com\/prinfo\/https%3A%2F%2Fgithub.com%2Fbazelbuild%2Frules_scala%2Fpull%2F1063) for more info**.\n\n<!-- ok -->","issue_id":1660222175855,"origin_id":653336299,"user_origin_id":5384588,"create_time":1593749852,"update_time":1593749852,"id":1669280711421,"updated_at":"2022-11-24T09:05:11.420000Z","created_at":"2022-11-24T09:05:11.420000Z"},{"_id":"637f33c770db72139b0fb7c5","body":"> Does it make sense to create a new target for a\r\n> scala_service_provider?\r\n\r\nGood question, I don't remember since it's been a while since I fiddled with this. I'll take a look and update. \r\n\r\n> Is it right to use the phases mechanism as I did to add a phase for\r\n> writing services to the output jar? Is there a more idiomatic way to\r\n> achieve low duplication between this new rule and scala_library?\r\n\r\nThat's a great question. TBH I'm not 100% sure because the phases architecture is rather young but I think this is exactly the way to do it. Idiomatic is a bit of a strong term given I feel this hasn't been established enough but I think this falls with what we're trying to advance. Btw, this could have also been achieved with a simple macro, right? Downside is that it would have created an additional jar with this file. Not exactly the same but probably will bring the same result. \r\n\r\n> Does the name: scala_service_provider sound good? It is in line with\r\n> the \"SPI\" terminology but may conflict with other concepts in the Bazel\r\n> world. Would scala_spi_plugin be more explicit\/suitable?\r\n\r\nI agree it's problematic. `scala_spi_plugin` also feels a bit conflicted with potential scala plugins etc.\r\n`scala_library_with_service_loader`? I don't like the `with` but this is what we have right?\r\n\r\n> Is there a better way to implement the test than a shell script under\r\n> shell? Maybe using the test_sh target and doing it in a build file?\r\n\r\nYes. Another (probably preferable) way is to write a scalatest (or specs2) test that depends on the target and just reads the file from the classpath and asserts its contents.\r\n\r\nI'm reviewing and will submit comments in a few days","issue_id":1660222175855,"origin_id":653415312,"user_origin_id":1378327,"create_time":1593763851,"update_time":1593763851,"id":1669280711423,"updated_at":"2022-11-24T09:05:11.423000Z","created_at":"2022-11-24T09:05:11.423000Z"},{"_id":"637f33c770db72139b0fb7c6","body":"and thanks for picking this up!","issue_id":1660222175855,"origin_id":653416586,"user_origin_id":1378327,"create_time":1593764030,"update_time":1593764030,"id":1669280711426,"updated_at":"2022-11-24T09:05:11.425000Z","created_at":"2022-11-24T09:05:11.425000Z"},{"_id":"637f33c770db72139b0fb7c7","body":"> > Does it make sense to create a new target for a\r\n> > scala_service_provider?\r\n> \r\n> Good question, I don't remember since it's been a while since I fiddled with this. I'll take a look and update.\r\n> \r\n> > Is it right to use the phases mechanism as I did to add a phase for\r\n> > writing services to the output jar? Is there a more idiomatic way to\r\n> > achieve low duplication between this new rule and scala_library?\r\n> \r\n> That's a great question. TBH I'm not 100% sure because the phases architecture is rather young but I think this is exactly the way to do it. Idiomatic is a bit of a strong term given I feel this hasn't been established enough but I think this falls with what we're trying to advance. Btw, this could have also been achieved with a simple macro, right? Downside is that it would have created an additional jar with this file. Not exactly the same but probably will bring the same result.\r\n> \r\n> > Does the name: scala_service_provider sound good? It is in line with\r\n> > the \"SPI\" terminology but may conflict with other concepts in the Bazel\r\n> > world. Would scala_spi_plugin be more explicit\/suitable?\r\n> \r\n> I agree it's problematic. `scala_spi_plugin` also feels a bit conflicted with potential scala plugins etc.\r\n> `scala_library_with_service_loader`? I don't like the `with` but this is what we have right?\r\n> \r\n> > Is there a better way to implement the test than a shell script under\r\n> > shell? Maybe using the test_sh target and doing it in a build file?\r\n> \r\n> Yes. Another (probably preferable) way is to write a scalatest (or specs2) test that depends on the target and just reads the file from the classpath and asserts its contents.\r\n> \r\n> I'm reviewing and will submit comments in a few days\r\n\r\nThanks a lot for the comments. \u2764\ufe0f I'll be looking at following this advice while you are doing the more general review. I really appreciate the time you took to write this up and the further time you plan to spend reviewing in the next few days.","issue_id":1660222175855,"origin_id":653464124,"user_origin_id":5790907,"create_time":1593770547,"update_time":1593770547,"id":1669280711428,"updated_at":"2022-11-24T09:05:11.428000Z","created_at":"2022-11-24T09:05:11.428000Z"},{"_id":"637f33c770db72139b0fb7c8","body":"Yeah, I think it's a bad case of wires crossed and rough surrounding conditions.\r\nI apologize and wish you good luck with the dive into the docs and existing phases.","issue_id":1660222175855,"origin_id":654256269,"user_origin_id":1378327,"create_time":1594043929,"update_time":1594043929,"id":1669280711431,"updated_at":"2022-11-24T09:05:11.431000Z","created_at":"2022-11-24T09:05:11.431000Z"},{"_id":"637f33c770db72139b0fb7c9","body":"> Yeah, I think it's a bad case of wires crossed and rough surrounding conditions.\r\n> I apologize and wish you good luck with the dive into the docs and existing phases.\r\n\r\nI appreciate it \u2764\ufe0f ","issue_id":1660222175855,"origin_id":654268578,"user_origin_id":5790907,"create_time":1594045205,"update_time":1594045205,"id":1669280711433,"updated_at":"2022-11-24T09:05:11.433000Z","created_at":"2022-11-24T09:05:11.433000Z"},{"_id":"637f33c770db72139b0fb7ca","body":"https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/1063\/commits\/c0ebcaf08560100a4b80da6e93e646576e1d4b83#r449739697\r\n\r\nSo thinking of it some more, it does feel like the \"phases + new rule\" approach is quite involved for what really should be a simple small change. I'm looking at doing a macro in our own codebase to save some complexity.\r\nWhen I get that approach to work, I'll comment here and in the issue to share what was done and discuss whether it is worth generalising or not.","issue_id":1660222175855,"origin_id":671428102,"user_origin_id":5790907,"create_time":1597073710,"update_time":1597136551,"id":1669280711436,"updated_at":"2022-11-24T09:05:11.435000Z","created_at":"2022-11-24T09:05:11.435000Z"},{"_id":"637f33c770db72139b0fb7cb","body":"\ud83d\udc4d\ud83c\udffd\n\nOn Mon, 10 Aug 2020 at 18:35 Pierre Chevalier <[email protected]>\nwrote:\n\n> c0ebcaf#r449739697\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/commit\/c0ebcaf08560100a4b80da6e93e646576e1d4b83#r449739697>\n>\n> So thinking of it some more, it does feel like the \"phases + new rule\"\n> approach is quite involved for what really should be a simple small change.\n> I'm looking at doing a macro in our own codebase to save some complexity.\n> When I get that approach to work, I'll comment here and in the ticket to\n> share what was done and discuss whether it is worth generalising or not.\n>\n> \u2014\n> You are receiving this because your review was requested.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/1063#issuecomment-671428102>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AAKQQF5BVS2SNNZEZWZ4TL3SAAHT3ANCNFSM4ONJX3QQ>\n> .\n>\n-- \n\n\n*Ittai Zeidman*\n\n\n\n40 Hanamal street, Tel Aviv, Israel\n\n\n\n<http:\/\/www.wix.com>\n","issue_id":1660222175855,"origin_id":672229989,"user_origin_id":1378327,"create_time":1597174933,"update_time":1597174933,"id":1669280711438,"updated_at":"2022-11-24T09:05:11.438000Z","created_at":"2022-11-24T09:05:11.438000Z"},{"_id":"662865cf23eede2dcf0746b3","body":"closing as stale, feel free to reopen","issue_id":1660222175855,"origin_id":1919295278,"user_origin_id":1623634,"create_time":1706713687,"update_time":1706713687,"id":1713923535242,"updated_at":"2024-04-24T01:52:15.241000Z","created_at":"2024-04-24T01:52:15.241000Z"}] comment

### Description A `scala_service_provider` is like a `scala_library`, excepts it exports a list of implementations for a number of services in its output jar. Use the phases mechanism to wrap...

cla: yes

FileAlreadyExistsException during proto compilation

[{"_id":"637f23e94b97542c9a2f0825","body":"I have a quick fix for that problem, but I'm not 100% sure if it's a valid fix, because it basically fights against symptoms, not the root cause. But it works for me though:\r\n\r\n```patch\r\nIndex: src\/scala\/scripts\/ScalaPBGenerator.scala\r\nIDEA additional info:\r\nSubsystem: com.intellij.openapi.diff.impl.patch.CharsetEP\r\n<+>UTF-8\r\n===================================================================\r\n--- src\/scala\/scripts\/ScalaPBGenerator.scala\t(revision 8092d5f6165a8d9c4797d5f089c1ba4eee3326b1)\r\n+++ src\/scala\/scripts\/ScalaPBGenerator.scala\t(date 1562061165000)\r\n@@ -1,7 +1,7 @@\r\n package scripts\r\n \r\n import java.io.PrintStream\r\n-import java.nio.file.Path\r\n+import java.nio.file.{Path, FileAlreadyExistsException}\r\n \r\n import io.bazel.rulesscala.io_utils.DeleteRecursively\r\n import io.bazel.rulesscala.jar.JarCreator\r\n@@ -12,6 +12,7 @@\r\n import java.nio.file.{Files, Paths}\r\n import scalapb.{ScalaPBC, ScalaPbCodeGenerator, ScalaPbcException}\r\n import java.net.URLClassLoader\r\n+import scala.util.{Try, Failure}\r\n \r\n object ScalaPBWorker extends GenericWorker(new ScalaPBGenerator) {\r\n \r\n@@ -39,7 +40,13 @@\r\n val relativePath = root.relativize(fullPath)\r\n \r\n relativePath.toFile.getParentFile.mkdirs\r\n- Files.copy(fullPath, relativePath)\r\n+ Try(Files.copy(fullPath, relativePath)) match {\r\n+ case Failure(err) if err.isInstanceOf[FileAlreadyExistsException] =>\r\n+ Console.println(s\"File already exists, skipping: ${err.getMessage}\")\r\n+ case Failure(err) =>\r\n+ sys.error(err.getMessage)\r\n+ case _ => ()\r\n+ }\r\n }\r\n }\r\n def deleteDir(path: Path): Unit =\r\n```\r\n","issue_id":1660222175857,"origin_id":507608794,"user_origin_id":2879049,"create_time":1562061634,"update_time":1562061723,"id":1669276649205,"updated_at":"2022-11-24T07:57:29.204000Z","created_at":"2022-11-24T07:57:29.204000Z"},{"_id":"637f23e94b97542c9a2f0826","body":"Do you possibly have duplicate classes or protos in different targets somehow?","issue_id":1660222175857,"origin_id":507747002,"user_origin_id":67958,"create_time":1562084273,"update_time":1562084273,"id":1669276649209,"updated_at":"2022-11-24T07:57:29.208000Z","created_at":"2022-11-24T07:57:29.208000Z"},{"_id":"637f23e94b97542c9a2f0827","body":"No, only `timestamp` and `wrappers` which are shared between two independent protos:\r\n\r\n```python\r\nproto_library(\r\n name = \"A\",\r\n srcs = [ \"event\/A.proto\" ],\r\n deps = [\r\n \"@com_google_protobuf\/\/:wrappers_proto\",\r\n \"@com_google_protobuf\/\/:timestamp_proto\",\r\n ],\r\n)\r\n\r\nproto_library(\r\n name = \"B\",\r\n srcs = [ \"event\/B.proto\" ],\r\n deps = [\r\n \"@com_google_protobuf\/\/:timestamp_proto\",\r\n \"@com_google_protobuf\/\/:wrappers_proto\",\r\n ],\r\n)\r\n\r\nproto_library(\r\n name = \"service_events_proto\",\r\n visibility = [ \"\/\/visibility:public\" ],\r\n srcs = [ \"event\/ServiceEvent.proto\" ],\r\n deps = [\r\n \":A\",\r\n \":B\",\r\n ],\r\n)\r\n\r\nscalapb_proto_library(\r\n name = \"service_events_scala_proto\",\r\n visibility = [\"\/\/visibility:public\"],\r\n deps = [ \":service_events_proto\" ],\r\n)\r\n\r\n```","issue_id":1660222175857,"origin_id":507755512,"user_origin_id":2879049,"create_time":1562085675,"update_time":1562085675,"id":1669276649211,"updated_at":"2022-11-24T07:57:29.211000Z","created_at":"2022-11-24T07:57:29.211000Z"},{"_id":"637f23e94b97542c9a2f0828","body":"Sorry for pushing you guys, but is there any thoughts or updates on it? \r\n\r\nNow we have to use [forked version](https:\/\/github.com\/sholokhov\/rules_scala) of this rules with quick fix for the problem, but I would prefer to depend on official rules rather than supporting forked version.","issue_id":1660222175857,"origin_id":511742294,"user_origin_id":2879049,"create_time":1563269636,"update_time":1563269636,"id":1669276649214,"updated_at":"2022-11-24T07:57:29.213000Z","created_at":"2022-11-24T07:57:29.213000Z"},{"_id":"637f23e94b97542c9a2f0829","body":"Could you make a PR with a test that fails? That would be very helpful if we are going to fix it. Thank you for your help!\r\n\r\nCc @ianoc ","issue_id":1660222175857,"origin_id":511888456,"user_origin_id":67958,"create_time":1563294303,"update_time":1563294303,"id":1669276649216,"updated_at":"2022-11-24T07:57:29.216000Z","created_at":"2022-11-24T07:57:29.216000Z"},{"_id":"637f23e94b97542c9a2f082a","body":"I tried quickly to repo this and couldn't, so would love a PR showing the issue","issue_id":1660222175857,"origin_id":511904063,"user_origin_id":446652,"create_time":1563296925,"update_time":1563296925,"id":1669276649218,"updated_at":"2022-11-24T07:57:29.218000Z","created_at":"2022-11-24T07:57:29.218000Z"},{"_id":"637f23e94b97542c9a2f082b","body":"After upgrading from bazel 0.26 to 0.27 this issue started to happen very frequently on our repo","issue_id":1660222175857,"origin_id":512007615,"user_origin_id":40143,"create_time":1563315100,"update_time":1563315100,"id":1669276649222,"updated_at":"2022-11-24T07:57:29.222000Z","created_at":"2022-11-24T07:57:29.222000Z"},{"_id":"637f23e94b97542c9a2f082c","body":"I've prepared small example which reproduces this issue: https:\/\/github.com\/sholokhov\/bazel-rules-scala-issue\r\n\r\nJust try to build everything from scratch (`bazel build \/\/...`) and it fails with `FileAlreadyExistsException`.","issue_id":1660222175857,"origin_id":512148055,"user_origin_id":2879049,"create_time":1563350542,"update_time":1563350542,"id":1669276649225,"updated_at":"2022-11-24T07:57:29.225000Z","created_at":"2022-11-24T07:57:29.225000Z"},{"_id":"637f23e94b97542c9a2f082d","body":"Thanks for the repo case @sholokhov, its quite interesting -- so this was something related to a bazel change in 0.27, i tried 0.27 and it fails, pretty handily. But 0.26 (clean expunge + build) in 2 cycle attempts didn't fail. (Not very scientific, overall, but rebuilding proto takes a few mins so its not so much fun)\r\n\r\nQuestion here will be seeing if the approach in the code is actually still safe now or if the virtual imports in 0.28(edit -- actually looks like this change is on master but not in 0.28) maybe make this no longer required at all. https:\/\/github.com\/bazelbuild\/bazel\/issues\/7157","issue_id":1660222175857,"origin_id":512376732,"user_origin_id":446652,"create_time":1563382847,"update_time":1563382882,"id":1669276649227,"updated_at":"2022-11-24T07:57:29.227000Z","created_at":"2022-11-24T07:57:29.227000Z"},{"_id":"637f23e94b97542c9a2f082e","body":"It sounds like maybe actions here:\r\n1) try see if the change on bazel master would make this go away\r\n a) if so we should put a fix in until that release comes out, but that might be testing to see if target file exists, if it does asserting the contents are identical? , also removing any files added when we are done\r\n2) If it doesn't, maybe look closer to see if this is safe going forward. (concern is really if the changes around symlinks could mean its possible to write to the external shared folder and not some scratch space?)","issue_id":1660222175857,"origin_id":512384613,"user_origin_id":446652,"create_time":1563383050,"update_time":1563383050,"id":1669276649230,"updated_at":"2022-11-24T07:57:29.229000Z","created_at":"2022-11-24T07:57:29.229000Z"},{"_id":"637f23e94b97542c9a2f082f","body":"@ianoc yay! Thanks for the breakdown. Is that something you're going to work on?","issue_id":1660222175857,"origin_id":512454075,"user_origin_id":40143,"create_time":1563384798,"update_time":1563384798,"id":1669276649232,"updated_at":"2022-11-24T07:57:29.231000Z","created_at":"2022-11-24T07:57:29.231000Z"},{"_id":"637f23e94b97542c9a2f0830","body":"At some point i will, have a lot on this week and @sholokhov has a workaround that sounds like it'll survive for another few days anyway. ","issue_id":1660222175857,"origin_id":512496649,"user_origin_id":446652,"create_time":1563385880,"update_time":1563385880,"id":1669276649234,"updated_at":"2022-11-24T07:57:29.234000Z","created_at":"2022-11-24T07:57:29.234000Z"},{"_id":"637f23e94b97542c9a2f0831","body":"@ianoc ok, thank you! I'll switch our repo to point to his fork so I can get our bazel upgrade in then. Does that sound reasonable?","issue_id":1660222175857,"origin_id":512499664,"user_origin_id":40143,"create_time":1563385958,"update_time":1563385958,"id":1669276649236,"updated_at":"2022-11-24T07:57:29.236000Z","created_at":"2022-11-24T07:57:29.236000Z"},{"_id":"637f23e94b97542c9a2f0832","body":"@ptarjan thats really an internal stripe discussion, but i don't believe generally speaking we'd want our main repos pointing to forks on the internet. ","issue_id":1660222175857,"origin_id":512504610,"user_origin_id":446652,"create_time":1563386576,"update_time":1563386576,"id":1669276649239,"updated_at":"2022-11-24T07:57:29.238000Z","created_at":"2022-11-24T07:57:29.238000Z"},{"_id":"637f23e94b97542c9a2f0833","body":"so, @sholokhov posted a work around:\r\n\r\nhttps:\/\/github.com\/bazelbuild\/rules_scala\/issues\/779#issuecomment-507608794\r\n\r\n@ptarjan can you make a PR with that diff and we can merge as a workaround and keep this issue open to root cause it?","issue_id":1660222175857,"origin_id":512505139,"user_origin_id":67958,"create_time":1563386668,"update_time":1563386668,"id":1669276649241,"updated_at":"2022-11-24T07:57:29.241000Z","created_at":"2022-11-24T07:57:29.241000Z"},{"_id":"637f23e94b97542c9a2f0834","body":"Thanks @johnynek. Done here: https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/787","issue_id":1660222175857,"origin_id":512507984,"user_origin_id":40143,"create_time":1563387155,"update_time":1563387155,"id":1669276649243,"updated_at":"2022-11-24T07:57:29.243000Z","created_at":"2022-11-24T07:57:29.243000Z"},{"_id":"637f23e94b97542c9a2f0835","body":"Thanks @ptarjan ! Also @sholokhov can you tell the bot on the PR that you don't mind us pulling this in?","issue_id":1660222175857,"origin_id":512510933,"user_origin_id":67958,"create_time":1563387629,"update_time":1563387629,"id":1669276649245,"updated_at":"2022-11-24T07:57:29.245000Z","created_at":"2022-11-24T07:57:29.245000Z"},{"_id":"637f23e94b97542c9a2f0836","body":"It's interesting that this fix seemed to still result in a similar error on windows:\r\n\r\nhttps:\/\/travis-ci.org\/bazelbuild\/rules_scala\/jobs\/560109357#L310\r\n\r\n```\r\nERROR: C:\/users\/travis\/_bazel_travis\/xsbyteln\/external\/com_google_protobuf\/BUILD:284:2: Generating Descriptor Set proto_library @com_google_protobuf\/\/:wrappers_proto failed (Exit 1): protoc.exe failed: error executing command \r\n cd C:\/users\/travis\/_bazel_travis\/xsbyteln\/execroot\/io_bazel_rules_scala\r\n SET PATH=C:\\program files\\git\\usr\\bin;C:\\program files\\git\\bin;C:\\program files\\git\\usr\\bin;C:\\program files\\git\\usr\\bin;C:\\tools\\ruby25\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\ProgramData\\GooGet;C:\\Program Files\\Google\\Compute Engine\\metadata_scripts;C:\\Program Files (x86)\\Google\\Cloud SDK\\google-cloud-sdk\\bin;C:\\Program Files\\Google\\Compute Engine\\sysprep;C:\\Program Files\\Docker;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\LLVM\\bin;C:\\Program Files\\dotnet;C:\\Users\\travis\\AppData\\Local\\Microsoft\\WindowsApps;C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin\r\n bazel-out\/host\/bin\/external\/com_google_protobuf\/protoc.exe --proto_path=external\/com_google_protobuf --descriptor_set_out=bazel-out\/x64_windows-fastbuild\/genfiles\/external\/com_google_protobuf\/wrappers_proto-descriptor-set.proto.bin -Igoogle\/protobuf\/wrappers.proto=bazel-out\/x64_windows-fastbuild\/genfiles\/external\/com_google_protobuf\/google\/protobuf\/wrappers.proto --direct_dependencies google\/protobuf\/wrappers.proto --direct_dependencies_violation_msg=%s is imported, but @com_google_protobuf\/\/:wrappers_proto doesn't directly depend on a proto_library that 'srcs' it. bazel-out\/x64_windows-fastbuild\/genfiles\/external\/com_google_protobuf\/google\/protobuf\/wrappers.proto\r\nExecution platform: @bazel_tools\/\/platforms:host_platform\r\nbazel-out\/x64_windows-fastbuild\/genfiles\/external\/com_google_protobuf\/google\/protobuf\/wrappers.proto: Input is shadowed in the --proto_path by \"external\/com_google_protobuf\/google\/protobuf\/wrappers.proto\". Either use the latter file as your input or reorder the --proto_path so that the former file's location comes first.\r\n```\r\n\r\nso, there is some definite duplication somewhere.","issue_id":1660222175857,"origin_id":512524807,"user_origin_id":67958,"create_time":1563389893,"update_time":1563389893,"id":1669276649248,"updated_at":"2022-11-24T07:57:29.247000Z","created_at":"2022-11-24T07:57:29.247000Z"},{"_id":"637f23e94b97542c9a2f0837","body":"We experiencing a variation of this on all our Windows machine (it runs just fine on MacOS\/Linux). It's happens on a specific project, and this specific project is unique because it's the only project that use the `strip_import_prefix`option in `proto_library`. Here's the stack-trace:\r\n\r\n```\r\nERROR: D:\/projects\/depo\/legacy\/kit\/protobuf\/BUILD:78:1: scala \/\/legacy\/kit\/protobuf:pill_scala failed (Exit 1)\r\njava.nio.file.FileAlreadyExistsException: \\kit\\protobuf\\pill.proto\r\n at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:124)\r\n at sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)\r\n at java.nio.file.Files.copy(Files.java:1274)\r\n at io.bazel.rulesscala.scalac.ScalacProcessor.copyResources(ScalacProcessor.java:309)\r\n at io.bazel.rulesscala.scalac.ScalacProcessor.processRequest(ScalacProcessor.java:73)\r\n at io.bazel.rulesscala.worker.GenericWorker.runPersistentWorker(GenericWorker.java:45)\r\n at io.bazel.rulesscala.worker.GenericWorker.run(GenericWorker.java:111)\r\n at io.bazel.rulesscala.scalac.ScalaCInvoker.main(ScalaCInvoker.java:41)\r\nINFO: Elapsed time: 1542.308s, Critical Path: 146.22s\r\nINFO: 395 processes: 389 local, 6 worker.\r\nFAILED: Build did NOT complete successfully\r\nFAILED: Build did NOT complete successfully\r\n```\r\n\r\nI tried to check for the workaround mentioned above - catching the `FileAlreadyExistsException` and handling it, but I couldn't find it. Was it removed deliberately? Or perhaps that's not a variation but a new bug?","issue_id":1660222175857,"origin_id":632114470,"user_origin_id":494883,"create_time":1590070965,"update_time":1590070965,"id":1669276649251,"updated_at":"2022-11-24T07:57:29.250000Z","created_at":"2022-11-24T07:57:29.250000Z"},{"_id":"637f23e94b97542c9a2f0838","body":"I don\u2019t know and honestly our windows support is not awesome since we don\u2019t run our CI builds with it.\nWe don\u2019t run our CI builds with it because there\u2019s no one to own the windows problems (we had windows CI for 6 months maybe and the flakiness and issues killed our velocity).\n\nCan you take a look at git history to see when the workaround was removed? Was it intentional or by mistake?\n\nCc @simuons as someone who I think touched this area","issue_id":1660222175857,"origin_id":632841808,"user_origin_id":1378327,"create_time":1590172149,"update_time":1590172149,"id":1669276649254,"updated_at":"2022-11-24T07:57:29.253000Z","created_at":"2022-11-24T07:57:29.253000Z"},{"_id":"637f23e94b97542c9a2f0839","body":"The file no longer exists. I'm assuming it happened during the phases refactor. If you are find with the old workaround, I can try to find the new spot where this happens, and solve it the same way I was solved previously - by catching the Exception and continue if the file is already there.\r\n\r\nBut let's wait to hear @simuons opinion.","issue_id":1660222175857,"origin_id":633229510,"user_origin_id":494883,"create_time":1590326192,"update_time":1590326211,"id":1669276649257,"updated_at":"2022-11-24T07:57:29.257000Z","created_at":"2022-11-24T07:57:29.257000Z"},{"_id":"637f23e94b97542c9a2f083a","body":"I think so but I\u2019d really appreciate it if you could find the exact point\nwhere it was removed. I\u2019d love to see if indeed it was an oversight and\nmaybe ping whoever did it\n\nOn Sun, 24 May 2020 at 16:16 Amit Zarfati <[email protected]> wrote:\n\n> The file no longer exists. I'm assuming it happened during the phases\n> refactor. If you are find with the old workaround, I can try to find the\n> new spot where this happens, and solve it the same way I was solved\n> previously - by catching the Exception and continue if the file is already\n> there.\n>\n> \u2014\n> You are receiving this because you commented.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/issues\/779#issuecomment-633229510>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AAKQQFYJMFS32GKQO7ANMU3RTEM3ZANCNFSM4H4TGEQA>\n> .\n>\n-- \n\n\n*Ittai Zeidman*\n\n\n\n40 Hanamal street, Tel Aviv, Israel\n\n\n\n<http:\/\/www.wix.com>\n","issue_id":1660222175857,"origin_id":633265703,"user_origin_id":1378327,"create_time":1590342190,"update_time":1590342190,"id":1669276649260,"updated_at":"2022-11-24T07:57:29.259000Z","created_at":"2022-11-24T07:57:29.259000Z"},{"_id":"637f23e94b97542c9a2f083b","body":"Sure. [Here](https:\/\/github.com\/bazelbuild\/rules_scala\/commit\/548bce937978530394be2b118cfd983194b94632#diff-a5d868bf47a1ca0e7449cfc151f2cc05L37) you go. It's completely possible that while It's the same error, it's not the same bug - and another place might need that exception handling. ","issue_id":1660222175857,"origin_id":633407744,"user_origin_id":494883,"create_time":1590389172,"update_time":1590389172,"id":1669276649262,"updated_at":"2022-11-24T07:57:29.262000Z","created_at":"2022-11-24T07:57:29.262000Z"},{"_id":"637f23e94b97542c9a2f083c","body":"Ok.\nI\u2019m ok with the old workaround but the thing I\u2019d like is a test.\nThis regression happened because no test told the OP of #850 that they need\nto keep the workaround.\nDo you think you can build such a test? I\u2019ll probably accept a fix without\na test but I\u2019d be much more concerned about it\n\nOn Mon, 25 May 2020 at 9:46 Amit Zarfati <[email protected]> wrote:\n\n> Sure. Here\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/commit\/548bce937978530394be2b118cfd983194b94632#diff-a5d868bf47a1ca0e7449cfc151f2cc05L37>\n> you go. It's completely possible that while It's the same error, it's not\n> the same bug - and another place might need that exception handling.\n>\n> \u2014\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/issues\/779#issuecomment-633407744>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AAKQQF7MFMV4CDICH2EA6ILRTIH4LANCNFSM4H4TGEQA>\n> .\n>\n-- \n\n\n*Ittai Zeidman*\n\n\n\n40 Hanamal street, Tel Aviv, Israel\n\n\n\n<http:\/\/www.wix.com>\n","issue_id":1660222175857,"origin_id":633814021,"user_origin_id":1378327,"create_time":1590470738,"update_time":1590470738,"id":1669276649265,"updated_at":"2022-11-24T07:57:29.264000Z","created_at":"2022-11-24T07:57:29.264000Z"},{"_id":"637f23e94b97542c9a2f083d","body":"It seems like the origin of the problem was never found. So the work-around was there to bypass it. If we want a test to verify it, we need to understand what's the problem is really is, (and a Windows setup for CI). We also need to find a way to always reproduce it (right now it happens around 80% of the times).\r\n\r\nI will ask one of the Windows user here to try figure out why we get this exception to start with. \r\n\r\nUnless you meant a Unit-test in Scala for this specific method?\r\n\r\n","issue_id":1660222175857,"origin_id":633818768,"user_origin_id":494883,"create_time":1590471843,"update_time":1590471843,"id":1669276649267,"updated_at":"2022-11-24T07:57:29.267000Z","created_at":"2022-11-24T07:57:29.267000Z"},{"_id":"637f23e94b97542c9a2f083e","body":"The best is indeed a Windows CI (we can have it with one specific test for the time being) and E2E.\nIf your windows user can find the root cause that would be really beneficial.\n\nIf you invest significant time and come up empty I think a unit test in scala would at least help us know we\u2019ve messed it up.","issue_id":1660222175857,"origin_id":633819800,"user_origin_id":1378327,"create_time":1590472071,"update_time":1590472071,"id":1669276649269,"updated_at":"2022-11-24T07:57:29.269000Z","created_at":"2022-11-24T07:57:29.269000Z"},{"_id":"637f23e94b97542c9a2f083f","body":"Sounds good. I'll ask the a Window user to spend some time researching it and will update when I have a better understanding of what's up. ","issue_id":1660222175857,"origin_id":633824845,"user_origin_id":494883,"create_time":1590473120,"update_time":1590473120,"id":1669276649272,"updated_at":"2022-11-24T07:57:29.271000Z","created_at":"2022-11-24T07:57:29.271000Z"},{"_id":"637f23e94b97542c9a2f0840","body":"This issue isn't related to the other protobuf one I believe -- the last change on the protobuf thing removed the call to copy. So all of that code is gone. The call stack here is quite different.\r\n\r\nThis looks related I think to https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/949 , the proto resources are not unique I'd say in their paths which causes scalac to barf.","issue_id":1660222175857,"origin_id":634402440,"user_origin_id":446652,"create_time":1590549365,"update_time":1590549372,"id":1669276649274,"updated_at":"2022-11-24T07:57:29.273000Z","created_at":"2022-11-24T07:57:29.273000Z"},{"_id":"637f23e94b97542c9a2f0841","body":"But wouldn't that happen in all system and not just Windows?","issue_id":1660222175857,"origin_id":636442810,"user_origin_id":494883,"create_time":1590915715,"update_time":1590915715,"id":1669276649276,"updated_at":"2022-11-24T07:57:29.276000Z","created_at":"2022-11-24T07:57:29.276000Z"},{"_id":"637f23e94b97542c9a2f0842","body":"I agree with @ianoc it's related to https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/949 though it's interesting why proto paths are not unique and we see this only in windows.\r\n@amitz could you share a test-case\/setup for `proto_library`\/`scala_proto_library` which reproduces the issue so I could investigate.\r\n@ittaiz I think we could do two things to unblock windows users:\r\n1. Change `Files.copy(source, target);` to `Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING);` in `ScalacWorker#copyResources`\r\n2. Revert proto bundling to generates sources jar","issue_id":1660222175857,"origin_id":636673176,"user_origin_id":1047879,"create_time":1590997592,"update_time":1590997592,"id":1669276649278,"updated_at":"2022-11-24T07:57:29.278000Z","created_at":"2022-11-24T07:57:29.278000Z"}] comment

Hello! I've tried to use latest `rules_scala` version (`8092d5f6165a8d9c4797d5f089c1ba4eee3326b1`) and faced an interesting problem: during proto compilation of independent rules bazel if both are depending on some common protobuf (like...

Copying from https://github.com/bazelbuild/rules_python/pull/334 by @alexeagle > _See [building-a-strong-community/using-templates-to-encourage-useful-issues-and-pull-requests](https://docs.github.com/en/github/building-a-strong-community/using-templates-to-encourage-useful-issues-and-pull-requests)_ > > _This will ask users filing an issue to indicate if it's a bug or a feature request and prompt them...

Tracking issue- move from deps to toolchains

[{"_id":"637f2c484b97542c9a2f11d3","body":"FYI, more than anything:\r\n\r\nWe're looking at what it will take to be able to compile with multiple versions of scala in the same build. We only need to support different major versions, we don't see the need to support different minor versions.\r\n\r\nWe need to be able to build the same (for some definition of \"same\") library\/binary against different versions of scala and also different versions of dependencies. Doing something like external templating of `WORKSPACE` and\/or `BUILD` files is a very last resort for us.\r\n\r\nWe end up defining `BUILD\/.bzl` pairs where targets are defined in macros that take an environment parameter and create targets for that environment. We then call that macro once for each environment. We implement this a bit like scala does with version suffixes. This lets us build the \"same\" target e.g., `\/\/package\/:some_library_{env}` for different runtime environment (i.e., classpaths) where we don't have control over all the dependences.\r\n\r\nThe macros handle all the muck around scala version suffixes and also clean up some of the junk that we, along with @johnynek, found annoying with `rules_jvm_external`. We write deps that look like\r\n```\r\n \"@{environment}\/\/com.fasterxml.jackson.module:jackson-module-scala_{scala}\",\r\n```\r\nand use macro code to do the conversion to labels. We do find the pinning\/version resolution in `rules_jvm_external`\/`coursier ` really important.\r\n\r\nThe last step for this effort is supporting multiple scala compiler\/runtime versions in the same build. Working on that now ... though I'm only now getting familiar with toolchains so it's early. I'd like to do this part \"right\" but not sure I know enough to get it right (and for our use, we don't necessarily need this to be \"right\" as long as we don't have to make incompatible changes with `master`: \"right\" would be nice but not sure the effort levels.)","issue_id":1660222175861,"origin_id":575960314,"user_origin_id":4292,"create_time":1579401985,"update_time":1579458640,"id":1669278792936,"updated_at":"2022-11-24T08:33:12.936000Z","created_at":"2022-11-24T08:33:12.936000Z"},{"_id":"637f2c484b97542c9a2f11d4","body":"I understand.\r\nI should say that this is not the main motivation for our move and so I don't want rules_scala to codify a pattern of solving this when Bazel are lined up to solving it in a clear way in the next months (definitely in 2020).\r\nHaving said that it seems that if you're willing to live with two different bazel invocations (one per version) then you might already have this ability right now with toolchains.\r\nHave you tried it on a vanilla target without all of the above mentioned toolchain gaps?","issue_id":1660222175861,"origin_id":575982735,"user_origin_id":1378327,"create_time":1579424857,"update_time":1579424857,"id":1669278792940,"updated_at":"2022-11-24T08:33:12.940000Z","created_at":"2022-11-24T08:33:12.940000Z"},{"_id":"637f2c484b97542c9a2f11d5","body":"Understood.\r\n\r\nThanks for the comment: I haven't kept up with what the bazel folks have been working on. \r\nhttps:\/\/bazel.build\/roadmaps\/configuration.html and more precisely\r\nhttps:\/\/github.com\/bazelbuild\/bazel\/issues\/6519?\r\n\r\nHelps to know that other folks are looking for the right pattern: makes it a bit easier to live with something a bit more hack-ish knowing there's a better solution coming up that we should be able to move to when it lands.\r\n\r\n> Having said that it seems that if you're willing to live with two different bazel invocations (one per version) then you might already have this ability right now with toolchains.\r\n\r\nI looked at this but didn't find a solution ... but there are a lot of different ways to approach this so I'm not at all confident I considered the right alternatives.\r\n\r\nThe blocker for us for multiple invocations has been using different versions of deps for different platforms. Since platform is not available until analysis, it appears we would have to go way deeper into rule implementation and I'm not sure I'm particularly competent there. The macro approach (`for environment in environments.items(): scala_library(...)`) feels like a hack but so far has been handling things \"okay\". I'll spend some time on the roadmap to see what others are doing (feature flags, etc.)\r\n\r\nNot sure there's anything actionable at this point for others (but happy for input). If things go well, I'll put up an example of what we've done and see what others think\/use as a place for folks to share thoughts. Maybe folks at that point can point me in a better direction and I can iterate from there.\r\n\r\nDefinitely looking to collaborate with others that are facing the similar issues ...","issue_id":1660222175861,"origin_id":576034447,"user_origin_id":4292,"create_time":1579459896,"update_time":1579459896,"id":1669278792943,"updated_at":"2022-11-24T08:33:12.943000Z","created_at":"2022-11-24T08:33:12.943000Z"},{"_id":"637f2c484b97542c9a2f11d6","body":"I asked on bazel slack about this and got a few [pointers](https:\/\/bazelbuild.slack.com\/archives\/CDCEKVCHY\/p1579424747002800) namely\r\nConfiguration transitions and configuration flags.\r\nI also think that indeed cracking the repository rule and scala version is a hard nut as you can see from our discussions on #544 ","issue_id":1660222175861,"origin_id":576110748,"user_origin_id":1378327,"create_time":1579497572,"update_time":1579497572,"id":1669278792946,"updated_at":"2022-11-24T08:33:12.945000Z","created_at":"2022-11-24T08:33:12.945000Z"},{"_id":"637f2c484b97542c9a2f11d7","body":"See also https:\/\/github.com\/bazelbuild\/bazel\/issues\/7572","issue_id":1660222175861,"origin_id":576361861,"user_origin_id":4292,"create_time":1579539956,"update_time":1579539956,"id":1669278792949,"updated_at":"2022-11-24T08:33:12.948000Z","created_at":"2022-11-24T08:33:12.948000Z"},{"_id":"637f2c484b97542c9a2f11d8","body":"I actually made progress on this. I wasn't sure I was going to be able to but it's actually come out fairly well (at least enough that I can live with it.)\r\n\r\nExample: https:\/\/github.com\/smparkes\/multi-scala-example\r\n\r\nI'll put more comments in the [PR](https:\/\/github.com\/smparkes\/rules_scala\/pull\/1). This is only a PR within my [fork](https:\/\/github.com\/smparkes\/rules_scala\/tree\/smparkes\/multi-scala): if there's interest in pursuing it, I can switch the PR to here and we can chat there.","issue_id":1660222175861,"origin_id":577464264,"user_origin_id":4292,"create_time":1579742976,"update_time":1579742976,"id":1669278792951,"updated_at":"2022-11-24T08:33:12.951000Z","created_at":"2022-11-24T08:33:12.951000Z"},{"_id":"637f2c484b97542c9a2f11da","body":"@smparkes does this allow having multiple minor versions as well (e.g. using both 2.12.0 and 2.12.5 simultaneously)?","issue_id":1660222175861,"origin_id":578941821,"user_origin_id":18406486,"create_time":1580157577,"update_time":1580157577,"id":1669278792956,"updated_at":"2022-11-24T08:33:12.955000Z","created_at":"2022-11-24T08:33:12.955000Z"},{"_id":"637f2c484b97542c9a2f11db","body":"I hadn't planned on that. It's not a need for us.\r\n\r\nIt would be a moderately simple extension. It would require suffixing everything with the complete version,e.g., `my_library_2_12_5` which is non-standard and a bit intrusive to others. That might be mitigatable with automatically created aliases.\r\n\r\nSee #962.","issue_id":1660222175861,"origin_id":578977847,"user_origin_id":4292,"create_time":1580162827,"update_time":1580162827,"id":1669278792958,"updated_at":"2022-11-24T08:33:12.958000Z","created_at":"2022-11-24T08:33:12.958000Z"},{"_id":"637f2c484b97542c9a2f11dc","body":"Having this would be useful in adding tests for https:\/\/github.com\/bazelbuild\/rules_scala\/issues\/867 and I suspect useful in other situations as well. So would be great if we can get that.\r\n\r\nShould future discussion go in https:\/\/github.com\/bazelbuild\/rules_scala\/issues\/962 ?","issue_id":1660222175861,"origin_id":579027200,"user_origin_id":497644,"create_time":1580172505,"update_time":1580172505,"id":1669278792961,"updated_at":"2022-11-24T08:33:12.961000Z","created_at":"2022-11-24T08:33:12.961000Z"},{"_id":"637f2c484b97542c9a2f11dd","body":"Hey, here are my ideas how to introduce toolchains for dependencies: https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/1067","issue_id":1660222175861,"origin_id":656062369,"user_origin_id":1623634,"create_time":1594292657,"update_time":1594292657,"id":1669278792964,"updated_at":"2022-11-24T08:33:12.963000Z","created_at":"2022-11-24T08:33:12.963000Z"}] comment

Description: We'd like to move from using the deps/repositories pattern and bind to toolchains. A great deal of the work has been done in #399 #530 and finally in #544...

tech-debt

### Problem Currently, the `twitter_scrooge` code uses aspects to traverse the thrift dependencies of a scrooge target, generating and compiling jvm code: https://github.com/bazelbuild/rules_scala/blob/master/twitter_scrooge/twitter_scrooge.bzl#L265 Adding additional languages however, requires some more...

Be able to generate service provider configuration for targets that host service implementations

[{"_id":"637f248b70db72139b0fa77e","body":"I'm interested in picking up this work. I have read @ity's code on https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/697\/files and the discussions triggered by it.\r\nBased on these, I wrote a commit that applies cleanly on recent master and I think follows the advice given in the initial draft PR's discussion.\r\n\r\nI opened https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/1063 to pick up the work and the discussion. I would be very grateful for feedback on the approach.","issue_id":1660222175865,"origin_id":652357502,"user_origin_id":5790907,"create_time":1593602131,"update_time":1593602131,"id":1669276811624,"updated_at":"2022-11-24T08:00:11.623000Z","created_at":"2022-11-24T08:00:11.623000Z"}] comment

### Description of the problem / feature request: Be able to generate service provider configuration for targets that host service implementations. This automates maintenance of jvm service provider configuration files...

Insulate toolchain options from breaking rules_scala bootstrap code

[{"_id":"637f324e70db72139b0fb602","body":"I\u2019m not sure what you\u2019re looking (toolchain isolation) for is an option in\nBazel due to source dependency.\nHow about opening an issue with bazel asking if it\u2019s a relevant request?\nAnother option would be to build rules Scala with the strictest modes as to\nsupport all users\nOn Thu, 1 Mar 2018 at 22:49 andy g scott \u261c <[email protected]> wrote:\n\n> Downstream workspaces using a custom Scala toolchain can't use the\n> scala_test rule with certain enable Scala compiler flags enabled.\n>\n> It seems custom Scala toolchains will be used to compile the bootstrapping\n> Scala code in rules_scala for running scala tests. In particular, flags\n> to enable fatal warnings and warnings on unused imports cause scala_test\n> to be unusable.\n>\n> A short term fix is to clean up these bootstrapping files so that they\n> work under strict Scala compiler flags. I took a look at a more thorough\n> solution but I couldn't come up with anything quickly.\n>\n> \u2014\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/issues\/432>, or mute the thread\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/ABUIF4q_s2SYBT_6DilClFHxEmiEInd4ks5taF7igaJpZM4SY-FR>\n> .\n>\n","issue_id":1660222175867,"origin_id":369753864,"user_origin_id":1378327,"create_time":1519943421,"update_time":1519943421,"id":1669280334381,"updated_at":"2022-11-24T08:58:54.380000Z","created_at":"2022-11-24T08:58:54.380000Z"},{"_id":"637f324e70db72139b0fb603","body":"+1 for more strictness by default.","issue_id":1660222175867,"origin_id":369757146,"user_origin_id":67958,"create_time":1519944242,"update_time":1519944242,"id":1669280334383,"updated_at":"2022-11-24T08:58:54.383000Z","created_at":"2022-11-24T08:58:54.383000Z"},{"_id":"637f324e70db72139b0fb604","body":"@ittaiz I've adjusted the title a bit to hopefully be less misleading.\r\n\r\nAFAIK in my recent adventures with Bazel, toolchains operate globally. Seems we need a way to insulate toolchain options for Scala from breaking the use of rules_scala in a workspace.","issue_id":1660222175867,"origin_id":369767170,"user_origin_id":310363,"create_time":1519946732,"update_time":1519946795,"id":1669280334386,"updated_at":"2022-11-24T08:58:54.386000Z","created_at":"2022-11-24T08:58:54.386000Z"},{"_id":"637f324e70db72139b0fb605","body":"I agree, that\u2019s why I said it\u2019s a bazel side issue if you want to change it.\nDo you have any suggestions on how to insulate it other than building\nrules_scala with the strictest defaults?\nOn Fri, 2 Mar 2018 at 1:25 andy g scott \u261c <[email protected]> wrote:\n\n> @ittaiz <https:\/\/github.com\/ittaiz> I've adjusted the title a bit to\n> maybe be a bit less misleading.\n> AFAIK toolchains operate globally.\n>\n> \u2014\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/issues\/432#issuecomment-369767170>,\n> or mute the thread\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/ABUIFxyiimgsST5PI4o5lK8ny8ynoJc1ks5taINsgaJpZM4SY-FR>\n> .\n>\n","issue_id":1660222175867,"origin_id":369835940,"user_origin_id":1378327,"create_time":1519972838,"update_time":1519972838,"id":1669280334390,"updated_at":"2022-11-24T08:58:54.389000Z","created_at":"2022-11-24T08:58:54.389000Z"},{"_id":"637f324e70db72139b0fb606","body":"@andyscott I think we should either close this issue in favor of a bazel one or rename it to clarify this issue is solely about making rules_scala work with wfatal and the rest. WDYT?","issue_id":1660222175867,"origin_id":575766770,"user_origin_id":1378327,"create_time":1579289977,"update_time":1579289977,"id":1669280334393,"updated_at":"2022-11-24T08:58:54.392000Z","created_at":"2022-11-24T08:58:54.392000Z"},{"_id":"637f324e70db72139b0fb607","body":"We could perhaps close this in favor of a more general toolchain issue.\r\n\r\nToolchains strike me as the standard way to get tools off the host environment. For Scala, this isn't needed, so I'd like to discuss the removal of toolchains for boostrapping Scala compilation.","issue_id":1660222175867,"origin_id":575953048,"user_origin_id":310363,"create_time":1579394774,"update_time":1579394774,"id":1669280334395,"updated_at":"2022-11-24T08:58:54.395000Z","created_at":"2022-11-24T08:58:54.395000Z"},{"_id":"637f324e70db72139b0fb608","body":"More general in what sense?\r\nGetting tools off of the host environment is one use case but toolchains in general belong to the world of configurability.\r\nConfiguring then scala SDK as well as the scalacopts are classic toolchain use cases.\r\n\r\nWhy should we remove toolchains from our scala code?","issue_id":1660222175867,"origin_id":575967379,"user_origin_id":1378327,"create_time":1579409755,"update_time":1579409755,"id":1669280334397,"updated_at":"2022-11-24T08:58:54.397000Z","created_at":"2022-11-24T08:58:54.397000Z"},{"_id":"637f324e70db72139b0fb609","body":"You might be able to isolate settings for rules_scala with platform constraints: you could define a platform `@rules_scala\/\/:bootstrap-platform` and set `restricted_to` to that platform in the targets defined in the rules_scala repo.\r\n\r\nThe consumers could have one scala toolchain for their application code (maybe stricter, maybe plus-one deps) and another scala toolchain to compile rules_scala (with whichever settings rules_scala requires).","issue_id":1660222175867,"origin_id":650824553,"user_origin_id":24484414,"create_time":1593379881,"update_time":1593379881,"id":1669280334400,"updated_at":"2022-11-24T08:58:54.399000Z","created_at":"2022-11-24T08:58:54.399000Z"},{"_id":"637f324e70db72139b0fb60a","body":"interesting, doesn't that require support for using multi platform in a single invocation in bazel?\r\nBazel is very oriented towards everything being one mono repo together, the above scenario doesn't sound like it will work to be honest","issue_id":1660222175867,"origin_id":652191044,"user_origin_id":1378327,"create_time":1593579601,"update_time":1593579601,"id":1669280334403,"updated_at":"2022-11-24T08:58:54.402000Z","created_at":"2022-11-24T08:58:54.402000Z"}] comment

Downstream workspaces using a custom Scala toolchain can't use the `scala_test` rule with certain Scala compiler flags enabled. It seems custom Scala toolchains will be used to compile the bootstrapping...

per-target dependency options

[{"_id":"637f31c94b97542c9a2f16cb","body":"Technically this is doable but I\u2019m not sure I think it\u2019s a good idea.\nTwo initial thoughts:\n1. Bazel is very biased towards uniformity and global shared configurations. External workspaces can be thought of as merely a way to patch together directories to a single mono repo. This means IMHO that per target configurations are the exception and not the rule.\n2. Technically your suggestion can be problematic for people using persistent workers since it will either invalidate them or mean that using this attribute will opt you out from persistent workers. This might be ok if this is a conscious decision but I fear people won\u2019t understand using this attribute will cause this.\n\nMaybe this means that root\/library workspaces need to support both dependency modes? For example this can be done by adding the additional dependency in your build file and adding it to ignored.\n\nFinally I\u2019m not 100% sure I\u2019m against your suggestion but it sounds problematic.\n\n@Jamie5 @liucijus wdyt?","issue_id":1660222175869,"origin_id":650880615,"user_origin_id":1378327,"create_time":1593400578,"update_time":1593400578,"id":1669280201196,"updated_at":"2022-11-24T08:56:41.195000Z","created_at":"2022-11-24T08:56:41.195000Z"},{"_id":"637f31c94b97542c9a2f16cc","body":"Do the existing target attributes scalacopts, scalac_jvm_flags, and unused_dependency_checker_mode have the same impact on uniformity and persistent worker reuse as the other dependency options would?\r\n\r\nThe trouble is that applying a single set of options across all workspaces breaks composition. If I use [build_stack_rules_proto](https:\/\/github.com\/stackb\/rules_proto) and build my workspace with\r\n\r\n```bash\r\n--extra_toolchains=@io_bazel_rules_scala\/\/scala:minimal_direct_source_deps\r\n```\r\n\r\nthen my build fails with:\r\n\r\n> ERROR: \/Users\/dsilva\/Snapchat\/Dev\/tmp\/_bazel_dsilva\/c65e62889b3448fbc3eab4f5ca51b208\/external\/build_stack_rules_proto\/scala\/BUILD.bazel:66:1: scala @build_stack_rules_proto\/\/scala:compiler_plugin failed (Exit 1): scalac failed: error executing command\r\n> \u00a0 | (cd \/Users\/dsilva\/Snapchat\/Dev\/tmp\/_bazel_dsilva\/c65e62889b3448fbc3eab4f5ca51b208\/execroot\/example && \\\r\n> \u00a0 | exec env - \\\r\n> \u00a0 | bazel-out\/host\/bin\/external\/io_bazel_rules_scala\/src\/java\/io\/bazel\/rulesscala\/scalac\/scalac @bazel-out\/host\/bin\/external\/build_stack_rules_proto\/scala\/compiler_plugin_scalac_worker_input)\r\n> \u00a0 | Execution platform: @local_config_platform\/\/:host\r\n> \u00a0 | error: Target '@com_google_protobuf\/\/:protobuf_java' is specified as a dependency to @build_stack_rules_proto\/\/scala:compiler_plugin but isn't used, please remove it from the deps.\r\n","issue_id":1660222175869,"origin_id":651044354,"user_origin_id":24484414,"create_time":1593429026,"update_time":1593429026,"id":1669280201199,"updated_at":"2022-11-24T08:56:41.199000Z","created_at":"2022-11-24T08:56:41.199000Z"},{"_id":"637f31c94b97542c9a2f16cd","body":"They actually might have the same impact. I'll try to take a look at the code later and reply.","issue_id":1660222175869,"origin_id":651094872,"user_origin_id":1378327,"create_time":1593434680,"update_time":1593434680,"id":1669280201202,"updated_at":"2022-11-24T08:56:41.202000Z","created_at":"2022-11-24T08:56:41.202000Z"},{"_id":"637f31c94b97542c9a2f16ce","body":"I think this is somewhat similar to #1046 . I kind of lean towards that generally one would wish to consume external deps as jars. But I think in the other ticket there were some questions to be resolved (I know the tickets don't ask for exactly the same thing but they seem kind of similar)","issue_id":1660222175869,"origin_id":651456685,"user_origin_id":497644,"create_time":1593479482,"update_time":1593479482,"id":1669280201205,"updated_at":"2022-11-24T08:56:41.205000Z","created_at":"2022-11-24T08:56:41.205000Z"},{"_id":"637f31c94b97542c9a2f16cf","body":"rules_java and build_stack_rules_proto do not vend their scala code as jars :)\r\n\r\nhttps:\/\/github.com\/bazelbuild\/rules_scala\/blob\/056d5921d2c595e7ce2d54a627e8bc68ece7e28d\/scala\/support\/BUILD#L5\r\nhttps:\/\/github.com\/stackb\/rules_proto\/blob\/b2913e6340bcbffb46793045ecac928dcf1b34a5\/scala\/BUILD.bazel#L68\r\n\r\nI can see the argument for consuming public libraries as maven jars: the ecosystem's already there and binary artifacts isolate consumers from the library's build logic. On the other hand, consuming some libraries with fragile ABIs (like guava) can be scary and consuming from source alleviates the fear of NoSuchMethodError or ClassNotFoundException at runtime.\r\n\r\nFor private libraries, I suppose different teams could still have different requirements. Or one might want the strictest settings possible throughout an organization's many repos, with exceptions where that doesn't work (macros, maybe other cases).","issue_id":1660222175869,"origin_id":651465287,"user_origin_id":24484414,"create_time":1593480901,"update_time":1593480901,"id":1669280201208,"updated_at":"2022-11-24T08:56:41.208000Z","created_at":"2022-11-24T08:56:41.208000Z"}] comment

I have scala targets that rely on `dependency_mode = "plus-one"` to compile. For example, one target depends on circe-derivation and uses the deriveEncoder macro from it, which expands to a...

Currently, the mechanism we use to test `WORKSPACE` customizations is the tesd `./test_version.sh`, which populates a template workspace and executes Bazel tests there. Recently, we have needed to add some...

Generic scala_test rule

[{"_id":"637f354170db72139b0fb9b1","body":"I'll take a look once we finalize the other PRs, ok?","issue_id":1660222175872,"origin_id":578602316,"user_origin_id":1378327,"create_time":1580104688,"update_time":1580104688,"id":1669281089601,"updated_at":"2022-11-24T09:11:29.600000Z","created_at":"2022-11-24T09:11:29.600000Z"},{"_id":"637f354170db72139b0fb9b2","body":"This PR will address #951 (If I understand it correctly). Lucid is +1 for this change, we use specs2 for all Scala tests but `scala_test` currently doesn't support it. I notice `scala_specs2_junit_test` is designed for this purpose but it would be better to just have one unified `scala_test`. Plus, `scala_junit_test` and `scala_test` are quite similar (based on what phases are used), another good reason to support this PR.\r\n\r\nLet's wait until all the split off PRs are merged. @ittaiz what are the PRs you are waiting on to finalize?","issue_id":1660222175872,"origin_id":589261094,"user_origin_id":20475846,"create_time":1582226217,"update_time":1582226217,"id":1669281089605,"updated_at":"2022-11-24T09:11:29.604000Z","created_at":"2022-11-24T09:11:29.604000Z"},{"_id":"637f354170db72139b0fb9b3","body":"for one- #1005 \r\nAdditionally @andyscott needs to rebase and say if this is ready for review (note the WIP header).\r\nAfter that's done I'll try to get the review started within a few days.\r\nI'll remind @andyscott that I'm waiting for his data collection over at #965 which I'd like to advance before other issues.\r\nI'm thinking of just moving to providers without it but he said he'll collect the data in a few weeks so I'm waiting","issue_id":1660222175872,"origin_id":589675268,"user_origin_id":1378327,"create_time":1582295156,"update_time":1582295156,"id":1669281089607,"updated_at":"2022-11-24T09:11:29.607000Z","created_at":"2022-11-24T09:11:29.607000Z"},{"_id":"637f354170db72139b0fb9b4","body":"> I'll remind @andyscott that I'm waiting for his data collection over at #965 which I'd like to advance before other issues.\r\n> I'm thinking of just moving to providers without it but he said he'll collect the data in a few weeks so I'm waiting\r\n\r\nIt will happen :). I've been busy! I'd like to get this PR sorted out and then use any future time for reviews and shepherding through work by other folks.","issue_id":1660222175872,"origin_id":589763485,"user_origin_id":310363,"create_time":1582307765,"update_time":1582307765,"id":1669281089610,"updated_at":"2022-11-24T09:11:29.610000Z","created_at":"2022-11-24T09:11:29.610000Z"},{"_id":"637f354170db72139b0fb9b5","body":"> It will happen :)\r\n\r\n\ud83d\udc4d \r\nOnce we merge #1005, you rebase this PR and say that it's ready I'll see when I can make time to review it.\r\n\r\nJust a few thoughts-\r\nHow does test discovery happen?\r\nHow does IDE integration happen?\r\nHow does test filtering happen?","issue_id":1660222175872,"origin_id":589931291,"user_origin_id":1378327,"create_time":1582359092,"update_time":1582359092,"id":1669281089614,"updated_at":"2022-11-24T09:11:29.613000Z","created_at":"2022-11-24T09:11:29.613000Z"},{"_id":"637f354170db72139b0fb9b6","body":"Status?","issue_id":1660222175872,"origin_id":626409956,"user_origin_id":10137,"create_time":1589155211,"update_time":1589155211,"id":1669281089616,"updated_at":"2022-11-24T09:11:29.616000Z","created_at":"2022-11-24T09:11:29.616000Z"},{"_id":"637f354170db72139b0fb9b7","body":"Good question. @andyscott can you rebase and answer my questions above?","issue_id":1660222175872,"origin_id":626441256,"user_origin_id":1378327,"create_time":1589165121,"update_time":1589165121,"id":1669281089619,"updated_at":"2022-11-24T09:11:29.619000Z","created_at":"2022-11-24T09:11:29.619000Z"},{"_id":"637f354170db72139b0fb9b8","body":"Sure thing, I'll go through this tomorrow.\n\nOn Sun, May 10, 2020, 19:45 Ittai Zeidman <[email protected]> wrote:\n\n> Good question. @andyscott <https:\/\/github.com\/andyscott> can you rebase\n> and answer my questions above?\n>\n> \u2014\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/959#issuecomment-626441256>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AACLYW7IIIOOIE4J7EJKTETRQ5RE3ANCNFSM4KL3OBHA>\n> .\n>\n","issue_id":1660222175872,"origin_id":626478164,"user_origin_id":310363,"create_time":1589174974,"update_time":1589174974,"id":1669281089622,"updated_at":"2022-11-24T09:11:29.621000Z","created_at":"2022-11-24T09:11:29.621000Z"},{"_id":"637f354170db72139b0fb9b9","body":"Any news?","issue_id":1660222175872,"origin_id":635902453,"user_origin_id":423802,"create_time":1590748602,"update_time":1590748602,"id":1669281089625,"updated_at":"2022-11-24T09:11:29.625000Z","created_at":"2022-11-24T09:11:29.625000Z"},{"_id":"637f354170db72139b0fb9ba","body":"I should have this cleaned up today. Regarding your questions @ittaiz:\r\n\r\n> How does test discovery happen?\r\n\r\nTest discovery is done by scanning the classpath and identifying classes\/modules that satisfy the SBT testing interface.\r\n\r\n> How does IDE integration happen?\r\n\r\nI'm not sure, I haven't tried it.\r\n\r\n> How does test filtering happen?\r\n\r\nI haven't explored extending this for test filtering, so I'm not sure.\r\n\r\n\r\nI don't have time to work on IDE integration or test filtering. I suggest we do one of two things:\r\n1. Merge the PR without testing IDE support and without test filtering. Other folks from the community can pick up these work items.\r\n2. Someone else continues on this PR to add the additional functionality before it gets merged.\r\n\r\nI'm biased towards option 1, as the functionality is marked unstable\/experimental and it gives closure to this PR.","issue_id":1660222175872,"origin_id":636092488,"user_origin_id":310363,"create_time":1590773275,"update_time":1590773275,"id":1669281089628,"updated_at":"2022-11-24T09:11:29.627000Z","created_at":"2022-11-24T09:11:29.627000Z"},{"_id":"637f354170db72139b0fb9bb","body":"I'll take a look this weekend and see what we can do. Can you get the build to pass?","issue_id":1660222175872,"origin_id":636514051,"user_origin_id":1378327,"create_time":1590951890,"update_time":1590951890,"id":1669281089631,"updated_at":"2022-11-24T09:11:29.630000Z","created_at":"2022-11-24T09:11:29.630000Z"},{"_id":"637f354170db72139b0fb9bc","body":"Yep. I need to do a few more fixes, and then there's some obvious cleanup\nand refactoring needed too.\n\nOn Sun, May 31, 2020, 12:05 Ittai Zeidman <[email protected]> wrote:\n\n> I'll take a look this weekend and see what we can do. Can you get the\n> build to pass?\n>\n> \u2014\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/959#issuecomment-636514051>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AACLYW2RUGJIAQXLECLCEDDRUKS55ANCNFSM4KL3OBHA>\n> .\n>\n","issue_id":1660222175872,"origin_id":636519672,"user_origin_id":310363,"create_time":1590954524,"update_time":1590954524,"id":1669281089633,"updated_at":"2022-11-24T09:11:29.633000Z","created_at":"2022-11-24T09:11:29.633000Z"},{"_id":"637f354170db72139b0fb9bd","body":"Ok.\nLMK when to look.\n\nOn Sun, 31 May 2020 at 22:49 Andy Scott <[email protected]> wrote:\n\n> Yep. I need to do a few more fixes, and then there's some obvious cleanup\n> and refactoring needed too.\n>\n> On Sun, May 31, 2020, 12:05 Ittai Zeidman <[email protected]>\n> wrote:\n>\n> > I'll take a look this weekend and see what we can do. Can you get the\n> > build to pass?\n> >\n> > \u2014\n> > You are receiving this because you were mentioned.\n> > Reply to this email directly, view it on GitHub\n> > <\n> https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/959#issuecomment-636514051\n> >,\n> > or unsubscribe\n> > <\n> https:\/\/github.com\/notifications\/unsubscribe-auth\/AACLYW2RUGJIAQXLECLCEDDRUKS55ANCNFSM4KL3OBHA\n> >\n> > .\n> >\n>\n> \u2014\n> You are receiving this because you were mentioned.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/959#issuecomment-636519672>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AAKQQF6AYKJ6ZBW7G7WFBALRUKYCRANCNFSM4KL3OBHA>\n> .\n>\n-- \n\n\n*Ittai Zeidman*\n\n\n\n40 Hanamal street, Tel Aviv, Israel\n\n\n\n<http:\/\/www.wix.com>\n","issue_id":1660222175872,"origin_id":636582111,"user_origin_id":1378327,"create_time":1590979122,"update_time":1590979122,"id":1669281089636,"updated_at":"2022-11-24T09:11:29.636000Z","created_at":"2022-11-24T09:11:29.636000Z"},{"_id":"637f354170db72139b0fb9be","body":"We're getting closer!\r\n\r\nif you have time, it might be good to begin reading through the code to provide feedback on organization. Separately, I am going to read through my own implementation (it's been a few months since I've dug into the Scala part of this) and add comments.","issue_id":1660222175872,"origin_id":637176865,"user_origin_id":310363,"create_time":1591053695,"update_time":1591053695,"id":1669281089639,"updated_at":"2022-11-24T09:11:29.638000Z","created_at":"2022-11-24T09:11:29.638000Z"},{"_id":"637f354170db72139b0fb9bf","body":"I\u2019ll make time over the weekend, really swamped until then\n\nOn Tue, 2 Jun 2020 at 2:21 Andy Scott <[email protected]> wrote:\n\n> We're getting closer!\n>\n> if you have time, it might be good to begin reading through the code to\n> provide feedback on organization. Separately, I am going to read through my\n> own implementation (it's been a few months since I've dug into the Scala\n> part of this) and add comments.\n>\n> \u2014\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/bazelbuild\/rules_scala\/pull\/959#issuecomment-637176865>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AAKQQF33JP2XWIWDSJAB5R3RUQZYXANCNFSM4KL3OBHA>\n> .\n>\n-- \n\n\n*Ittai Zeidman*\n\n\n\n40 Hanamal street, Tel Aviv, Israel\n\n\n\n<http:\/\/www.wix.com>\n","issue_id":1660222175872,"origin_id":637261026,"user_origin_id":1378327,"create_time":1591071304,"update_time":1591071304,"id":1669281089641,"updated_at":"2022-11-24T09:11:29.640000Z","created_at":"2022-11-24T09:11:29.640000Z"},{"_id":"66286ad42186caae780837bc","body":"closing as stale, feel free to reopen","issue_id":1660222175872,"origin_id":1919292556,"user_origin_id":1623634,"create_time":1706713601,"update_time":1706713601,"id":1713924820498,"updated_at":"2024-04-24T02:13:40.497000Z","created_at":"2024-04-24T02:13:40.497000Z"}] comment

### Description Adds a new `scala_test` rule that supports the SBT testing interface. Initially I would like to have the rule merged as "experimental" or "unstable" so folks can begin...

cla: yes