Error compiling vendored openssl for tokio-native-tls on Ubuntu 22.04 on GitHub Actions

I have a Rust program that can be used to create TLS connections, with feature switches for compiling with rustls, tokio-native-tls, or tokio-native-tls with vendored OpenSSL. A couple days ago[1], the daily GitHub Actions run started failing for the MSRV (1.74) and Rust beta jobs with the following error:

/usr/bin/ld: /home/runner/work/confab/confab/target/debug/deps/libopenssl_sys-62377856b80d63bc.rlib(libcrypto-lib-e_afalg.o): in function `atoi':
            /usr/include/stdlib.h:483: undefined reference to `__isoc23_strtol'
            /usr/bin/ld: /home/runner/work/confab/confab/target/debug/deps/libopenssl_sys-62377856b80d63bc.rlib(libdefault-lib-rand_unix.o): in function `atoi':
            /usr/include/stdlib.h:483: undefined reference to `__isoc23_strtol'
            /usr/bin/ld: /usr/include/stdlib.h:483: undefined reference to `__isoc23_strtol'
            collect2: error: ld returned 1 exit status

This failure happened to correspond to GitHub Actions rolling back the ubuntu-latest image from Ubuntu 24.04 to 22.04 for some reason (I couldn't find an explanation in a quick look through Ubuntu-latest workflows will use Ubuntu-24.04 image · Issue #10636 · actions/runner-images · GitHub). Interestingly, when ubuntu-latest was 22.04 initially, the CI jobs succeeded.

Now, I don't know what to do in order to fix the compiler error. Presumably, Rust isn't linking some library that it needs to link, but I don't know whether that's because the 22.04 images are buggy or if some sort of bitrot occurred in one of tokio-native-tls's dependencies. Any help?


  1. The CI jobs have actually been failing for the past two weeks due to cargo-deny complaining about a yanked dependency, but only the past couple days have seen this specific error. ↩︎

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.