Skip to content

Improve build system#262

Open
lahwaacz wants to merge 5 commits into
NVIDIA:mainfrom
lahwaacz:build-system
Open

Improve build system#262
lahwaacz wants to merge 5 commits into
NVIDIA:mainfrom
lahwaacz:build-system

Conversation

@lahwaacz

Copy link
Copy Markdown

These changes make building with system flags and libs more straightforward or actually possible. I had to patch the build system a lot while making a package for Arch Linux.

Signed-off-by: Jakub Klinkovský <1289205+lahwaacz@users.noreply.github.com>
…file

Signed-off-by: Jakub Klinkovský <1289205+lahwaacz@users.noreply.github.com>
…ng their own flags

For example, Arch Linux wants debug information in the binaries.

Signed-off-by: Jakub Klinkovský <1289205+lahwaacz@users.noreply.github.com>
For example, Arch Linux strips debug information after build during the
package creation and producing separate debug info files during the
build interferes with the Arch tooling.

Signed-off-by: Jakub Klinkovský <1289205+lahwaacz@users.noreply.github.com>
…SECCOMP

"yes" means linking to system libtirpc, "no" means building libtirpc from source.

Signed-off-by: Jakub Klinkovský <1289205+lahwaacz@users.noreply.github.com>
@lahwaacz

Copy link
Copy Markdown
Author

@elezar Can you look at this please? 🙏

@elezar elezar self-assigned this May 22, 2024
@elezar

elezar commented May 22, 2024

Copy link
Copy Markdown
Member

@lahwaacz sorry for the delay. I will have a look.

@elezar
elezar requested review from elezar and klueska and removed request for elezar May 23, 2024 08:33

@elezar elezar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the changes.

I think they look good. The one thing missing is ensuring that the defaults for all major platforms are the same given the WITH_TIRPC changes.

Comment thread src/nvcgo/Makefile
Comment thread Makefile
@lahwaacz

Copy link
Copy Markdown
Author

@elezar Any progress with merging this? It's been almost half a year...

@lahwaacz
lahwaacz requested a review from elezar October 1, 2024 07:00
@lahwaacz

Copy link
Copy Markdown
Author

@elezar It has been a year, can you merge this please?

@lahwaacz

Copy link
Copy Markdown
Author

@elezar ping

It would also be good to know which license applies to the changed files (#193)

@ssalagam

Copy link
Copy Markdown

@cdesiniotis , please review this.

@myeolenv myeolenv assigned cdesiniotis and henry118 and unassigned elezar Jul 13, 2026
@myeolenv

Copy link
Copy Markdown

@henry118 Please review this.

Comment thread Makefile
Comment thread Makefile
$(MAKE) -f $(MAKE_DIR)/elftoolchain.mk DESTDIR=$(DEPS_DIR) install
endif
ifeq ($(WITH_TIRPC), yes)
ifeq ($(WITH_TIRPC), no)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This flips the existing behavior.

Currently we will build the library from source when this flag is yes, but after this change it behaves the opposite.

This might break some platforms that package this repo.

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.

As I wrote before:

Well, the meaning of WITH_TIRPC was not flipped:

  • before: "yes" means building libtirpc from source, "no" means don't use libtirpc at all (I think)
    (@klueska explained that "Previously no meant -- use the native sunrpc library that is bundled in the OS (instead of tirpc).")
  • after: "yes" means linking to system libtirpc, "no" means building libtirpc from source

Which other approach enabling linking to system libtirpc would you propose?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

imho we should keep the existing semantics.

  • yes - build from source
  • no - use system library

My concern is that many downstream users might already depend on the current behavior and silently flipping the meaning would cause unexpected breaks.

@lahwaacz lahwaacz Jul 13, 2026

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.

WITH_TIRPC=no does not use a system libtirpc - it uses something else for RPC.

AFAICT, there is currently no way to build with system libtirpc without patching or passing custom compiler flags. IMHO this is a good enough reason for a breaking change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's the SunRPC implementation that used to be shipped as part of glibc. Like Ubuntu 18.04 and older, they often still had the glibc SunRPC headers. But modern distros would require libtirpc-dev to compile code using RPC.

To avoid changing the meaning of WITH_TIRPC, perhaps we can introduce a 3 state selector instead:

TIRPC_MODE ?= sunrpc
# sunrpc  - use the platform-provided SunRPC implementation
# bundled - build and statically link the bundled libtirpc
# system  - use the system libtirpc discovered through pkg-config

Then preserve the existing flag as a compatibility shim:

ifdef WITH_TIRPC
  ifeq ($(WITH_TIRPC),yes)
    TIRPC_MODE := bundled
  else
    TIRPC_MODE := sunrpc
  endif
endif

This keeps existing build scripts working as they do today:

make WITH_TIRPC=yes   # still means bundled libtirpc
make WITH_TIRPC=no    # still means SunRPC

while allowing the new behavior explicitly:

make TIRPC_MODE=system

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.

7 participants