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

AGENT-139: WIP - Embed nmstate #6589

Closed
wants to merge 1 commit into from
Closed

Conversation

celebdor
Copy link
Contributor

This requires:

  • nmstate-static installed in the system
  • glibc-static installed in the system (or equivalent static libc)
  • Build with: CGO_ENABLED=1 GOARCH=amd64 GOOS=linux OUTPUT="bin/openshift-install" hack/build.sh

TODO:

  • See what we do for mac to get the static libraries (they exist but we need to get them)
  • Change nmstatectl usage to the bindings

Signed-off-by: Antoni Segura Puimedon antoni@redhat.com

This requires:
* nmstate-static installed in the system
* glibc-static installed in the system (or equivalent static libc)
* Build with: CGO_ENABLED=1 GOARCH=amd64 GOOS=linux OUTPUT="bin/openshift-install" hack/build.sh

Signed-off-by: Antoni Segura Puimedon <antoni@redhat.com>
@celebdor
Copy link
Contributor Author

Currently, when building, I get:

+ export CGO_CFLAGS
+ export CGO_LDFLAGS
+ echo 1
1
+ echo '-I/usr/include/ '
-I/usr/include/ 
+ echo '-lnmstate  -ldl -lrt -static'
-lnmstate  -ldl -lrt -static
+ go build -mod=vendor -ldflags ' -X github.com/openshift/installer/pkg/version.Raw=unreleased-master-7305-g27cb7f67cb55ddecb9fc38ffea0b58639a74c2da-dirty -X github.com/openshift/installer/pkg/version.Commit=27cb7f67cb55ddecb9fc38ffea0b58639a74c2da -X github.com/openshift/installer/pkg/version.defaultArch=amd64 -s -w' -tags ' release' -o bin/openshift-install ./cmd/openshift-install
# os/user
/usr/bin/ld: $WORK/b136/_x004.o: in function `mygetgrouplist':
getgrouplist_unix.cgo2.c:(.text+0x60): warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: $WORK/b136/_x003.o: in function `mygetgrgid_r':
cgo_lookup_unix.cgo2.c:(.text+0xe1): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: $WORK/b136/_x003.o: in function `mygetgrnam_r':
cgo_lookup_unix.cgo2.c:(.text+0x11e): warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: $WORK/b136/_x003.o: in function `mygetpwnam_r':
cgo_lookup_unix.cgo2.c:(.text+0xa7): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: $WORK/b136/_x003.o: in function `mygetpwuid_r':
cgo_lookup_unix.cgo2.c:(.text+0x6a): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
# net
/usr/bin/ld: $WORK/b081/_x005.o: in function `_cgo_6cc2654a8ed3_C2func_getaddrinfo':
cgo_unix.cgo2.c:(.text+0x81): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
# github.com/nmstate/nmstate/rust/src/go/nmstate
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(nix-729aa6de915b48d6.nix.252bbb77-cgu.0.rcgu.o): in function `nix::unistd::getgrouplist':
(.text._ZN3nix6unistd12getgrouplist17h376df05b93dc3560E+0xd8): warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(nix-729aa6de915b48d6.nix.252bbb77-cgu.0.rcgu.o): in function `nix::unistd::initgroups':
(.text._ZN3nix6unistd10initgroups17hebadbda75b75384cE+0x5): warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(nix-729aa6de915b48d6.nix.252bbb77-cgu.0.rcgu.o): in function `nix::unistd::Group::from_gid':
(.text._ZN3nix6unistd5Group8from_gid17h5751ba80bd1a1713E+0xd2): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(nix-729aa6de915b48d6.nix.252bbb77-cgu.0.rcgu.o): in function `nix::unistd::Group::from_name':
(.text._ZN3nix6unistd5Group9from_name17hc2bd27f86287cb96E+0x114): warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(nix-729aa6de915b48d6.nix.252bbb77-cgu.0.rcgu.o): in function `nix::unistd::User::from_name':
(.text._ZN3nix6unistd4User9from_name17h8a684fab8c4a6594E+0x114): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(nix-729aa6de915b48d6.nix.252bbb77-cgu.0.rcgu.o): in function `nix::unistd::User::from_uid':
(.text._ZN3nix6unistd4User8from_uid17h06e1c71291831fecE+0xd2): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(std-bd6a6de3c6fdb4df.std.a5638abb-cgu.0.rcgu.o): in function `<std::sys_common::net::LookupHost as core::convert::TryFrom<(&str,u16)>>::try_from':
(.text._ZN104_$LT$std..sys_common..net..LookupHost$u20$as$u20$core..convert..TryFrom$LT$$LP$$RF$str$C$u16$RP$$GT$$GT$8try_from17h06238488732bc0f3E+0xc8): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
# github.com/openshift/installer/cmd/openshift-install
/usr/bin/ld: /tmp/go-link-1158663022/000023.o: in function `mygetgrouplist':
getgrouplist_unix.cgo2.c:(.text+0x60): warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libnmstate.a(nix-729aa6de915b48d6.nix.252bbb77-cgu.0.rcgu.o): in function `nix::unistd::initgroups':
(.text._ZN3nix6unistd10initgroups17hebadbda75b75384cE+0x5): warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /tmp/go-link-1158663022/000022.o: in function `mygetgrgid_r':
cgo_lookup_unix.cgo2.c:(.text+0xe1): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /tmp/go-link-1158663022/000022.o: in function `mygetgrnam_r':
cgo_lookup_unix.cgo2.c:(.text+0x11e): warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /tmp/go-link-1158663022/000022.o: in function `mygetpwnam_r':
cgo_lookup_unix.cgo2.c:(.text+0xa7): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /tmp/go-link-1158663022/000022.o: in function `mygetpwuid_r':
cgo_lookup_unix.cgo2.c:(.text+0x6a): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /tmp/go-link-1158663022/000004.o: in function `_cgo_6cc2654a8ed3_C2func_getaddrinfo':
cgo_unix.cgo2.c:(.text+0x81): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 14, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign sadasu for approval by writing /assign @sadasu in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 1, 2022
@openshift-merge-robot
Copy link
Contributor

@celebdor: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@cathay4t
Copy link

Hi @celebdor ,

We are working on including nmstate into host CoreOS via coreos/fedora-coreos-config#2269 , do you still need to embed nmstate?

Does including nmstate-libs (C library of nmstate) also helps?

@zaneb
Copy link
Member

zaneb commented May 30, 2023

We are working on including nmstate into host CoreOS via coreos/fedora-coreos-config#2269 , do you still need to embed nmstate?

Yes, it's still needed in the installer binary so that we can use it to validate data when it is provided.

Does including nmstate-libs (C library of nmstate) also helps?

No, the installer is a standalone binary that the user downloads, so it can't depend on dynamic libraries.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 28, 2023
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 28, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2023

@celebdor: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-images c7a3c3c link true /test okd-scos-images
ci/prow/okd-e2e-aws-upgrade c7a3c3c link false /test okd-e2e-aws-upgrade
ci/prow/aro-unit c7a3c3c link true /test aro-unit
ci/prow/okd-scos-unit c7a3c3c link false /test okd-scos-unit
ci/prow/e2e-metal-ipi-sdn c7a3c3c link false /test e2e-metal-ipi-sdn
ci/prow/e2e-aws-ovn c7a3c3c link true /test e2e-aws-ovn
ci/prow/e2e-metal-assisted c7a3c3c link false /test e2e-metal-assisted
ci/prow/e2e-openstack c7a3c3c link false /test e2e-openstack
ci/prow/golint c7a3c3c link true /test golint
ci/prow/govet c7a3c3c link true /test govet
ci/prow/e2e-ovirt-sdn c7a3c3c link false /test e2e-ovirt-sdn
ci/prow/okd-scos-e2e-aws-upgrade c7a3c3c link false /test okd-scos-e2e-aws-upgrade
ci/prow/verify-vendor c7a3c3c link true /test verify-vendor
ci/prow/okd-scos-e2e-aws-ovn c7a3c3c link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-agent-compact c7a3c3c link true /test e2e-agent-compact
ci/prow/okd-images c7a3c3c link true /test okd-images
ci/prow/shellcheck c7a3c3c link true /test shellcheck
ci/prow/e2e-libvirt c7a3c3c link false /test e2e-libvirt
ci/prow/e2e-ibmcloud-ovn c7a3c3c link false /test e2e-ibmcloud-ovn
ci/prow/okd-unit c7a3c3c link true /test okd-unit
ci/prow/e2e-agent-sno c7a3c3c link false /test e2e-agent-sno
ci/prow/unit c7a3c3c link true /test unit
ci/prow/images c7a3c3c link true /test images
ci/prow/okd-e2e-aws-ovn c7a3c3c link false /test okd-e2e-aws-ovn
ci/prow/e2e-agent-compact-ipv4 c7a3c3c link true /test e2e-agent-compact-ipv4
ci/prow/e2e-azure-ovn c7a3c3c link true /test e2e-azure-ovn
ci/prow/e2e-openstack-ovn c7a3c3c link true /test e2e-openstack-ovn
ci/prow/e2e-metal-ipi-ovn-ipv6 c7a3c3c link true /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-vsphere-ovn c7a3c3c link true /test e2e-vsphere-ovn
ci/prow/e2e-gcp-ovn c7a3c3c link true /test e2e-gcp-ovn
ci/prow/agent-integration-tests c7a3c3c link true /test agent-integration-tests
ci/prow/altinfra-images c7a3c3c link true /test altinfra-images

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci openshift-ci bot closed this Nov 4, 2023
Copy link
Contributor

openshift-ci bot commented Nov 4, 2023

@openshift-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants