-
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
"foo-bar is not a legal workspace name" error is reported on Bazel@HEAD #11837
Comments
Closes bazelbuild#11837. Change-Id: Ifc09fa7dd3aff244051feea1ff1c4e47236a08ab
Closes bazelbuild#11837. Change-Id: Ifc09fa7dd3aff244051feea1ff1c4e47236a08ab
It looks like the hyphen character has never been accepted in a workspace name. But for some reason, Bazel didn't error out in some cases; for instance, new workspaces declared with |
Gerrit Code Review and JGit projects are using hyphen character in workspace names for years, started from Bazel 0.6. See this CL: [1] from July 2018, quoting the commit message:
[1] https://gerrit-review.googlesource.com/c/gerrit/+/183530 |
Do you have a repro for this? I'd like to understand what changed exactly. I had the same error with Bazel 3.4.1 (and previous versions):
|
Repro:
|
Try to build gerrit project from HEAD (https://gerrit.googlesource.com/gerrit/):
With 3.4.1 it worked, no errors reported even with "foo-bar" external workspace names. |
#11837 (comment) is correct, it appears allowing hyphens was a misbug. |
@davido: This looks like log spam rather than a build failure. There seem to be entirely different paths forward
We will need @alandonovan to weigh in on the choice. |
I see another option: Revert the root cause for this regression: 2436a35 and accept dot and hyphens in point release 3.5. Announce that starting from Bazel 4.0 dot and hyphens are not supported any more in workspace names and roll forward: 2436a35. Moreover change the API and make it no only log spam but a real build breakage. |
TensorFlow also uses hyphens in workspace names, at least in some cases:
|
Note, that in Bazel 3.5.0rc2 the hyphen char is accepted in workspace name. In the error message you pasted: |
We should allow hyphens; this is now done. I would go a step further and say we should allow any printable character except the three required for label parsing: @, :, and /. (I regard Blaze's totalitarian inspection of every string it accepts as a youthful mistake.) |
Let's keep it to just the things we need for now... As we've observed here it's a lot easier to allow a new char than realize we made a mistake and try to take it back. |
That would mean that we should allow dot character and we are done, right (hyphen was already added in my recent PR)? |
Correct. |
I'm counting this as concensus.
|
I'm not sure this cherrypick is necessary. The root cause is that Bazel will evaluate and report errors from workspace files when it shouldn't. The use of dot and dashes is just one example from the bug report above. That doesn't mean anything regarding what symbols the other projects are using. |
RELNOTES: Dot ('.') is now allowed in workspace names. See #11837. PiperOrigin-RevId: 327160423
RELNOTES: Dot ('.') is now allowed in workspace names. See #11837. PiperOrigin-RevId: 327160423
@davido This should be resolved in 3.5.0rc3 in 2 ways.
I've done my own local tests on the candidate. Please LMK if you still see this issue with that. |
Thanks. Will test 3.5.0rc3 later today and let you know the result. |
You're the best.
…On Tue, Aug 18, 2020 at 10:19 AM David Ostrovsky ***@***.***> wrote:
@aiuto <https://github.com/aiuto>
Thanks. Will test 3.5.0rc3 later today and let you know the result.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11837 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHBOYEFDTJL556NSOULSBKEWZANCNFSM4PHO5XFQ>
.
|
Confirmed, that 3.5.0rc3 works as expected. Thanks again for your help. $ bazel version
Build label: 3.5.0rc3
$ bazel build :release
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 3778213c-4029-486a-b8f3-ec8185b3bfa4
INFO: Analyzed target //:release (1297 packages loaded, 42305 targets configured).
INFO: Found 1 target...
INFO: From Bundling JavaScript plugins/delete-project/delete-project-bundle.js [rollup]:
plugins/delete-project/gr-delete-repo/plugin.js → bazel-out/k8-fastbuild/bin/plugins/delete-project/delete-project-bundle.js...
created bazel-out/k8-fastbuild/bin/plugins/delete-project/delete-project-bundle.js in 161ms
INFO: From Bundling JavaScript polygerrit-ui/app/gr-app-bundle-js.js [rollup]:
bazel-out/k8-fastbuild/bin/polygerrit-ui/app/_pg_ts_out/elements/gr-app.js → bazel-out/k8-fastbuild/bin/polygerrit-ui/app/gr-app-bundle-js.js...
created bazel-out/k8-fastbuild/bin/polygerrit-ui/app/gr-app-bundle-js.js in 25.6s
Target //:release up-to-date:
bazel-bin/release.war
INFO: Elapsed time: 203.822s, Critical Path: 140.59s
INFO: 762 processes: 638 remote cache hit, 65 linux-sandbox, 1 local, 58 worker.
INFO: Build completed successfully, 864 total actions |
RELNOTES: Dot ('.') is now allowed in workspace names. See #11837. PiperOrigin-RevId: 327160423
Baseline: 889bc0b Cherry picks: + d6b9469: Make no-op starlark transition not affect the output directory. + b37c51c: Add include_prefix and strip_include_prefix to cc_common.compile + 0ebb1d5: Delete --experimental_transparent_compression + 312e121: Remove --experimental_action_args + 7e6e855: Stop needlessly parsing WORKSPACE files from external repositories. + d4049f6: Allow hyphen char in workspace name + 0a35be1: Allow dot ('.') in workspace names. Incompatible changes: - The --experimental_process_wrapper_wait_fix flag (used purely to roll out a risky bug fix) has been removed. - Removed the --experimental_ui_deduplicate flag. - Bazel now correctly prefers Xcode versions in `/Applications` over any other paths, which resolves an issue with accidentally picking up an Xcode version from a Time Machine backup or network disk. In the improbable case that you relied on the old behavior and Bazel now picks up Xcode from the wrong location, you can fix it by moving that Xcode version to /Applications. New features: - cquery now follows aspects with --include_aspects. - cc_common.compile support for include_prefix/strip_include_prefix Important changes: - Add support to bazel/crosstool for building arm64 on macos aka darwin - Add opt in 'oso_prefix_is_pwd' feature for Apple builds - Add InstrumentedFilesInfo provider to Starlark globals. - Fixed resource shrinking when <overlayable/> tags are used. - Remove old incompatible flag --incompatible_symlinked_sandbox_expands_tree_artifacts_in_runfile s_tree. - Update coverage configuration for Python, filegroup, and shell script rules to distinguish between source and dependency attributes. - Add support to bazel/crosstool for building arm64e on macos aka darwin - Make filegroup always forward InstrumentedFilesProvider and not collect any sources directly. - Support signing key rotation in android_binary - Remove legacy handling of --extra_checks - Support signing key rotation in android_binary GO... - `--apple_bitcode` now takes an optional platform and only applies the Bitcode mode to that platform if present. The option may be provided multiple times. - Support signing key rotation in android_binary - NS_BLOCK_ASSERTIONS is now passed for all Apple architectures. - Major changes to reporting of Starlark errors and the call stack. (Please be alert to possible regressions, such as errors that lack relevant location information.) - Removed the flag --experimental_transparent_compression. - Removed the flag --experimental_action_args. - Stop needlessly parsing WORKSPACE files from external repositories. - Dot ('.') is now allowed in workspace names. See #11837. This release contains contributions from many people at Google, as well as Adam Gross, Andrew Suffield, Benjamin Peterson, bnczk, David Ostrovsky, Ed Schouten, Greg Estren, Grzegorz Lukasik, Holger Freyther, Kalle Johansson, Keith Smiley, Kerrick Staley, Kyle Teske, Mostyn Bramley-Moore, Ryan Beasley, Ryan Pavlik, Siggi Simonarson, Stiopa Koltsov, Ulf Adams, Xiaoyi Shi, Yannic Bonenberger, Yesudeep Mangalapilly.
Baseline: 889bc0b Cherry picks: + a7a0d48: Make no-op starlark transition not affect the output directory. + b37c51c: Add include_prefix and strip_include_prefix to cc_common.compile + f6ad35f: Delete --experimental_transparent_compression + 39bc97e: Remove --experimental_action_args + b970667: Stop needlessly parsing WORKSPACE files from external repositories. + e574d55: Allow hyphen char in workspace name + 9993785: Allow dot ('.') in workspace names. New features: - cc_common.compile support for include_prefix/strip_include_prefix Important changes: - Removed the flag --experimental_transparent_compression. - Removed the flag --experimental_action_args. - Stop needlessly parsing WORKSPACE files from external repositories. - Dot ('.') is now allowed in workspace names. See #11837. This release contains contributions from many people at Google, as well as David Ostrovsky.
Closes bazelbuild#11837. Closes bazelbuild#11838. PiperOrigin-RevId: 326286694
RELNOTES: Dot ('.') is now allowed in workspace names. See bazelbuild#11837. PiperOrigin-RevId: 327160423
Baseline: 889bc0b Cherry picks: + a7a0d48: Make no-op starlark transition not affect the output directory. + b37c51c: Add include_prefix and strip_include_prefix to cc_common.compile + f6ad35f: Delete --experimental_transparent_compression + 39bc97e: Remove --experimental_action_args + b970667: Stop needlessly parsing WORKSPACE files from external repositories. + e574d55: Allow hyphen char in workspace name + 9993785: Allow dot ('.') in workspace names. New features: - cc_common.compile support for include_prefix/strip_include_prefix Important changes: - Removed the flag --experimental_transparent_compression. - Removed the flag --experimental_action_args. - Stop needlessly parsing WORKSPACE files from external repositories. - Dot ('.') is now allowed in workspace names. See bazelbuild#11837. This release contains contributions from many people at Google, as well as David Ostrovsky.
RELNOTES: Dot ('.') is now allowed in workspace names. See #11837. PiperOrigin-RevId: 327160423
RELNOTES: Dot ('.') is now allowed in workspace names. See #11837. PiperOrigin-RevId: 327160423
Baseline: 889bc0b Cherry picks: + a7a0d48: Make no-op starlark transition not affect the output directory. + b37c51c: Add include_prefix and strip_include_prefix to cc_common.compile + f6ad35f: Delete --experimental_transparent_compression + 39bc97e: Remove --experimental_action_args + b970667: Stop needlessly parsing WORKSPACE files from external repositories. + e574d55: Allow hyphen char in workspace name + 9993785: Allow dot ('.') in workspace names. + b3ac8f6: Patch upb to fix build error with gcc 10 + 26cbf77: Patch upb to fix build error with gcc 10 (third_party) + f1f9411: Fix incorrect rule class digest when creating rules through macros. + 6b591a7: Prepare for bazel to run with shrunken r8.jar + 7a11752: Don't run DexFileMergerTest as it is not supported for all r8.jar's New features: - cc_common.compile support for include_prefix/strip_include_prefix Important changes: - Removed the flag --experimental_transparent_compression. - Removed the flag --experimental_action_args. - Stop needlessly parsing WORKSPACE files from external repositories. - Dot ('.') is now allowed in workspace names. See #11837. This release contains contributions from many people at Google, as well as David Ostrovsky.
Baseline: 889bc0b Cherry picks: + a7a0d48: Make no-op starlark transition not affect the output directory. + b37c51c: Add include_prefix and strip_include_prefix to cc_common.compile + f6ad35f: Delete --experimental_transparent_compression + 39bc97e: Remove --experimental_action_args + b970667: Stop needlessly parsing WORKSPACE files from external repositories. + e574d55: Allow hyphen char in workspace name + 9993785: Allow dot ('.') in workspace names. + b3ac8f6: Patch upb to fix build error with gcc 10 + 26cbf77: Patch upb to fix build error with gcc 10 (third_party) + f1f9411: Fix incorrect rule class digest when creating rules through macros. + 6b591a7: Prepare for bazel to run with shrunken r8.jar + 7a11752: Don't run DexFileMergerTest as it is not supported for all r8.jar's New features: - cc_common.compile support for include_prefix/strip_include_prefix Important changes: - Removed the flag --experimental_transparent_compression. - Removed the flag --experimental_action_args. - Stop needlessly parsing WORKSPACE files from external repositories. - Dot ('.') is now allowed in workspace names. See bazelbuild#11837. This release contains contributions from many people at Google, as well as David Ostrovsky.
Baseline: aa0d97c Cherry picks: + 32c88da: Patch RuleContext for android_binary.deps to restore legacy behavior. + db9fc88: android_test also needs the legacy behavior in RuleContext.getPrerequisites. + 144d514: Update android_sdk_repository to create a valid, but useless, repository + bb11f92: Patch upb to fix build error with gcc 10 + 9f06be4: Patch upb to fix build error with gcc 10 (third_party) + b67b75e: Fix issue where libtool_check_unique isn't found for sandbox builds Incompatible changes: - `--experimental_ui_limit_console_output` is removed. Users of `--experimental_ui_limit_console_output=1` for silencing terminal output should use `--ui_event_filters=` instead. - --proto:instantiation_stack must be enabled in addition to --record_rule_instantiation_callstack to see call stack in proto output from blaze query. New features: - cc_common.compile support for include_prefix/strip_include_prefix - Multiplexed persistent workers: Use --experimental_worker_max_multiplex_instances to configure the number of WorkRequests that are sent concurrently to one worker process. The --worker_max_instances flag will no longer be used to determine max instances for multiplex workers, since the two have different resource requirements. Multiplex workers will by default have a max instances of 8. Important changes: - The prelude file (//tools/build_rules:prelude_bazel) is now processed as a Starlark module, rather than being sourced into the BUILD file textually. This may cause slight breakages depending on the content of the prelude file. (Use of the prelude file is discouraged as it will be removed in the long term.) - Removed --experimental_ignore_deprecated_instrumentation_spec and cleaned up the old deprecated behavior. - Added CODEBASE.md, a description of the Bazel codebase. - Removed the flag --experimental_transparent_compression. - Removed the flag --experimental_action_args. - Stop needlessly parsing WORKSPACE files from external repositories. - Dot ('.') is now allowed in workspace names. See #11837. - This change can cause memory and performance regressions for some builds with C++ dependencies, due to extra actions being executed. RELNOTES: None - Building Android apps for legacy multi-dex (pre-L) now require a main-dex list if the application does not fit into a single DEX file. - Puts the experimental_worker_multiplex flag to use. - In Starlark, the Args object supports a new parameter file format 'flag_per_line', compatible with the Abseil flags library. - The flag --incompatible_no_support_tools_in_action_inputs is removed. - Support for NDK 21 added - Bazel will now skip printing action stdout/stderr contents if they exceed --experimental_ui_max_stdouterr_memory_bytes. - The Starlark interpreter now correctly emits an error if the operand of the first loop in a list comprehension refers to a variable bound by a later loop, such as y in this example: [e1 for x in f(y) in e2 for y in e3] # error: undefined y ^ This may cause latent dynamic errors to become static errors. - Added support for a 'supports-graceful-termination' execution requirement and tag, which causes Bazel to send a SIGTERM to any tagged actions before sending a delayed SIGKILL. This is to give actions, and more specifically tests, a chance to clean up after themselves. - Non-android targets can again be built when android_sdk_repository is present but invalid. This release contains contributions from many people at Google, as well as Benjamin Peterson, Daniel Wagner-Hall, Dave MacLachlan, David Ostrovsky, Emil Kattainen, George Gensure, Greg Estren, Keith Smiley, mai12, Mai Hussien, Michael Eisel, Per Halvor Tryggeseth, Ruixin Bao, Samuel Giddins, Steeve Morin, Thi Doan, Tom de Goede, Ulf Adams, Zhongpeng Lin.
RELNOTES: Dot ('.') is now allowed in workspace names. See bazelbuild/bazel#11837. PiperOrigin-RevId: 327160423
It seems that on Bazel@HEAD (e6cce76) hyphen character is not accepted any more in workspace name?
Am I missing something? I see these errors:
The error is reported for the
workspace
line, e.g. inexternal/log-api/WORKSPACE:2:10
:The build still succeeds.
The text was updated successfully, but these errors were encountered: