question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Targets placed under source code subdirectory named "external" fail to compile with "file not found" errors

See original GitHub issue

Description of the bug:

Consider a source code tree which has one of its directories named “external”:

"source root"
  | - foo
  |   | - dir with targets
  |   | - dir with more targets
  | - external
  |   | - dir with broken targets
  |   |   | - dir with more broken targets

It appears, that bazel (at least the version I’m using) can not correctly compile targets nested under top level “external” subdirectory.

I’m aware that bazel uses a subdirectory called “external” to store dependencies in the build tree, but this should not infringe on the ability of users to have a directory, so called, in their source tree.

What’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Rename one of the immediate subdirs of any source tree to “external”, try to build targets under that directory. I, obviously, had not tried all possible rules, but those I tried are broken (spurious “file not found” errors).

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

release 5.2.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What’s the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

Tough luck searching for issues with “external” key word in the query. 😃

Any other information, logs, or outputs that you want to share?

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
oakadcommented, Sep 5, 2022

https://github.com/oakad/bazel_issue_16220

Here.

This works:

bazel run externa:external

This does not:

bazel run external:external

The subdirs are a copy of each other, up to 1 letter in the name.

0reactions
fmeumcommented, Sep 15, 2022

The first thing that breaks with --experimental_sibling_repository_layout is Stardoc, so I expect the downstream pipeline to be deeply red. If @tetromino’s ongoing work ends up resolving that, that could be a good time to run a meaningful first pipeline.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make/Cmake subdirectory linking to external library fails
My main project has a subdirector that is a library. This library depends on a system library "triangle" (installed from source). The main ......
Read more >
Allow configure_file, custom_target and generator output file ...
Say I have a library project named foo and the project layout is ... docs/meson.build:15:0: ERROR: Output must not contain a path segment....
Read more >
Enhanced source file handling with target_sources() - Crascit -
Dependency information can be fully and robustly defined at the point where those dependencies are introduced.
Read more >
Tutorial on writing makefiles
Tutorial on writing makefiles. Do I need a makefile? A simple makefile. Using variables; Pattern rules. Phony targets; Working with several directories.
Read more >
CopyFiles@2 - Copy files v2 task - Microsoft Learn
Copy files from a source folder to a target folder using patterns matching file paths (not folder paths).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found