-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow customizing "BUILD" as a package-specification file #552
Comments
👍 It is very common to have a I wonder why Bazel allows you to customize the location of a It would be as simple as specifying in the |
I don't think that's a good idea. We will ends-up having different build file everywhere. We should instead do file type detection and not try to parse a directory as a build file :) |
@damienmg the problem we ran into was the opposite - existing scripts (as well as Gradle, in its default configuration) were stepping on the BUILD files we wrote. |
If the concern is that we will have different build files everywhere, maybe we could solve this problem by detecting build files by looking for files either called |
Alternatively, |
SGTM BUILD.bazel ? (someone was proposing an extension to make it work outside). |
Please don't reuse extensions that are already in use for different file types (i.e. please don't use .bzl). BUILD.bld? |
If we are adding an extension, I vote in favor of
Similarly, Gradle's build files are |
I also need this while trying to migrate from |
I'm looking into it, I promise! :) |
Just as an update, work is in progress, I have a mostly working solution but there are a lot of tests to fix up as a result. |
As a transitory aid, until this is done, I made a really simple script to patch Bazel. We managed to transition successfully from pants with a ~2 week overlap and then went back to the vanilla Bazel binary after.
|
Has there been any decision as to what the extension/name of this BUILD file not named BUILD is going to be? |
The alternate name will be BUILD.bazel. I have the code for this change On Mon, Oct 10, 2016, 1:54 PM Robert Bradshaw [email protected]
|
@katre any ETA? this is a pretty frustrating issue for us. |
@ixdy Sorry for the slow reply. I have a change ready and in testing. There's some cleanup I need to do before I can start working to get it out, but it should be in review next week. |
Chiming in from Airbnb eng -- we're looking to migrate off of Gradle as well as some of the other folks in this thread and we've run into this issue as well. Would love to see this fix released as soon as it's ready. |
I have just this evening submitted the fix for this issue. It should be pushed to GitHub in the next day or so and then be in the December release (presumably 0.4.2, but we will see what the version is). |
Automatic merge from submit-queue Rename root BUILD to BUILD.bazel, and rename build-tools/ back to build/ **What this PR does / why we need it**: undoes #35453. `build-tools/` was intended to be a temporary workaround until bazelbuild/bazel#552 was fixed, which is has been, as of bazel 0.4.1. **Which issue this PR fixes**: fixes #38126 FYI @thockin since this is likely to be rebase hell, my list of actions: ```console $ git mv BUILD BUILD.bazel $ git commit -a $ git mv build-tools/ build/ $ sift -l 'build-tools' | xargs sed -i -e 's:build-tools/:build/:g' $ git checkout HEAD docs/ $ git commit -a ```
[BUILD.bazel](https://github.com/bazelbuild/bazel/blob/master/src/main /java/com/google/devtools/build/lib/skyframe/PackageLookupValue.java#L 55) is a valid BuildFilename (see bazelbuild/bazel#552), so it must be selectable when adding packages in Tulsi. -- Change-Id: Ieb2c0c1dd78fd99c1bd98b0567e60658f8dce593 Reviewed-on: #2 PiperOrigin-RevId: 146696005 MOS_MIGRATED_REVID=146696005
Automatic merge from submit-queue Rename root BUILD to BUILD.bazel, and rename build-tools/ back to build/ **What this PR does / why we need it**: undoes #35453. `build-tools/` was intended to be a temporary workaround until bazelbuild/bazel#552 was fixed, which is has been, as of bazel 0.4.1. **Which issue this PR fixes**: fixes #38126 FYI @thockin since this is likely to be rebase hell, my list of actions: ```console $ git mv BUILD BUILD.bazel $ git commit -a $ git mv build-tools/ build/ $ sift -l 'build-tools' | xargs sed -i -e 's:build-tools/:build/:g' $ git checkout HEAD docs/ $ git commit -a ```
Most OS X installations have a case-sensitive filesystem, so "BUILD" is the same as "build".
Some teams have directories/files named "build" in their projects, which poses a double challenge:
At least as a transitionary-aid for other teams, it would be useful to customize the file-name that Bazel uses to define packages.
Suggestion: add a
WORKSPACE
rule to define a different file-name.The text was updated successfully, but these errors were encountered: