Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with alternatives? #28

Open
leoluk opened this issue Jan 6, 2023 · 2 comments
Open

How to deal with alternatives? #28

leoluk opened this issue Jan 6, 2023 · 2 comments

Comments

@leoluk
Copy link
Contributor

leoluk commented Jan 6, 2023

How to handle alternatives?

In a minimal example that just depends on f37 binutils:

rpmtree(
    name = "sandbox",
    rpms = [
        "@binutils-0__2.38-25.fc37.x86_64//rpm",
    ],
    visibility = ["//visibility:public"],
)

.../usr/bin/ld ends up being the GOLD linker:

$ .bazeldnf/sandbox/default/root/bin/ld --version 
GNU gold (version 2.38-25.fc37) 1.16

In the binutils spec, BFD is the default through the alternatives mechanism: https://src.fedoraproject.org/rpms/binutils/blob/f36/f/binutils.spec#_455

A clean Fedora 37 container uses GNU ld by default even though binutils-gold is installed:

$ ld --version 
GNU ld version 2.38-25.fc37

How can I replicate this using bazeldnf?

@leoluk
Copy link
Contributor Author

leoluk commented Jan 16, 2023

Our current workaround is to simply do it manually:

  # Manually resolve alternatives (https://github.com/rmohr/bazeldnf/issues/28)
  ln -r -s -f "${SANDBOX}/root/usr/bin/ld.bfd" "${SANDBOX}/root/usr/bin/ld"

@rmohr
Copy link
Owner

rmohr commented Jan 30, 2023

symlinks can be directly set on the rpmtree target like here: https://github.com/kubevirt/kubevirt/blob/a06915c634a6bc430dac02a8bc8bee048644bdcb/rpm/BUILD.bazel#L1377.

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

No branches or pull requests

2 participants