-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Invalid License Error While Running bazel build #5157
Comments
It looks like this is an error with tensorflow. Did you try building another project with bazel (for example the If you can build the |
I tried bazel example projects and I got same error |
My guess is that your bazel is setup incorrectly. How did you install it? Are you sure that it is version |
It says version 0.13.0.
I installed Bazel on this Mac with HomeBrew
but I also installed Bazel on another Mac using binary installer. Always I
get same error.
I installed from here.
https://docs.bazel.build/versions/master/install-os-x.html
…On 4 May 2018 at 18:08, Robin Nabel ***@***.***> wrote:
My guess is that your bazel is setup incorrectly. How did you install it?
Are you sure that it is version 0.13.0?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5157 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AbIx7GfywKl5dj8VYE1o1SBTGgo1ZyN9ks5tvG7bgaJpZM4TyJ9n>
.
|
I uninstalled bazel with :
brew uninstall --force bazel
Then installed again with:
brew install bazel
but still I got same license error.
…On 4 May 2018 at 18:12, Çağrı Gider ***@***.***> wrote:
It says version 0.13.0.
I installed Bazel on this Mac with HomeBrew
but I also installed Bazel on another Mac using binary installer. Always I
get same error.
I installed from here.https://docs.bazel.build/
versions/master/install-os-x.html
On 4 May 2018 at 18:08, Robin Nabel ***@***.***> wrote:
> My guess is that your bazel is setup incorrectly. How did you install it?
> Are you sure that it is version 0.13.0?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#5157 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AbIx7GfywKl5dj8VYE1o1SBTGgo1ZyN9ks5tvG7bgaJpZM4TyJ9n>
> .
>
|
This is odd - could you please elaborate more on the steps you took to point of this error with the examples repository? |
I ran these commands
then I got this error. ERROR: /private/var/tmp/_bazel_cagrigider/4c2d107b81f30b45f844673a09f76011/external/bazel_tools/tools/cpp/BUILD:17:1: invalid license type: 'notice' |
could you please paste the contents of the file |
the error is raised in this method: https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/packages/License.java;l=200 try {
licenseTypes.add(LicenseType.valueOf(str.toUpperCase()));
} catch (IllegalArgumentException e) {
throw new LicenseParsingException("invalid license type: '" + str + "'")
}
public enum LicenseType {
BY_EXCEPTION_ONLY,
RESTRICTED,
RESTRICTED_IF_STATICALLY_LINKED,
RECIPROCAL,
NOTICE,
PERMISSIVE,
UNENCUMBERED,
NONE
} |
could you please paste line 17 of the |
licenses(["notice"]) # Apache 2.0 |
Ok, I'm quite stumped here. Could you please run |
After After that when I run : It gives, same invalid license type error.
|
Something else worth trying is to check whether you are using the bazel that homebrew provides, using |
And
|
Could this be an encoding/parsing issue? + @laurentlb for Skylark |
It could be that "notice".toUpperCase() on your system locale does not convert it to "NOTICE". |
Is there anything I can do to fix this error? |
Sure, attach the debugger and check what is going on here https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/packages/License.java;l=200: licenseTypes.add(LicenseType.valueOf(str.toUpperCase())); |
How can I attach the debugger on this code ? |
See https://bazel.build/contributing.html, particularly "Debugging Bazel" section. Basically, you need to set up IntelliJ IDEA project, call Bazel with: |
After I did this step when preparing IntelliJ IDEA I can't see that, |
When I am did this |
And also, before creating project it wants me to build bazel .
|
@cagrigider The IntelliJ plugin appears to only be supported in 2017.x versions (issue on their repo: bazelbuild/intellij#290), so you are going to have to rollback to 2017.3.5 which is the last 2017 release. If you don't already, you may want to use the JetBrains Toolbox App which makes installing and upgrading to specific IntelliJ versions really easy. |
It says but |
Yes. You need to go to your |
It says :
Then you can rebuild Bazel with bazel build --config debug //src:bazel and use your favorite debugger to start debugging. So I should open my bazel.bazelrc file as a text file and paste these lines into it. Then rebuild ? |
Now my .bazelrc file is empty |
Could you please try passing the flag |
@cagrigider adding As @jin indicated, it would also be good to try setting user.language: |
I m trying this now |
Yeah, it looks like the problem is with your system's locale setting. No worries, we should force the Locale to be
Yes, for now, you should run any
|
It is working now. Thank you so much. |
Good to hear :-) |
Fixes bazelbuild/bazel#5157 If a user's default system locale is not `en`, `en_US` or `en_UK`, there may be a chance that `String#toUpperCase` will result in a string that does not exist in the Enum declaration. This is the case in #5157. To fix this, it's either 1) setting the Locale in the individual `toUpperCase` calls or 2) set Locale to English by default from `Bazel.java`. I chose the first because it seemed less intrusive, but I'm open to suggestions. Closes #5184. PiperOrigin-RevId: 196261078
I am trying to compile tensorflow for Macbook, but every time when I use bazel build, I am getting same error.
When I Run this command
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
I get this error
/private/var/tmp/_bazel_cagrigider/2c548436011ab6b7308cd0cc70a91ed3/external/bazel_tools/tools/cpp/BUILD:3:1: invalid license type: 'notice'
Full Output Of Terminal
Mac OS 10.13.3
Xcode version = 9.2
Tensorflow version = 1.8
Bazel version = 0.13.0
Thanks.
The text was updated successfully, but these errors were encountered: