aspect-build / rules_aws

EXPERIMENTAL: Bazel Integration for Amazon Web Services
Other
10 stars 1 forks source link

[Bug]: Error loading Python lib libpython3.11.so.1.0 #82

Open njlr opened 1 month ago

njlr commented 1 month ago

What happened?

Try to run an s3_sync rule and get:

[64234] Error loading Python lib '/home/njlr/.cache/bazel/_bazel_njlr/9bce8694c865e66522f64bee08628579/execroot/__main__/bazel-out/k8-fastbuild/bin/external/aws/libpython3.11.so.1.0': dlopen: /home/njlr/.cache/bazel/_bazel_njlr/9bce8694c865e66522f64bee08628579/execroot/__main__/bazel-out/k8-fastbuild/bin/external/aws/libpython3.11.so.1.0: cannot open shared object file: No such file or directory

It will run successfully with --dry_run.

Version

Development (host) and target OS/architectures:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:    24.04
Codename:   noble

Output of bazel --version:

bazel 6.2.0

Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file:

# aspect_rules_aws
http_archive(
    name = "aspect_rules_aws",
    sha256 = "88371c9d38335e96de8dc2da9acbd5f93b2c861a836c4ad36a4c2103a42860d8",
    strip_prefix = "rules_aws-0.4.0",
    url = "https://github.com/aspect-build/rules_aws/releases/download/v0.4.0/rules_aws-v0.4.0.tar.gz",
)

######################
# rules_aws setup #
######################
# Fetches the rules_aws dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_aws//aws:repositories.bzl", "aws_register_toolchains", "rules_aws_dependencies")

rules_aws_dependencies()

aws_register_toolchains(
    name = "aws",
    aws_cli_version = "2.13.0",
)

Language(s) and/or frameworks involved:

-

How to reproduce

My target definition:

s3_sync(
  name = "s3_test",
  srcs = [ ":build" ],
  bucket = "my_test_bucket/test",
)

Any other information?

No response

njlr commented 1 month ago

There is a work-around to use the system installed aws CLI.

aws.sh

#!/usr/bin/env bash

set -e

aws "$@"

BUILD.bazel

sh_binary(
  name = "aws",
  srcs = [ "aws.sh" ],
)

s3_sync(
  name = "s3_test",
  srcs = [ ":build" ],
  bucket = "my_test_bucket/test",
  aws = ":aws",
)

This might not be so bad if you are using Nix flakes for reproducible environments, for example.