0
0

メモ: macports-2.10.0でcargo-cのbuildに失敗し、格闘した件

Posted at

Issue

port
% port install cargo-c

のビルドの途中で止まってしまった。timeというコンポーネントのtime-0.3.21/time/src/format_description/parse/mod.rsというファイルのコンパイルエラー(rust)が原因で、このあたりこのあたりを踏んでしまっているようだ。

Solution

前述のリンクのバグレポートだと、最新版にバージョンアップで解決した、とある。なので最初に、

Portfile
% nl -ba ${macports_root}/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/cargo-c/Portfile
...
   201      thread_local                     1.1.7  3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152 \
   202      time                            0.3.21  8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc \
   203      time-core                        0.1.1  7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb \
...

の202行目を最新バージョン0.3.36とチェックサムに書き換えて試したが、他のバージョンとの依存関係が変わってしまってビルドできなかった。なので、

対処
% port clean --all cargo-c
% port -v -f patch cargo-c
% nano ${macport_root}/var/macports/build/*_devel_cargo-c/cargo-c/work/.home/.cargo/macports/time-0.3.21/src/format_description/parse/mod.rs
% port -v -f install cargo-c

として、portのビルドの途中で、ここに書かれている変更を反映させることで、ビルドできた。

time-0.3.21/src/format_description/parse/mod.rsの変更後
    66  /// Parse a sequence of items from the format description.
    67  ///
    68  /// The syntax for the format description can be found in [the
    69  /// book](https://time-rs.github.io/book/api/format-description.html). The version of the format
    70  /// description is provided as the const parameter.
    71  ///
    72  /// Unlike [`parse`], this function returns [`OwnedFormatItem`], which owns its contents. This means
    73  /// that there is no lifetime that needs to be handled. **It is recommended to use version 2.**
    74  ///
    75  /// [`OwnedFormatItem`]: crate::format_description::OwnedFormatItem
    76  pub fn parse_owned<const VERSION: usize>(
    77      s: &str,
    78  ) -> Result<crate::format_description::OwnedFormatItem, crate::error::InvalidFormatDescription> {
    79      validate_version!(VERSION);
    80      let mut lexed = lexer::lex::<VERSION>(s.as_bytes());
    81      let ast = ast::parse::<_, VERSION>(&mut lexed);
    82      let format_items = format_item::parse(ast);
    83      // let items = format_items
    84      //     .map(|res| res.map(Into::into))
    85      //     .collect::<Result<Box<_>, _>>()?;
    86      let items = format_items.collect::<Result<Box<_>, _>>()?;
    87      Ok(items.into())
    88  }
    89  
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0