Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Clang support? #16

Closed
dmadisetti opened this issue Nov 16, 2019 · 4 comments
Closed

Clang support? #16

dmadisetti opened this issue Nov 16, 2019 · 4 comments

Comments

@dmadisetti
Copy link
Contributor

g++ does weird things with my tests. I generally run on clang.

  • We could bake various compilers into the docker container.
  • Or we could modify entry.sh to pull a requested compiler.

Setting the CC_COMPILE env variable is sufficient for Bazel.

@ngalaiko
Copy link
Owner

Hi!
Which clang?

I don't think that adding more and more compilers to the Docker image is a long term solution.

Other ways to solve it:

  • install required binaries to one of the directories that github mounts to the container with action, and configuring the correct $PATH
docker run ... \
-v "/home/runner/work/_temp/_github_home":"/github/home" \
-v "/home/runner/work/_temp/_github_workflow":"/github/workflow" \
-v "/home/runner/work/<user>/<repo>":"/github/workspace"

What do you think?

@dmadisetti
Copy link
Contributor Author

There may be a way to do this without any changes at all using the CROSSTOOL option, but it doesn't look trivial.

I think that the latter option is probably the best, but it looks like a larger engineering effort. It also strongly couples the project to github- which is fine but the containers are potentially useful outside of the actions context.

HB a with argument that's called provisioning_script, which is run prior to bazel being invoked? Or is this getting too hacky?

I'm sure other docker based actions are probably running into similar issues. Honestly the easiest option for consumers is to fork and implement their own changes, which looks like it already happening: https://github.com/Penn-Electric-Racing/bazel-action/blob/master/Dockerfile

I threw this over to g/bazel-discuss just to see if anyone else has ideas: https://groups.google.com/forum/#!topic/bazel-discuss/G4IVy55fzC0

@ngalaiko
Copy link
Owner

I agree that forking is the easiest option, and probably the best if you need a specific setup.

By the way, it looks like CROSTOOL is deprecated and being replaced with toolchains, can you use those for clang ? I successfully use toolchains for golang with this action.

@ngalaiko
Copy link
Owner

Thank you for your input! I thought a bit about this, and I no longer see any reason for this action, see #25. I think you will find it easier to fill your needs with the approach I mention in the README

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants