typedb / dependencies

Bazel dependency declarations for build tools reused across @vaticle repositories (only for @vaticle)
Mozilla Public License 2.0
12 stars 22 forks source link

artifacts.snapshot produced by //library/maven:update contains duplicates #152

Closed haikalpribadi closed 1 year ago

haikalpribadi commented 4 years ago

See the artifacts.snapshot file from @graknlabs_verification linked below.

https://github.com/graknlabs/verification/blob/82012a1904d838dd675b680985a25460353d8665/dependencies/maven/artifacts.snapshot

We can see that each dependency artifact is written twice: once with the version, and once without. Is this expected? This feels like a bug. Can we fix it so that it just outputs one artifact once just with the version?

lukas-slezevicius commented 2 years ago

We've noticed that repos such as typedb-client-java are still using the bash script update.sh and it looks like they should instead be using @vaticle_dependencies//library/maven:update.

Maybe this is because of this issue where the kotlin script isn't working as intended.

lolski commented 2 years ago

We can see that each dependency artifact is written twice: once with the version, and once without. Is this expected?

@haikalpribadi yes, it is expected and not a bug. It is the raw output produced by the bazel query, which is what the update script use under the hood.

We've noticed that repos such as typedb-client-java are still using the bash script update.sh and it looks like they should instead be using @vaticle_dependencies//library/maven:update.

@lukas-slezevicius The update.sh script actually calls @vaticle_dependencies//library/maven:update under the hood.

alexjpwalker commented 1 year ago

@lolski cc @haikalpribadi This is very easy to implement in the way described actually (although it does make the //library/maven:update code slightly weirder)

Each non-versioned @maven target is a jvm_import. Each versioned @maven target is an alias that aliases the non-versioned target.

Therefore we can halve the size of artifacts.snapshot by changing the invocation

bazel query @maven//...

to

bazel query 'kind(alias, @maven//...)'
client-java % bazel query 'kind(alias, @maven//...)'
@maven//:ch_qos_logback_logback_classic_1_2_7
@maven//:ch_qos_logback_logback_core_1_2_7
@maven//:com_eclipsesource_minimal_json_minimal_json_0_9_5
@maven//:com_electronwill_night_config_core_3_6_5
@maven//:com_electronwill_night_config_toml_3_6_5
@maven//:com_google_android_annotations_4_1_1_4
@maven//:com_google_api_grpc_proto_google_common_protos_2_0_1
@maven//:com_google_code_findbugs_annotations_3_0_1
@maven//:com_google_code_findbugs_jsr305_2_0_2
@maven//:com_google_code_gson_gson_2_8_6
@maven//:com_google_errorprone_error_prone_annotations_2_9_0
@maven//:com_google_guava_failureaccess_1_0_1
@maven//:com_google_guava_guava_30_1_jre
@maven//:com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava
@maven//:com_google_http_client_google_http_client_1_34_2
@maven//:com_google_j2objc_j2objc_annotations_1_3
@maven//:com_google_protobuf_protobuf_java_3_14_0
@maven//:commons_codec_commons_codec_1_11
@maven//:commons_io_commons_io_2_3
@maven//:commons_logging_commons_logging_1_2
@maven//:info_picocli_picocli_4_6_1
@maven//:io_cucumber_cucumber_core_5_1_3
@maven//:io_cucumber_cucumber_expressions_8_3_1
@maven//:io_cucumber_cucumber_gherkin_5_1_3
@maven//:io_cucumber_cucumber_gherkin_vintage_5_1_3
@maven//:io_cucumber_cucumber_java_5_1_3
@maven//:io_cucumber_cucumber_junit_5_1_3
@maven//:io_cucumber_cucumber_plugin_5_1_3
@maven//:io_cucumber_datatable_3_2_1
@maven//:io_cucumber_docstring_5_1_3
@maven//:io_cucumber_tag_expressions_2_0_4
@maven//:io_grpc_grpc_api_1_43_0
@maven//:io_grpc_grpc_context_1_43_0
@maven//:io_grpc_grpc_core_1_43_0
@maven//:io_grpc_grpc_netty_1_43_0
@maven//:io_grpc_grpc_protobuf_1_43_0
@maven//:io_grpc_grpc_protobuf_lite_1_43_0
@maven//:io_grpc_grpc_stub_1_43_0
@maven//:io_grpc_grpc_testing_1_43_0
@maven//:io_netty_netty_all_4_1_63_Final
@maven//:io_netty_netty_buffer_4_1_63_Final
@maven//:io_netty_netty_codec_4_1_63_Final
@maven//:io_netty_netty_codec_http2_4_1_63_Final
@maven//:io_netty_netty_codec_http_4_1_63_Final
@maven//:io_netty_netty_codec_socks_4_1_63_Final
@maven//:io_netty_netty_common_4_1_63_Final
@maven//:io_netty_netty_handler_4_1_63_Final
@maven//:io_netty_netty_handler_proxy_4_1_63_Final
@maven//:io_netty_netty_resolver_4_1_63_Final
@maven//:io_netty_netty_tcnative_boringssl_static_2_0_46_Final
@maven//:io_netty_netty_tcnative_classes_2_0_46_Final
@maven//:io_netty_netty_transport_4_1_63_Final
@maven//:io_opencensus_opencensus_api_0_28_0
@maven//:io_opencensus_opencensus_contrib_http_util_0_24_0
@maven//:io_perfmark_perfmark_api_0_23_0
@maven//:javax_annotation_javax_annotation_api_1_3_2
@maven//:junit_junit_4_12
@maven//:net_bytebuddy_byte_buddy_1_6_4
@maven//:net_bytebuddy_byte_buddy_agent_1_6_4
@maven//:net_jcip_jcip_annotations_1_0
@maven//:org_antlr_antlr4_runtime_4_8
@maven//:org_apache_commons_commons_compress_1_21
@maven//:org_apache_httpcomponents_httpclient_4_5_11
@maven//:org_apache_httpcomponents_httpcore_4_4_13
@maven//:org_apiguardian_apiguardian_api_1_1_0
@maven//:org_checkerframework_checker_qual_3_5_0
@maven//:org_codehaus_mojo_animal_sniffer_annotations_1_19
@maven//:org_hamcrest_hamcrest_2_2
@maven//:org_hamcrest_hamcrest_all_1_3
@maven//:org_hamcrest_hamcrest_core_1_3
@maven//:org_hamcrest_hamcrest_library_1_3
@maven//:org_mockito_mockito_core_2_6_4
@maven//:org_objenesis_objenesis_2_5
@maven//:org_slf4j_jcl_over_slf4j_1_7_32
@maven//:org_slf4j_log4j_over_slf4j_1_7_32
@maven//:org_slf4j_slf4j_api_1_7_32
@maven//:org_slf4j_slf4j_simple_1_7_32
@maven//:org_yaml_snakeyaml_1_25
@maven//:org_zeroturnaround_zt_exec_1_10
haikalpribadi commented 1 year ago

That makes total sense, @alexjpwalker , let's go with your suggestion!