Skip to content

Build error for dependency base64 cannot find value `STANDARD` in crate `base64`

Some error occurs when I'm building sequoia-openpgp-1.11.0, which will still occur in the latest version for related code does not change.

error[E0425]: cannot find function `decode_config` in crate `base64`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sequoia-openpgp-1.11.0/src/armor/base64_utils.rs:166:19
    |
166 |     match base64::decode_config(&bytes, base64::STANDARD) {
    |                   ^^^^^^^^^^^^^ not found in `base64`

error[E0425]: cannot find value `STANDARD` in crate `base64`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sequoia-openpgp-1.11.0/src/armor/base64_utils.rs:166:49
    |
166 |     match base64::decode_config(&bytes, base64::STANDARD) {
    |                                                 ^^^^^^^^ not found in `base64`
    |
help: consider importing this constant
    |
1   | use base64::alphabet::STANDARD;
    |
help: if you import `STANDARD`, refer to it directly
    |
166 -     match base64::decode_config(&bytes, base64::STANDARD) {
166 +     match base64::decode_config(&bytes, STANDARD) {
    |

error[E0425]: cannot find function `encode_config` in crate `base64`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sequoia-openpgp-1.11.0/src/armor.rs:377:41
    |
377 |             self.sink.write_all(base64::encode_config(
    |                                         ^^^^^^^^^^^^^ not found in `base64`

error[E0425]: cannot find value `STANDARD` in crate `base64`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sequoia-openpgp-1.11.0/src/armor.rs:378:38
    |
378 |                 &self.stash, base64::STANDARD).as_bytes())?;
    |                                      ^^^^^^^^ not found in `base64`
    |
help: consider importing this constant
    |
31  | use base64::alphabet::STANDARD;
    |
help: if you import `STANDARD`, refer to it directly
    |
378 -                 &self.stash, base64::STANDARD).as_bytes())?;
378 +                 &self.stash, STANDARD).as_bytes())?;
    |

error[E0425]: cannot find function `encode_config` in crate `base64`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sequoia-openpgp-1.11.0/src/armor.rs:404:24
    |
404 |                base64::encode_config(&bytes, base64::STANDARD_NO_PAD),
    |                        ^^^^^^^^^^^^^ not found in `base64`

error[E0425]: cannot find value `STANDARD_NO_PAD` in crate `base64`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/sequoia-openpgp-1.11.0/src/armor.rs:404:54
    |
404 |                base64::encode_config(&bytes, base64::STANDARD_NO_PAD),
    |                                                      ^^^^^^^^^^^^^^^ not found in `base64`

The reason is that the base64 crate published a new version v0.20.0 with its APIs changed, and the Cargo.toml in sequoia-openpgp says that base64 = ">=0.12" in here, which will choose v0.20.0 thus get failed.

I suggest that

  • Option 1: base64 = ">=0.12" -> base64 = "0.13"
  • Option 2: impl code with base64 0.20.0's new API
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information