Replies: 4 comments 3 replies
-
Unclear to me how allowing customizing those file names solves the vendoring problem. Are you proposing that the main project use IMO that's much worse than just editing your vendored files to rename all |
Beta Was this translation helpful? Give feedback.
-
Yep, that's the idea: that the outer project would use file names like I do realize that renaming files during vendoring is not a very complicated operation, but e.g. Android is not very enthusiastic about that option. |
Beta Was this translation helpful? Give feedback.
-
The de-facto thing is to patch the vendored project. Usually, that is to take the released project and inject the necessary patches on top of it.
We do similar through This is how Linux distributions "vendor" the upstream projects into their package repositories. I'm unclear on how this is any different to using a symlink forest layer over the build files, you're still doing the patching work just in a different way.
We'd be against this direction in favour of patching vendored projects. Unless we're missing why patching is not applicable here. |
Beta Was this translation helpful? Give feedback.
-
I wrote the original support for BUILD.bazel back when I joined the team (geez, that was forever ago). I have probably lost the original documentation, but one alternative we considered was to add a flag that controlled the build file name: instead of the previous version (only support The biggest problem we identified, and the main reason we went with the current (much more complex) system, was handling external repositories: if my project only uses This isn't quite the same as your proposal, but is very similar, so I suspect that the same reasons weigh against it. |
Beta Was this translation helpful? Give feedback.
-
Bazel currently hard-codes the name of the configuration files it reads:
BUILD.bazel
,WORKSPACE.bazel
,MODULE.bazel
, etc.Every once a while, we run into problems with this. The most common use case is that one wants to vendor a project that already builds with Bazel, but the existing configuration files don't work for some reason. Reasons include:
BUILD.bazel
files need to be heavily rewrittenBUILD.bazel
/WORKSPACE.bazel
file because glob stops there.so it occurs to me every once in a while that maybe we should teach Bazel to read configuration files with different names. It's not obvious how that should happen (you can't put it in
WORKSPACE.bazel
because the name of that file would depend on the value of this knob).I do realize that this is quite a bit of rope and I haven't even started exploring what systems other than Bazel would need to be aware of this knob (e.g. Buildifier), but this discussion is a good place to collect opinions for and against.
The canonical workaround is to build a wrapper around Bazel that creates a symlink forest that "edits out" undesired
BUILD.bazel
files from the source tree and call Bazel with that symlink forest as the workspace. It's as ugly as it sounds, but so far, everyone who went this route was satisfied with the results, as surprising as it is.Beta Was this translation helpful? Give feedback.
All reactions