Giter Club home page Giter Club logo

Comments (13)

damienmg avatar damienmg commented on June 15, 2024

/cc @lberki and @dslomov

Apparently there is a problem related to aspect and alias rules. I though it was fixed?

from eclipse.

psaville-google avatar psaville-google commented on June 15, 2024

Any news on this? Should I be pulling the project and trying to fix locally to make progress on this issue?

from eclipse.

damienmg avatar damienmg commented on June 15, 2024

@psaville-google sorry, @dslomov is on holidays.

from eclipse.

damienmg avatar damienmg commented on June 15, 2024

@psaville-google Have you tried with Bazel @Head?

from eclipse.

lberki avatar lberki commented on June 15, 2024

Which Bazel version are you using? I checked and this should be fixed at HEAD, probably in

bazelbuild/bazel@6c3fe26

from eclipse.

lberki avatar lberki commented on June 15, 2024

My workspace is as follows:

WORKSPACE:

maven_jar(
    name="maven_jar",
    artifact="com.google.guava:guava:18.0",
    sha1="cce0823396aa693798f8882e64213b1772032b09")

bind(name="library", actual="@maven_jar//jar")

java/BUILD:

config_setting(
    name = "local",
    values = {"define": "localjars=true"},
)

alias(
    name = "a",
    actual = select({
        ":local": "locallib",
        "//conditions:default": "//external:library",
    }),
)

java_library(
    name = "locallib",
    srcs = ["Local.java"],
)

java_binary(
    name = "bin",
    main_class = "a.Wtf",
    runtime_deps = [":a"],
)

Both

bazel build --nobuild //java:bin --nocheck_visibility and
bazel build --nobuild //java:bin --nocheck_visibility --define=localjars=true

Work as expected.

from eclipse.

lberki avatar lberki commented on June 15, 2024

@kchodorow : I'm surprised that the dependency on @maven_jar//jar requires --nocheck_visibility. Is this a known issue?

from eclipse.

lberki avatar lberki commented on June 15, 2024

@dmarting: I indeed forget about the e4b aspect and now I can actually repro it. Clickety-click...

from eclipse.

psaville-google avatar psaville-google commented on June 15, 2024

lberki,

Your workspace isn't quite how I set it up. I'll clarify here just for
completeness.

WORKSPACE:

maven_jar(
  name = "maven_liba",
  ...
)

bind(
  name = "liba",
  actual = "//local:liba"
)

local/BUILD:

config_setting(
  name = "local",
  ... some define to trigger localjars
)

java_library(
  name = "local_liba",
  srcs = ["local_liba.jar"],
)

alias(
  name = "liba",
  actual = select({
    ":local": ":local_liba",
    "//conditions:default": "@maven_liba//jar"
)

src/java/some-package/BUILD:

java_library(
  name = "doesnt_matter",
  srcs = glob(...),
  deps = [
    "//external:liba",
    ...
  ],
)

Thus, the some-package java can always depend on //external:liba.
We have a jenkins job that downloads an hermetic snapshot of libraries (may
come from another git repo) and builds using the additional --define flags.

The eclipse project now needs to evaluate the //external:liba dependency as
the @maven_liba//jar dependency.

Thanks for working on this - much appreciated.

from eclipse.

psaville-google avatar psaville-google commented on June 15, 2024

Sorry for pinging a closed issue.

When and how does your updatesite get updated, after change commits?

Thanks.

from eclipse.

damienmg avatar damienmg commented on June 15, 2024

Manually :) but this was a problem on the Bazel side so it does not need
any change to the plugin only to Bazel (so basically recompile bazel from
master and you should have the bug fixed).

On Thu, Sep 1, 2016, 10:17 PM psaville-google [email protected]
wrote:

Sorry for pinging a closed issue.

When and how does your updatesite get updated, after change commits?

Thanks.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#6 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADjHfxzJdDUeziCcrHyyT1TNLyzKgXooks5qlzLPgaJpZM4Jm7Sa
.

from eclipse.

psaville-google avatar psaville-google commented on June 15, 2024

I pulled a local bazel repo clone and built bazel from HEAD yesterday in order to test if this is working with e4b.

Sadly, it still doesn't work.

*** Running [/usr/local/bin/bazel, --watchfs, build, --package_path, %workspace%:/Users/psaville/eclipse/java-neon/Eclipse.app/Contents/Eclipse/../../../../../.p2/pool/plugins/com.google.devtools.bazel.e4b_0.0.1.201604271316/resources, --experimental_interleave_loading_and_analysis, --strategy=Javac=worker, --noexperimental_check_output_files, --aspects=tools/must/be/unique/e4b_aspect.bzl%e4b_aspect, //java/..., //javatests/..., //example/java/..., //scripts/testing/tee:setup_tee, //production/kubernetes/..., //example/java/..., //scs/rapidsync:all] from /Users/psaville/git-gerrit/skybox3 ***
WARNING: Option 'experimental_interleave_loading_and_analysis' is deprecated.
____Loading...
ERROR: /private/var/tmp/_bazel_psaville/33cf99881007ceae82889b09c83f121b/external/maven_prodx_libprodx/jar/BUILD:2:1: in //tools/must/be/unique:e4b_aspect.bzl%e4b_aspect aspect on java_import rule @maven_prodx_libprodx//jar:jar: 
Traceback (most recent call last):
    File "/private/var/tmp/_bazel_psaville/33cf99881007ceae82889b09c83f121b/external/maven_prodx_libprodx/jar/BUILD", line 2
        //tools/must/be/unique:e4b_aspect.bzl%e4b_aspect(...)
    File "/Users/psaville/.p2/pool/plugins/com.google.devtools.bazel.e4b_0.0.1.201604271316/resources/tools/must/be/unique/e4b_aspect.bzl", line 101, in _aspect_impl
        (java_rule_ide_info, java_ide_resol...) = java_rule_ide_info(target, ctx)
Variable 'java_rule_ide_info' is referenced before assignment. The variable is defined in the global scope..
ERROR: /private/var/tmp/_bazel_psaville/33cf99881007ceae82889b09c83f121b/external/maven_prodx_flags/jar/BUILD:2:1: in //tools/must/be/unique:e4b_aspect.bzl%e4b_aspect aspect on java_import rule @maven_prodx_flags//jar:jar: 
Traceback (most recent call last):
    File "/private/var/tmp/_bazel_psaville/33cf99881007ceae82889b09c83f121b/external/maven_prodx_flags/jar/BUILD", line 2
        //tools/must/be/unique:e4b_aspect.bzl%e4b_aspect(...)
    File "/Users/psaville/.p2/pool/plugins/com.google.devtools.bazel.e4b_0.0.1.201604271316/resources/tools/must/be/unique/e4b_aspect.bzl", line 101, in _aspect_impl
        (java_rule_ide_info, java_ide_resol...) = java_rule_ide_info(target, ctx)
Variable 'java_rule_ide_info' is referenced before assignment. The variable is defined in the global scope..
ERROR: Analysis of aspect '/tools/must/be/unique/e4b_aspect.bzl%e4b_aspect of //example/java:ExampleServer' failed; build aborted.

from eclipse.

damienmg avatar damienmg commented on June 15, 2024

:/ Can you open a separate bug?

from eclipse.

Related Issues (20)

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.