Skip to content

Conversation

@liucijus
Copy link
Collaborator

Call correct function to register toolchain

@ittaiz
Copy link
Contributor

ittaiz commented Oct 27, 2020

How come it passed until now?

@liucijus
Copy link
Collaborator Author

How come it passed until now?

In rules_scala we use another toolchain, which has configurations for all testing frameworks: https://github.com/bazelbuild/rules_scala/blob/master/WORKSPACE#L50

@ittaiz
Copy link
Contributor

ittaiz commented Oct 27, 2020

Do you think it's a good idea to keep it like this? Feels like a recipe for future bugs

@liucijus
Copy link
Collaborator Author

@ittaiz I agree it's an opportunity for bugs. Added an example workspace which serves as an integration test for ScalaTest repository/toolchain helpers.

Copy link
Contributor

@ittaiz ittaiz left a comment

Choose a reason for hiding this comment

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

Thanks for the test workspace! Looks really good :) left few questions

http_archive(
name = "io_bazel_rules_go",
sha256 = "45409e6c4f748baa9e05f8f6ab6efaa05739aa064e3ab94e5a1a09849c51806a",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.7/rules_go-0.18.7.tar.gz",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you upgrade rules_go? Because of skylib?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes


def scalatest_toolchain():
native.register_toolchain("//testing:scalatest_toolchain")
native.register_toolchains("@io_bazel_rules_scala//testing:scalatest_toolchain")
Copy link
Contributor

Choose a reason for hiding this comment

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

Small question- your previous CI (IIRC) was without @io_bazel_rules_scala right? Why the change? What pushed it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was a mistake - all toolchains have to be registered with external name otherwise they may be treated as different

Copy link
Contributor

Choose a reason for hiding this comment

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

So it's precaution rather than something actually failed? (Ok with either, trying to understand which)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried with the example repo - it doesn't even find the toolchain:

ERROR: Analysis of target '//example:example' failed; build aborted: invalid registered toolchain '//testing:scalatest_toolchain': no such package 'testing': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.

Copy link
Contributor

Choose a reason for hiding this comment

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

Amazing. Great that we have this test workspace

@ittaiz ittaiz merged commit 09d6c74 into bazel-contrib:master Oct 30, 2020
blorente pushed a commit to twitter-forks/rules_scala that referenced this pull request Nov 26, 2020
* Fix toolchain registration call for ScalaTest

* Use external name in toolchain registration

* Add example/integration test for ScalaTest repositories

* Use the same skylib version and download it from google mirror

* Update rules_go to support 1.0.3 skylib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants