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

Pass user-defined-trusted-dirs to glibc #7

Closed
bedroge opened this issue Feb 18, 2021 · 6 comments · Fixed by #8 or EESSI/compatibility-layer#87
Closed

Pass user-defined-trusted-dirs to glibc #7

bedroge opened this issue Feb 18, 2021 · 6 comments · Fixed by #8 or EESSI/compatibility-layer#87

Comments

@bedroge
Copy link
Collaborator

bedroge commented Feb 18, 2021

We probably may need/use this for the CUDA support (see EESSI/compatibility-layer#71), and possibly other use cases.

This can be done by modifying the glibc ebuild, but this is a bit cumbersome, since it has to be redone for every new version. We could, instead, use the following approach, which allows us to override variables per package (or even per version of a package):
https://groups.google.com/g/linux.gentoo.user/c/z1ZXuJkd0ro/m/9PUWFv8BXnUJ

I quickly tested it by adding a $EPREFIX/etc/portage/bashrc:

for MY_ENV in ${PN} ${P} ${PF}; do 
	if [ -f ${EPREFIX}/etc/portage/env.d/${CATEGORY}/${MY_ENV} ]; then 
		. ${EPREFIX}/etc/portage/env.d/${CATEGORY}/${MY_ENV} 
		fi 
	done

and a file $EPREFIX/etc/portage/env.d/sys-libc/glibc:

EXTRA_ECONF="--testme"

Running emerge --ask --verbose sys-libs/glibc then failed, as expected:

configure: error: unrecognized option: `--testme'

This can be easily included in the etc/portage dir of this repo, as our compatibility layer playbook already makes symlinks in ${EPREFIX}/etc/portage to all files/dirs in this directory.

@bedroge
Copy link
Collaborator Author

bedroge commented Feb 18, 2021

Hmm, seems like user-defined-trusted-dirs is not a configure parameter... let's see if there is a similar variable that we can use for the make step.

@ocaisa
Copy link
Member

ocaisa commented Feb 18, 2021

Looks like there might be EXTRA_EMAKE

@bedroge
Copy link
Collaborator Author

bedroge commented Feb 18, 2021

Indeed, but it doesn't seem to be picked up by glibc for some reason. There's also MAKEOPTS, which is usually used for setting the number of threads (eg -j2), which we can abuse for this purpose, but it may be a bit ugly...

@bedroge
Copy link
Collaborator Author

bedroge commented Feb 18, 2021

Passing EXTRA_EMAKE on the command-line instead of via that file does work, strange...

@bedroge
Copy link
Collaborator Author

bedroge commented Feb 18, 2021

Okay, the following does seem to work (based on this https://wiki.gentoo.org/wiki//etc/portage/package.env):

$ cat $EPREFIX/etc/portage/package.env
sys-libs/glibc glibc-user-defined-trusted-dirs.conf

$ cat $EPREFIX/etc/portage/env/glibc-user-defined-trusted-dirs.conf
EXTRA_EMAKE="user-defined-trusted-dirs=/opt/eessi/lib64"

Running emerge --ask --verbose sys-libs/glibc then shows:

make -j2 -C /tmp/gentoo/var/tmp/portage/sys-libs/glibc-2.32-r7/work/build-amd64-x86_64-pc-linux-gnu-nptl user-defined-trusted-dirs=/opt/eessi/lib64 

@bedroge
Copy link
Collaborator Author

bedroge commented Mar 2, 2021

Reopening this issue, since I don't think this worked. For my test installation I saw this:

$ strings /cvmfs/pilot.eessi-hpc.org/2021.02/compat/linux/x86_64/usr/lib64/libc.a | grep "/opt/eessi"
/opt/eessi/lib/

But with our current installations this doesn't return anything, neither for lib64/{libc.so.6,ld-linux-x86-64.so.2}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants