-
Notifications
You must be signed in to change notification settings - Fork 284
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
sidestep using the config.guess that comes with a package in ConfigureMake generic easyblock #1506
Conversation
build_type, _ = run_cmd('config_guess') | ||
build_type_option = '--build=' + build_type.strip() | ||
|
||
cmd = "%(preconfigopts)s %(cmd_prefix)s./configure %(prefix_opt)s%(installdir)s %(build_type_option)s %(configopts)s" % { |
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.
line too long (129 > 120 characters)
@ocaisa After fixing the typo in the script invocation ( |
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.
@ocaisa We should probably add a small README
not to the config.guess
to explain where it comes from, what is used for, and how it can be updated in the future?
cmd = "%(preconfigopts)s %(cmd_prefix)s./configure %(prefix_opt)s%(installdir)s %(configopts)s" % { | ||
# Avoid using config.guess from the package as it is frequently out of date, use the version shipped with EB | ||
build_type, _ = run_cmd('config_guess') | ||
build_type_option = '--build=' + build_type.strip() |
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.
@ocaisa As indicated by @micaeljtoliveira, this should be config.guess
.
Also, please log what the result of config_guess
is, and maybe also which config.guess
is being (result of which('config.guess')
).
Can we detect when --build
needs to be used?
I'm a bit worried about the impact this may have on systems where this isn't needed currently...
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.
I don't know enough about Autotools to answer this... @geimer ?
I would expect that it does no harm, config.guess
is intended to be updated and so backwards compatible, it's output is the default setting for --build
(see https://www.gnu.org/software/autoconf/manual/autoconf-2.61/html_node/Specifying-Names.html).
if build_type is None: | ||
build_type, exit_code = run_cmd('config.guess') | ||
if exit_code != 0: | ||
raise EasyBuildError("config.guess shipped with EB could not determine build type: '%s'", |
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.
undefined name 'EasyBuildError'
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.
@ocaisa No need for this, run_cmd
check the exit code of the command that was run already by default, and will produce a clear error message when != 0
.
So, you can use:
build_type, _ = run_cmd('config.guess')
(_
is often used to signal you're ignoring part of the return value)
if build_type is None: | ||
build_type, exit_code = run_cmd('config.guess') | ||
if exit_code != 0: | ||
raise EasyBuildError("config.guess shipped with EB could not determine build type: '%s'", |
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.
@ocaisa No need for this, run_cmd
check the exit code of the command that was run already by default, and will produce a clear error message when != 0
.
So, you can use:
build_type, _ = run_cmd('config.guess')
(_
is often used to signal you're ignoring part of the return value)
build_type = build_type.strip() | ||
build_type_option = '--build=' + build_type | ||
|
||
cmd = ("%(preconfigopts)s %(cmd_prefix)s./configure %(prefix_opt)s%(installdir)s %(build_type_option)s " |
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.
@ocaisa I like the cmd = ' '.join([...])
option better, there's little point in using a dict here to format the command...
I think this is ready for primetime, it would be very good if other people could test it though, introducing new code in such a heavily used easyblock makes me nervous @micaeljtoliveira @omula @geimer |
Tested locally and works as expected on this system:
|
I'm testing this by rebuilding a few toolchains, both on powerpc and x86. Found the first problem: zlib uses the ConfigureMake easyblock, but its build system is not autotools based. I guess the |
Thanks @micaeljtoliveira , I made a fix for that but it also scares me a little. Since this easyblock is inherited all over the place it could easily have an unintended knock-on effect. I wonder is the better option to (also) look in the unpacked sources directory for an existing |
Correctly generated tarballs of Autotools-based projects do not need Autotools as a (build)dependency. Everything should be included in the tarball to run out-of-the-box (unless you need to regenerate the build system due to some change, or require an updated W.r.t. looking into the unpacked sources: You know the usual "build systems" of scientific software, right? What if a package uses a homegrown |
@geimer Then the only fix I see for this is the same as the one used by Slack: go in and update every instance of |
@ocaisa IANAL (I am not a lawyer), but at first glance this seems to comply to the license exception. Maybe it's worth checking how the GPLv3 defines the term 'contains', though. Having said that, I believe the exception was added for |
"contains" is not defined there. I tried out adding |
To add to the discussion about the license issue, it would seem to me that there might actually be no problem at all, as one could argue that the |
I read that section and I agree with @micaeljtoliveira , the description in the FAQ says:
Since we are forking out and only communicating via the command line, I think this is quite clear that we meet the criteria in the FAQ of being separate programs. If @boegel agrees then I will tidy up the PR and point to the FAQ when discussing the licensing. |
I'm inclined to agree, but I really don't like this part: We really can't be sure whether this is OK or not without a clear answer from the FSF... We briefly discussed this during the EasyBuild conf call yesterday (see notes at https://github.com/easybuilders/easybuild/wiki/Conference-call-notes-20180919), where a couple of potential alternatives were suggested:
I think a) could be a good middle ground... It's pretty much automagic (as long as you're online), and the updated My approach on it would be to define a constant in |
@boegel Before I go and implement this, just to clarify
|
@ocaisa That sounds like what I had in mind, indeed. The location should be a The other option is to use I'm not sure how strict we should be w.r.t. the checksum of the In addition, we should consider only running Running directly rather that updating All of this should probably be handled in a dedicated separate method that just returns the value produced by |
I think the option of |
if verify_checksum(downloaded_path, CONFIG_DOT_GUESS_SHA256): | ||
config_dot_guess_path = downloaded_path | ||
# Add execute permissions | ||
adjust_permissions(downloaded_path, stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH, add=True) |
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.
missing whitespace around bitwise or shift operator
@boegel Done and seems to work. |
@ocaisa That looks a lot better, it's a good middle ground imho. This way we avoid the licensing concerns, and we allow to easily use an alternate/updated I did some additional updates in ocaisa#14, mainly to have better logging of the |
more thorough logging on config.guess + code cleanup
…ustom_easyblocks_repo
ensure VERSION is defined in easybuild.easyblocks namespace in test_custom_easyblocks_repo
Thanks a lot for your efforts on this @ocaisa, and to @geimer and @micaeljtoliveira for the feedback! Going in to be included in the upcoming EasyBuild v3.7.0... |
No description provided.