Skip to content

Windows, external repositories: correctness bug with Starlark rule in external repo #7063

Closed

Description

@laszlocsomor

Description of the problem / feature request:

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.

https://github.com/laszlocsomor/projects/tree/81325c41c015dfe02d7639ab8940f52d72da8093/bazel/starlark-rule-change-no-picked-up-from-repo

What operating system are you running Bazel on?

Windows 10

What's the output of bazel info release?

release 0.21.0

Activity

  1. laszlocsomor commented on Jan 9, 2019

    @laszlocsomor
    ContributorAuthor

    Workaround: call bazel shutdown then bazel run //src:foo again.

  2. laszlocsomor commented on Jan 9, 2019

    @laszlocsomor
    ContributorAuthor

    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.

  3. self-assigned this
    on Jan 9, 2019
  4. added
    P1
    area-Windows
    on Jan 9, 2019
  5. laszlocsomor commented on Jan 9, 2019

    @laszlocsomor
    ContributorAuthor

    My theory is correct:

    • 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
  6. laszlocsomor commented on Jan 9, 2019

    @laszlocsomor
    ContributorAuthor

    Could be the same bug as #6351

  7. added
    team-OSS
    on Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1area-Windowsteam-OSStype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions