-
Notifications
You must be signed in to change notification settings - Fork 202
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
add support for %(sysroot)s
template value
#4359
Conversation
I was looking into this too, here's the test I came up with to test the use of the def test_sysroot_template(self):
"""Test the %(sysroot)s template"""
test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs')
toy_ec = os.path.join(test_easyconfigs, 't', 'toy', 'toy-0.0.eb')
test_ec = os.path.join(self.test_prefix, 'test.eb')
test_ec_txt = read_file(toy_ec)
test_ec_txt += '\nconfigopts = "--sysroot=%(sysroot)s/"'
write_file(test_ec, test_ec_txt)
ec = EasyConfig(test_ec)
self.assertEqual(ec['configopts'], "--sysroot=/")
update_build_option('sysroot', self.test_prefix)
ec = EasyConfig(test_ec)
self.assertEqual(ec['configopts'], "--sysroot=%s/" % self.test_prefix) |
Yep, I like that you captured it in one test, we'll update that. I also like how you just modified the I do prefer our approach to using I also think we should stick to setting it in the three pre*opts we did now (again, stolen from the PR you gave us as example), as it verifies that template value is set in all of these stages of (which are probably the most relevant ones in terms of where it might be used) and not just in the configure step. I'll merge your approach into ours :) |
Co-authored-by: Kenneth Hoste <[email protected]>
Ah, wait, I only now see that you are actually not relying on running all steps, you just query the options again. Ok, then I understand why you did the suggestive I'll still do it for |
Hm, that's a completely different test. I guess the |
…ts with clean env. The real problem was that the template_constant_dict has changed, so the expected output is now different - and should include sysroot and its value
…t for addition of sysroot template
Hmm, if that's the case, then we should definitely fix that (in a separate PR), configuration options shouldn't carry over tests at all... edit: Ah, you figured it out, some other tests were failing because the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
%(sysroot)s
template value
This improves sysroot support. For example this code line in wget can be generalized using sysroot template.
From
preconfigopts = "export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig && "
to
preconfigopts = "export PKG_CONFIG_PATH=%(sysroot)s/usr/lib64/pkgconfig:%(sysroot)s/usr/lib/pkgconfig:%(sysroot)s/usr/lib/x86_64-linux-gnu/pkgconfig && "
This works for both cases when --sysroot is passed and when it's not (i.e. when it defaults to None).