Skip to content

New aws-lc-sys dependency breaks max-pure on powerpc64le #2338

@EliahKagan

Description

@EliahKagan

Current behavior 😯

#2328 upgraded reqwest. As noted in #2328 (comment), this replaced ring with aws-lc-sys. This was allowlisted as a recognized *-sys dependency in 28b675e, which fixed CI and allowed #2328 to be integrated. Subsequently, a patch release of gix-transport was made. But no release of the gitoxide crate has yet been made since.

This change breaks the release.yml workflow. Specifically, the workflow depends on being able to build gix and ein binaries for a variety of architectures. Failure to do so will not prevent gitoxide from being published to crates.io, and with the way we currently do things it won't prevent a GitHub release from being made, but it does block attaching any assets to that GitHub release.

It looks like the only broken architecture is powerpc64le. Notably, max-pure is broken. Here's the failing CI job, where the failure is reported. This is in my fork, where I test releasing.

(I actually do not test it regularly. I found this because #2337 modifies release.yml, so I tested it on my fork with a test tag on a commit in that PR, and I found that it broke in a way that didn't make sense for any of the changes there, and that the build failed when retried. So I made a test tag at the tip of the main branch in my fork and tested with that, and found it produced the same failure. The above-linked CI run is from that tag at the current tip of main.)

Expected behavior 🤔

The release workflow should be able to build max-pure for all the targets it's been able to build it on for a long time and that we regularly release binaries for.

I'm also not clear on the justification for allowing max-pure to link to aws-lc-sys in the first place. It's a binding to the aws-lc library. This looks like a C library, with some code in assembly language and some in C++ (though perhaps the latter is just bindings). The error messages (shown below) are failures to link to missing symbols in an object file named bcm.c.o; this name suggests it was built from bcm.c. My understanding in general of the reason only recognized -sys crates are allowed for max-pure is that, otherwise, we get native code that doesn't satisfy goals for max-pure.

I'm open to the possibility that the aws-lc-sys dependency doesn't represent a worsening situation for the "purity" of max-pure and should be allowed, but I think this should be explained somewhere, and I don't know of any reason why that would be the case.

As far as releasing goes, my guess would be that not many people are using the powerpc64le binary assets that we attach to GitHub releases. So, if absolutely necessary, we can remove it. I would not rush to assume that this is a thing that makes sense to do with a max-pure build.

Git behavior

Not applicable, as far as I know.

Steps to reproduce 🕹

Enable CI in a fork, make a tag that satisfies the test tag pattern, and push the tag.

The most relevant part of that output in the test run in my fork is:

error: linking with `powerpc64le-linux-gnu-gcc` failed: exit status: 1
  |
  = note:  "powerpc64le-linux-gnu-gcc" "-m64" "<1 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib" "<sysroot>/lib/rustlib/powerpc64le-unknown-linux-gnu/lib/libcompiler_builtins-*.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp<sysroot>c30l1yS/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/target/powerpc64le-unknown-linux-gnu/release-github/build/aws-lc-sys-6e5ca9a1cadc0b76/out/build/artifacts" "-L" "<sysroot>/lib<sysroot>lib/powerpc64le-unknown-linux-gnu/lib" "-o" "/target/powerpc64le-unknown-linux-gnu/release-github/deps/gix-6a041025ea6e1e8e" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o):(.toc+0xa8): undefined reference to `aws_lc_0_34_0_aes_hw_encrypt'
          /usr/lib/gcc-cross/powerpc64le-linux-gnu/5/../../../../powerpc64le-linux-gnu/bin/ld: BFD (GNU Binutils for Ubuntu) 2.26.1 assertion fail ../../bfd/elf64-ppc.c:14746
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o):(.toc+0xb0): undefined reference to `aws_lc_0_34_0_aes_hw_ctr32_encrypt_blocks'
          /usr/lib/gcc-cross/powerpc64le-linux-gnu/5/../../../../powerpc64le-linux-gnu/bin/ld: BFD (GNU Binutils for Ubuntu) 2.26.1 assertion fail ../../bfd/elf64-ppc.c:14746
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o):(.toc+0xd0): undefined reference to `aws_lc_0_34_0_gcm_gmult_p8'
          /usr/lib/gcc-cross/powerpc64le-linux-gnu/5/../../../../powerpc64le-linux-gnu/bin/ld: BFD (GNU Binutils for Ubuntu) 2.26.1 assertion fail ../../bfd/elf64-ppc.c:14746
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o):(.toc+0xd8): undefined reference to `aws_lc_0_34_0_gcm_ghash_p8'
          /usr/lib/gcc-cross/powerpc64le-linux-gnu/5/../../../../powerpc64le-linux-gnu/bin/ld: BFD (GNU Binutils for Ubuntu) 2.26.1 assertion fail ../../bfd/elf64-ppc.c:14746
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aws_lc_0_34_0_AES_decrypt':
          bcm.c:(.text.aws_lc_0_34_0_AES_decrypt+0x2c): undefined reference to `aws_lc_0_34_0_aes_hw_decrypt'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aws_lc_0_34_0_AES_encrypt':
          bcm.c:(.text.aws_lc_0_34_0_AES_encrypt+0x2c): undefined reference to `aws_lc_0_34_0_aes_hw_encrypt'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aws_lc_0_34_0_AES_set_encrypt_key':
          bcm.c:(.text.aws_lc_0_34_0_AES_set_encrypt_key+0x50): undefined reference to `aws_lc_0_34_0_aes_hw_set_encrypt_key'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aws_lc_0_34_0_AES_set_decrypt_key':
          bcm.c:(.text.aws_lc_0_34_0_AES_set_decrypt_key+0x50): undefined reference to `aws_lc_0_34_0_aes_hw_set_decrypt_key'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `ctr_drbg_update.part.241':
          bcm.c:(.text.ctr_drbg_update.part.241+0x3cc): undefined reference to `aws_lc_0_34_0_aes_hw_set_encrypt_key'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aws_lc_0_34_0_CRYPTO_ghash_init':
          bcm.c:(.text.aws_lc_0_34_0_CRYPTO_ghash_init+0xd8): undefined reference to `aws_lc_0_34_0_gcm_init_p8'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aead_aes_gcm_init_impl':
          bcm.c:(.text.aead_aes_gcm_init_impl+0x80): undefined reference to `aws_lc_0_34_0_aes_hw_set_encrypt_key'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aws_lc_0_34_0_CTR_DRBG_init':
          bcm.c:(.text.aws_lc_0_34_0_CTR_DRBG_init+0x42c): undefined reference to `aws_lc_0_34_0_aes_hw_set_encrypt_key'
          /tmp/rustc30l1yS/libaws_lc_sys-44ed5b0b828a8ffb.rlib(bcm.c.o): In function `aws_lc_0_34_0_CTR_DRBG_reseed':
          bcm.c:(.text.aws_lc_0_34_0_CTR_DRBG_reseed+0x460): undefined reference to `aws_lc_0_34_0_aes_hw_set_encrypt_key'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

(However, it may be that the surrounding output is also illuminating, I'm not sure.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions