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

(PA-5645) Install additional runtime dependencies #696

Merged
merged 4 commits into from
Jul 12, 2023

Conversation

joshcooper
Copy link
Contributor

@joshcooper joshcooper commented Jul 11, 2023

Whenver a fileset is installed via installp, e.g. openssl.base, IBM recommends
running updtvpkg so that RPM packages which depend on it, build correctly.

And after installing rpm.rte, yum prints that an update is required. This seems
to resolve package dependencies issues between yum/python/libcurl and cmake.

For reasons not entirely clear, if we provision an AIX host, install yum,
install build dependencies and then build curl within the same ssh session, then
the resulting curl executable will fail to run:

# /opt/puppetlabs/puppet/bin/curl
exec(): 0509-036 Cannot load program /opt/puppetlabs/puppet/bin/curl because of the following errors:
    0509-150   Dependent module libcurl.a(libcurl.so.4) could not be loaded.
    0509-022 Cannot load module libcurl.a(libcurl.so.4).
    0509-026 System error: A file or directory in the path name does not exist.

This occurs even though our libdir is first in the linker search path:

# dumpbin -Hv /opt/puppetlabs/puppet/bin/curl
...
                  ***Import File Strings***
     INDEX  PATH                          BASE                MEMBER
     0      /opt/puppetlabs/puppet/lib:/opt/puppetlabs/puppet/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/../../..:/opt/freeware/lib:/usr/lib:/lib

However, if you install yum and dependendencies in one ssh connection and then
try to build curl in a second, it works.

I think this has something to do with the way AIX caches shared libraries in
memory. For example, yum install loads libcurl.a and it's still in memory
when we build curl:

# genkld | grep curl
d15c9100    8a424 /opt/freeware/lib/libcurl.a[libcurl.so.4]

It's possible to clear shared libraries whose reference counts are 0, using
slibclean, but there's no guarantee that the library is unloaded.

Disabling runtime linking (removing -brtl from LDFLAGS) seems to reliably work.

Building https://jenkins-platform.delivery.puppetlabs.net/view/vanagon-generic-builder/job/platform_vanagon-generic-builder_vanagon-packaging_generic-builder/2137/BUILD_TARGET=aix-7.2-ppc,SLAVE_LABEL=k8s-worker/

Whenver a fileset is installed via installp, e.g. openssl.base, IBM recommends
running updtvpkg so that RPM packages which depend on it, build correctly.

And after installing rpm.rte, yum prints that an update is required. This seems
to resolve package dependencies issues between yum/python/libcurl and cmake.
For reasons not entirely clear, if we provision an AIX host, install yum,
install build dependencies and then build curl within the same ssh session, then
the resulting curl executable will fail to run:

    # /opt/puppetlabs/puppet/bin/curl
    exec(): 0509-036 Cannot load program /opt/puppetlabs/puppet/bin/curl because of the following errors:
        0509-150   Dependent module libcurl.a(libcurl.so.4) could not be loaded.
        0509-022 Cannot load module libcurl.a(libcurl.so.4).
        0509-026 System error: A file or directory in the path name does not exist.

This occurs even though our libdir is first in the linker search path:

    # dumpbin -Hv /opt/puppetlabs/puppet/bin/curl
    ...
                      ***Import File Strings***
         INDEX  PATH                          BASE                MEMBER
         0      /opt/puppetlabs/puppet/lib:/opt/puppetlabs/puppet/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/../../..:/opt/freeware/lib:/usr/lib:/lib

However, if you install yum and dependendencies in one ssh connection and then
try to build curl in a second, it works.

I think this has something to do with the way AIX caches shared libraries in
memory. For example, `yum install` loads `libcurl.a` and it's still in memory
when we build curl:

    # genkld | grep curl
    d15c9100    8a424 /opt/freeware/lib/libcurl.a[libcurl.so.4]

It's possible to clear shared libraries whose reference counts are 0, using
slibclean, but there's no guarantee that the library is unloaded.

Disabling runtime linking (removing -brtl from LDFLAGS) seems to reliably work.
@joshcooper joshcooper marked this pull request as ready for review July 12, 2023 22:02
@joshcooper joshcooper requested review from a team as code owners July 12, 2023 22:02
@joshcooper joshcooper merged commit 5172806 into puppetlabs:master Jul 12, 2023
@joshcooper joshcooper deleted the aix72_libz branch July 12, 2023 23:01
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.

2 participants