External dependencies and WORKSPACE

55 views
Skip to first unread message

Zach Marcantel

unread,
Mar 5, 2018, 2:40:36 PM3/5/18
to please-build
What is the plan for WORKSPACE files and external dependencies?
I see no information on the site or repo. I imagine this is a planned feature that hasn't been gotten around to?

I'm happy to give it a go as the `go-getter` library from Hashicorp should be more than all we need.
My only concerns are the parsing of the file structure and placing artifacts in the place the build expects....
This is largely me familiarizing myself with the project, but:

1. is there any (preliminary) documentation on this to review?
2. any suggestions on where to begin? (high level like, files/types/functions that are interesting)

Thanks,
Zach

Peter Ebden

unread,
Mar 6, 2018, 4:46:28 AM3/6/18
to Zach Marcantel, please-build
Hi,

External dependencies are supported for the builtin languages; for example go_get, pip_library, maven_jar, etc.
They don't have to be placed in a special file like WORKSPACE though, they can be used in any BUILD file; the typical pattern we use is third_party/go/BUILD, third_party/python/BUILD etc; the Please repo has several examples of these, e.g. https://github.com/thought-machine/please/blob/master/third_party/python/BUILD.

It's possible to add more for new languages within the BUILD language although they often tend to be a bit fiddly since they involve interacting with third-party repos. There's also a remote_file builtin which is useful for straightforward http downloads.

Maybe a section of documentation explaining how Bazel concepts like WORKSPACE map into Please would be useful.

Hope that helps!
Peter


--
You received this message because you are subscribed to the Google Groups "please-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to please-build+unsubscribe@googlegroups.com.
To post to this group, send email to please...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/please-build/78c45d68-e38f-42ad-a54d-56a9898a842f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zach Marcantel

unread,
Mar 6, 2018, 11:32:33 AM3/6/18
to please-build
Ah, that is where my misunderstanding is.

I was looking for C/C++ and/or the equivalent of the `new_git_repository` to then include in the project.
I did notice the `go_get` but figured that was simply because package management was builtin to Go.
Didn't even look at the other languages to notice those options.

I agree documentation would be nice though. Nothing too long, just enough to point in the write direction.
It would also be nice to have a language-agnostic option like `new_git_repository` or similar.

Certainly helped and thanks for the response,
Zach


On Tuesday, March 6, 2018 at 3:46:28 AM UTC-6, Peter Ebden wrote:
Hi,

External dependencies are supported for the builtin languages; for example go_get, pip_library, maven_jar, etc.
They don't have to be placed in a special file like WORKSPACE though, they can be used in any BUILD file; the typical pattern we use is third_party/go/BUILD, third_party/python/BUILD etc; the Please repo has several examples of these, e.g. https://github.com/thought-machine/please/blob/master/third_party/python/BUILD.

It's possible to add more for new languages within the BUILD language although they often tend to be a bit fiddly since they involve interacting with third-party repos. There's also a remote_file builtin which is useful for straightforward http downloads.

Maybe a section of documentation explaining how Bazel concepts like WORKSPACE map into Please would be useful.

Hope that helps!
Peter

Peter Ebden

unread,
Mar 7, 2018, 6:35:35 AM3/7/18
to Zach Marcantel, please-build
Ah right, there is not a direct equivalent of new_git_repository yet; I've started work on it but there's still some work needed to support those kind of subordinate repositories.
It's definitely on the roadmap (such as that is) though!

-P



Reply all
Reply to author
Forward
0 new messages