Skip to content

fix: select RPC and NIS build dependencies by platform - #90

Open
ZedingZhang wants to merge 1 commit into
bytedance:masterfrom
ZedingZhang:fix/package-libtirpc-build-deps
Open

ZedingZhang wants to merge 1 commit into
bytedance:masterfrom
ZedingZhang:fix/package-libtirpc-build-deps

Conversation

@ZedingZhang

@ZedingZhang ZedingZhang commented Aug 31, 2026 •

Copy link
Copy Markdown

Problem

The build accepts either native libc RPC or standalone libtirpc, and separately checks for libnsl. Ubuntu 20.04 supplies native RPC through its base development packages, so adding libtirpc-dev unconditionally to Debian Build-Depends is redundant there. On newer Ubuntu installations without native RPC headers, libtirpc-dev alone is insufficient: the libnsl development library is required too.

The README currently lists Ubuntu 20.04. This change fixes Ubuntu installer preparation and the EL8+ RPM recipe; it does not extend the declared DEB support scope.

Related to #89.

Change

  • After Ubuntu's base development packages are installed, check for /usr/include/rpc/xdr.h. If absent, install both libtirpc-dev and libnsl-dev. Ubuntu 20.04 retains its native RPC path.
  • Declare libtirpc-devel and libnsl2-devel together in RPM BuildRequires only when 0%{?rhel} >= 8. EL6/EL7 keep their existing dependency set.
  • Withdraw the previous Debian metadata change. Retain current master's release metadata and installer helper-path fixes.

Based on master 35fd1684bf7222ea679013f662697884ff6ebffb; candidate e736970c2c52f6c1d856d1ab42cfbb587a900833. The upstream diff is two files, seven added lines: volcinstall.sh and spec/volclava.spec.

Verification

Fresh clean-container validation passes all four jobs. Its validation head 740d0e28 contains production files identical to candidate e736970c; the workflow and validation record are kept on a separate fork branch and are excluded from this PR.

Environment Verified behavior
Ubuntu 20.04 Real installer preparation leaves both standalone development packages absent; configure finds native RPC and needs no additional RPC library. Full build and make check pass.
Ubuntu 22.04 Real installer preparation provides both development packages; configure links libtirpc and finds libnsl. Full build and make check pass.
Ubuntu 24.04 Unmodified master's installer reproduces missing rpc/xdr.h; installing only libtirpc-dev reproduces missing libnsl. Revised preparation installs the pair, followed by successful configure, full build and make check.
Rocky 8 Exact RPM BuildRequires include both standalone packages, and installing that set allows the full build and make check to pass. EL6/EL7 macro expansion excludes both packages.

Ubuntu 22.04/24.04 are installer/build compatibility checks. EL6/EL7 were checked by RPM macro expansion on Rocky 8; no native CentOS 6/7 build is claimed.

Local bash -n volcinstall.sh libinstall.sh and git diff --check also pass. The validation workflow and record document the exact source and checks. The earlier August matrix informed the direction; the linked fresh run verifies this revision on current master.

Revised and validated with Codex assistance.

@CLAassistant

CLAassistant commented Aug 31, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@qinan-cn
qinan-cn requested a review from limingze-ste August 31, 2026 02:49
Comment thread debian/control Outdated
Priority: optional
Maintainer: Mingze Li <limingze.jiayou@bytedance.com>; Guangbo Shu <shuguangbo@bytedance.com>; Nan Qi <qinan.cn@bytedance.com>
Build-Depends: autoconf, automake, tcl-dev, libncurses-dev
Build-Depends: autoconf, automake, tcl-dev, libncurses-dev, libtirpc-dev

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting from version 2.32, glibc removed the built-in Sun RPC, which is now provided by the standalone libtirpc library. For Ubuntu:
Ubuntu | Version | glibc Version | xdr.h SourcePath
———————————————————————————————————————
20.04 and earlier |≤ 2.31 |libc6-dev |/usr/include/rpc/xdr.h
———————————————————————————————————————
21.10 / 22.04 / 24.04|≥ 2.34 |libtirpc-dev |/usr/include/tirpc/rpc/xdr.h

I think we need to consider compatibility both in low version and high Ubuntu version for libtirpc-dev. e.g. adding dependency checking in volcinstall.sh instead of here. Please let Mingze give more reviewing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a good catch. I ran a clean Ubuntu 20.04/22.04/24.04 matrix to verify the boundary rather than assuming one dependency set works everywhere: https://github.com/ZedingZhang/volclava/actions/runs/33379130227

  • 20.04 / glibc 2.31: libc6-dev owns /usr/include/rpc/xdr.h; configure, build, and tests pass without libtirpc-dev.
  • 22.04 / glibc 2.35: the base toolchain currently pulls libnsl-dev and libtirpc-dev through libc6-dev, so the build also passes without a direct addition here.
  • 24.04 / glibc 2.39: the base toolchain no longer provides either RPC header. Configure first fails on rpc/xdr.h; adding only libtirpc-dev then fails on the required libnsl check; adding libnsl-dev as well completes configure, make, and make check.

So I agree that an unconditional libtirpc-dev in debian/control is redundant for the supported 20.04 environment and incomplete for 24.04.

If DEB package builds remain 20.04-only, my proposed revision is to remove this Debian metadata change and update volcinstall.sh after installing the base Ubuntu development packages: when /usr/include/rpc/xdr.h is absent, install both libtirpc-dev and libnsl-dev. I would also limit both standalone RPM development packages to RHEL-family 8+ so CentOS 6/7 keep using their built-in interfaces.

If newer Ubuntu DEB build roots are intended to be supported too, the package recipe instead needs version-aware alternatives for both libtirpc and libnsl. I will wait for @limingze-ste's preference before changing the PR direction.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also prepared the installer-based revision on a separate validation branch and tested it before touching this PR: https://github.com/ZedingZhang/volclava/actions/runs/33379779430

All four jobs pass: Ubuntu 20.04 keeps the built-in RPC path without installing the standalone packages; 22.04 and 24.04 install/retain both required development packages and complete the build/tests; the RPM job verifies the dependencies are absent when the spec is evaluated as EL7, present on EL8, and completes the Rocky 8 build. The revision is ready to apply once the intended DEB support scope is confirmed.

@qinan-cn qinan-cn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@ZedingZhang
ZedingZhang force-pushed the fix/package-libtirpc-build-deps branch from 04a0bd8 to e736970 Compare October 8, 2026 08:03
@ZedingZhang ZedingZhang changed the title fix: declare missing RPC build dependencies fix: select RPC and NIS build dependencies by platform Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants