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

未关闭
#465 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
11

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

oxidecomputer/opte 的其他 Issue

查看 oxidecomputer/opte 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。