You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows, external repositories: correctness bug with Starlark rule in external repo #7063
P1I'll work on this now. (Assignee required)area-WindowsWindows-specific issues and feature requeststeam-OSSIssues for the Bazel OSS team: installation, release processBazel packaging, websitetype: bug
On Windows, if //src:foo depends on @repo2//:gen, which is a Starlark rule whose definition is in @repo1//:gen_cc.bzl, then changing gen_cc.bzl does not trigger a rebuild of //src:foo even though it should.
On Linux, the same thing works correctly.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I bet this is some symlink-related issue. I suspect Bazel on Windows copies files in the roots of external repositories instead of symlinking them, and that's why it doesn't notice the change.
moving gen_cc.bzl to a subdirectory sub in under repo1 will result in correct behavior, because <output_base>/external/repo1/sub is a junction pointing to the real sub directory
adding a file to or removing a file from the root of repo1 between builds is picked up, but modifying a file is not; to see this, check the contents of <output_base>/external/repo1
changing new_local_repository to local_repository and adding a BUILD file to repo1 will result in correct behavior, even when the bzl file is in repo1's root; therefore this is a bug with new_local_repository, and this bug might actually be a duplicate of Repository redefinition using skylark rules are ok but should error out. #3908
P1I'll work on this now. (Assignee required)area-WindowsWindows-specific issues and feature requeststeam-OSSIssues for the Bazel OSS team: installation, release processBazel packaging, websitetype: bug
Activity
laszlocsomor commentedon Jan 9, 2019
Workaround: call
bazel shutdownthenbazel run //src:fooagain.laszlocsomor commentedon Jan 9, 2019
I bet this is some symlink-related issue. I suspect Bazel on Windows copies files in the roots of external repositories instead of symlinking them, and that's why it doesn't notice the change.
I'll proceed to check this theory.
laszlocsomor commentedon Jan 9, 2019
My theory is correct:
gen_cc.bzlto a subdirectorysubin underrepo1will result in correct behavior, because<output_base>/external/repo1/subis a junction pointing to the realsubdirectory<output_base>/external/repo1new_local_repositorytolocal_repositoryand adding a BUILD file torepo1will result in correct behavior, even when the bzl file is in repo1's root; therefore this is a bug withnew_local_repository,and this bug might actually be a duplicate of Repository redefinition using skylark rules are ok but should error out. #3908laszlocsomor commentedon Jan 9, 2019
Could be the same bug as #6351
Windows: fix new_local_repository correctness bug