Unexpected dynamic dependency on `libm.so.2` for opteadm debug variant

オープン
#465 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust
領域
build-system, cli

調査の方向性

まず opteadm の debug ビルドと release ビルドを再現し、elfdump でそれらの動的依存関係を調べます。opteadm と opte-ioctl から libnet、dlpi、num_enum、num_enum_derive へ至る cargo の依存関係ツリーを追跡し、cargo update による 258a8b5 から c0564a0 への変更に重点を置きます。完了の条件は、debug バリアントが予期しない libm.so.2 依存関係を導入しなくなることです。

索引モデルが issue の本文から書いたものです。

説明

After including the debug variant in the opte package we've learned that opteadm compiled in debug mode includes a dependency on libm.so.2, leading to oxidecomputer/helios-omicron-brand#13. This is not present in the release variant of opteadm.

I did some digging and this behaviour is present from c0564a0 onwards. Specifically, calling cargo update from its predecessor (258a8b5) is sufficient. The only individual crate I've found with this dependency is num_enum_derive (the release-built crate has the same dependency):

kyle@farme:~/gits/opte$ elfdump -d target/debug/deps/libnum_enum_derive-610c1d435ea8a838.so

Dynamic Section:  .dynamic
     index  tag                value
       [0]  NEEDED            0x1c2307            libsocket.so.1
       [1]  NEEDED            0x1c2346            librt.so.1
       [2]  NEEDED            0x1c235a            libpthread.so.1
       [3]  NEEDED            0x1c2373            libumem.so.1
       [4]  NEEDED            0x1c2380            libgcc_s.so.1
       [5]  NEEDED            0x1c23a8            libm.so.2
       [6]  NEEDED            0x1c23b2            libc.so.1
       [7]  INIT              0x72ffc0
       [8]  FINI              0x72ffd0
       [9]  RUNPATH           0x1c2426            /usr/gcc/12/lib/amd64
      [10]  RPATH             0x1c2426            /usr/gcc/12/lib/amd64
      [11]  HASH              0xcef40
      [12]  STRTAB            0x157448
      [13]  STRSZ             0x1c263c
      [14]  SYMTAB            0x104318
      [15]  SYMENT            0x18
      [16]  SUNW_SYMTAB       0xeaa58
      [17]  SUNW_SYMSZ        0x6c9f0
      [18]  SUNW_SORTENT      0x4
      [19]  SUNW_SYMSORT      0x320b70
      [20]  SUNW_SYMSORTSZ    0x11dbc
      [21]  CHECKSUM          0x93b2
      [22]  VERNEED           0x319a88
      [23]  VERNEEDNUM        0x7
      [24]  RELACOUNT         0x128a
      [25]  FINI_ARRAY        0x7adaa8
      [26]  FINI_ARRAYSZ      0x8
      [27]  INIT_ARRAY        0x7adab0
      [28]  INIT_ARRAYSZ      0x8
      [29]  PLTRELSZ          0x42be8
      [30]  PLTREL            0x7
      [31]  JMPREL            0x357f68
      [32]  RELA              0x332930
      [33]  RELASZ            0x68220
      [34]  RELAENT           0x18
      [35]  SYMINFO           0xc11b8
      [36]  SYMINSZ           0xdd88
      [37]  SYMINENT          0x4
      [38]  FLAGS             0                   0
      [39]  FLAGS_1           0                   0
      [40]  SUNW_STRPAD       0x200
      [41]  SUNW_LDMACH       0x3e                EM_AMD64
      [42]  PLTGOT            0x797000
   [43-53]  NULL              0

This is currently used by:

kyle@farme:~/gits/opte$ cargo tree -i num_enum_derive
num_enum_derive v0.5.11 (proc-macro)
└── num_enum v0.5.11
    ├── dlpi v0.2.0 (https://github.com/oxidecomputer/dlpi-sys#1d587ea9)
    │   └── libnet v0.1.0 (https://github.com/oxidecomputer/netadm-sys#d44d9e08)
    │       ├── opte-ioctl v0.1.0 (/develop/gits/opte/lib/opte-ioctl)
    │       │   └── opteadm v0.2.0 (/develop/gits/opte/bin/opteadm)
    │       └── opteadm v0.2.0 (/develop/gits/opte/bin/opteadm)
    └── libnet v0.1.0 (https://github.com/oxidecomputer/netadm-sys#d44d9e08) (*)
主要言語
Rust
スター
82
フォーク
16
平均マージ
3日 6時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oxidecomputer/opte のほかの issue

oxidecomputer/opte の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。