cognitedata / bazel-snapshots

A mechanism for doing incremental deploys with Bazel
Apache License 2.0
10 stars 1 forks source link

Release snippet slightly incorrect #163

Closed kolloch closed 9 months ago

kolloch commented 1 year ago

I needed to use snapshots_deps instead of snapshots_dependencies.

http_archive(
    name = "com_cognitedata_bazel_snapshots",
    sha256 = "a756658bf1425eab7b9104c979ef7af885df3832db38469e200ce7433a7f2570",
    url = "https://github.com/cognitedata/bazel-snapshots/releases/download/0.7.6/snapshots-0.7.6.tar",
)

load("@com_cognitedata_bazel_snapshots//snapshots:dependencies.bzl", "snapshots_deps")

snapshots_deps()

load("@com_cognitedata_bazel_snapshots//snapshots:repositories.bzl", "snapshots_register_toolchains")

snapshots_register_toolchains()

Thanks!

kolloch commented 1 year ago

But unfortunately, even with that snippet, it doesn't work for me but results in the following error:

**❯ bazel run snapshots
INFO: Streaming build results to: https://app.buildbuddy.io/invocation/0e608bfc-b43a-4980-b2ab-047ba4aa0473
ERROR: /home/peter/.cache/bazel/_bazel_peter/8a0e5e440c2a644038228219d25b0c32/external/com_google_cloud_go_storage/BUILD.bazel:5:11: in go_library rule @com_google_cloud_go_storage//:storage: alias '@com_google_cloud_go//internal:go_default_library' referring to target '@com_google_cloud_go//internal:internal' is not visible from target '@com_google_cloud_go_storage//:storage'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /home/peter/.cache/bazel/_bazel_peter/8a0e5e440c2a644038228219d25b0c32/external/com_google_cloud_go_storage/BUILD.bazel:5:11: in go_library rule @com_google_cloud_go_storage//:storage: alias '@com_google_cloud_go//internal/optional:go_default_library' referring to target '@com_google_cloud_go//internal/optional:optional' is not visible from target '@com_google_cloud_go_storage//:storage'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /home/peter/.cache/bazel/_bazel_peter/8a0e5e440c2a644038228219d25b0c32/external/com_google_cloud_go_storage/BUILD.bazel:5:11: in go_library rule @com_google_cloud_go_storage//:storage: alias '@com_google_cloud_go//internal/trace:go_default_library' referring to target '@com_google_cloud_go//internal/trace:trace' is not visible from target '@com_google_cloud_go_storage//:storage'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /home/peter/.cache/bazel/_bazel_peter/8a0e5e440c2a644038228219d25b0c32/external/com_google_cloud_go_storage/BUILD.bazel:5:11: in go_library rule @com_google_cloud_go_storage//:storage: alias '@com_google_cloud_go//internal/version:go_default_library' referring to target '@com_google_cloud_go//internal/version:version' is not visible from target '@com_google_cloud_go_storage//:storage'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /home/peter/.cache/bazel/_bazel_peter/8a0e5e440c2a644038228219d25b0c32/external/com_google_cloud_go_storage/BUILD.bazel:5:11: Analysis of target '@com_google_cloud_go_storage//:storage' failed
WARNING: errors encountered while analyzing target '//:snapshots': it will not be built
INFO: Analyzed target //:snapshots (331 packages loaded, 12453 targets configured).
INFO: Found 0 targets...
INFO: From BazelWorkspaceStatusAction stable-status.txt:
Getting workspace status...
Getting docker config from /home/peter/.docker/config.json
Found docker config at /home/peter/.docker/config.json
Outputting docker config
ERROR: command succeeded, but not all targets were analyzed
INFO: Elapsed time: 11.967s, Critical Path: 0.04s
INFO: 1 process: 1 internal.
ERROR: Build failed. Not running target
INFO: Streaming build results to: https://app.buildbuddy.io/invocation/0e608bfc-b43a-4980-b2ab-047ba4aa0473
FAILED: Build did NOT complete successfully
kolloch commented 1 year ago

The build from source seems to work:


http_archive(
    name = "com_cognitedata_bazel_snapshots",
    sha256 = "a756658bf1425eab7b9104c979ef7af885df3832db38469e200ce7433a7f2570",
    url = "https://github.com/cognitedata/bazel-snapshots/releases/download/0.7.6/snapshots-0.7.6.tar",
)

load("@com_cognitedata_bazel_snapshots//snapshots:dependencies.bzl", "snapshots_deps")

snapshots_deps()

load("@com_cognitedata_bazel_snapshots//snapshots:repositories.bzl", "snapshots_register_toolchains")

snapshots_register_toolchains(
    name = "snapshots",
    from_source = True,
)```