Coder Social home page Coder Social logo

bazel-issue-15662's Introduction

This repository demonstrates an inconsistency in the behavior of an alias when used with the rlocation/manifest system provided by the bash runfiles in @bazel_tools.

We define a simple sh_binary called \\:foo1, and create an alias target \\:foo2 that refers to \\:foo1. We then create another sh_binary called \\:bar that depends on the foo1 and foo2 target and resolves them using $(rlocation ...).

The desired behavior would be for rlocation calls on both targets to resolve to the same path, since they represent the same resource. However, the actual behavior is that true target returns a result, while the alias is not found.

$ bazel run //:bar
INFO: Analyzed target //:bar (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:bar up-to-date:
  bazel-bin/bar
INFO: Elapsed time: 0.113s, Critical Path: 0.00s
INFO: 2 processes: 2 internal.
INFO: Build completed successfully, 2 total actions
INFO: Build completed successfully, 2 total actions
---------------------------------------------------
INFO[runfiles.bash]: rlocation(com_example_bazel/foo1): start
INFO[runfiles.bash]: rlocation(com_example_bazel/foo1): looking in RUNFILES_MANIFEST_FILE (/home/pras/.cache/bazel/_bazel_pras/e1db911261e74a0af01d8103864c3772/execroot/com_example_bazel/bazel-out/k8-fastbuild/bin/bar.runfiles_manifest)
INFO[runfiles.bash]: rlocation(com_example_bazel/foo1): found in manifest as (/home/pras/.cache/bazel/_bazel_pras/e1db911261e74a0af01d8103864c3772/execroot/com_example_bazel/bazel-out/k8-fastbuild/bin/foo1)
---------------------------------------------------
INFO[runfiles.bash]: rlocation(com_example_bazel/foo2): start
INFO[runfiles.bash]: rlocation(com_example_bazel/foo2): looking in RUNFILES_MANIFEST_FILE (/home/pras/.cache/bazel/_bazel_pras/e1db911261e74a0af01d8103864c3772/execroot/com_example_bazel/bazel-out/k8-fastbuild/bin/bar.runfiles_manifest)
INFO[runfiles.bash]: rlocation(com_example_bazel/foo2): not found in manifest
---------------------------------------------------
The following rlocation outputs should be the same:
  '$(rlocation com_example_bazel/foo1)' = /home/pras/.cache/bazel/_bazel_pras/e1db911261e74a0af01d8103864c3772/execroot/com_example_bazel/bazel-out/k8-fastbuild/bin/foo1
  '$(rlocation com_example_bazel/foo2)' = 

bazel-issue-15662's People

Contributors

psigen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.