Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example to repro jdeps issue #855

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nkoroste
Copy link
Collaborator

@nkoroste nkoroste commented Oct 28, 2022

Fails with jdeps:

cd examples/jdesp_issue
bazel build //libKtAndroid1:src_main_kt --@io_bazel_rules_kotlin//kotlin/internal/jvm:experimental_prune_transitive_deps=True --@io_bazel_rules_kotlin//kotlin/internal/jvm:kotlin_deps=True

Passes without jdeps:

cd examples/jdesp_issue
bazel build //libKtAndroid1:src_main_kt --@io_bazel_rules_kotlin//kotlin/internal/jvm:experimental_prune_transitive_deps=True --@io_bazel_rules_kotlin//kotlin/internal/jvm:kotlin_deps=False

Error:

ERROR: /Users/nkorostelev/Snapchat/Dev/rules_kotlin/examples/jdesp_issue/libKtAndroid1/BUILD.bazel:3:19: KotlinCompile //libKtAndroid1:src_main_kt { kt: 1, java: 0, srcjars: 0 } for darwin_arm64 failed: (Exit 1): build failed: error executing command (from target //libKtAndroid1:src_main_kt)
  (cd /Users/nkorostelev/Snapchat/Dev/.cache/bazel/arm64/f7a5653e44abf3a0528c8c383a926394/execroot/__main__ && \
  exec env - \
    LC_CTYPE=en_US.UTF-8 \
    REPOSITORY_NAME=io_bazel_rules_kotlin \
  bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_kotlin/src/main/kotlin/build '--flagfile=bazel-out/darwin_arm64-fastbuild/bin/libKtAndroid1/src_main_kt-kt.jar-0.params')
# Configuration: 3222cb75a37bee8592598dc8e5437da815dc34e08dd4cee307b00b4cc8e60a77
# Execution platform: @local_config_platform//:host
error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class examples.deps.libktandroid2.KtDummy2, unresolved supertypes: examples.deps.libktandroid3.KtDummy3
Adding -Xextended-compiler-checks argument might provide additional information.

Probably caused by #807

In theory, I think if the build doesn't fail without jdeps then it should also not fail with jdeps - @aeremin thoughts?

@nkoroste
Copy link
Collaborator Author

nkoroste commented Nov 1, 2022

Probably caused by #807

I no longer think that this PR is an issue. As it fails just the same when I revert it.

@oliviernotteghem
Copy link
Contributor

oliviernotteghem commented Nov 3, 2022

Correct. Issue is not caused by #807, it's caused by JdepsGenExtension invoking supertypes() kotlintype API (here). This call will cause (lazy) resolution of the type, and will cause an error since corresponding class is missing on classpath.

Why is compilation succeed then? See Pavel's comment on this issue

having a type with missing supertypes doesn't always mean that the old error will be reported

So, your best bet is to fix your project and add the missing dep :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants