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

Add global option to set default toolchain option of "debug", and enable it by default #4688

Open
wants to merge 7 commits into
base: 5.0.x
Choose a base branch
from

Conversation

Micket
Copy link
Contributor

@Micket Micket commented Oct 22, 2024

Also defaults to "true" as was discussed for 5.0.x.
Those concerned with disk space can consider switching this back to false.

Disclaimer: It's getting late and I'm really not sure if i can get away with inserting the default value of "debug" in the compiler option map like that. Not sure if build_option is guaranteed to be initialized when that static dict is defined.

…iler object.

This needs to be deferred due to how easybuild will need to be able to import the class before
build_option is ready.

The command line option has been changed to a flag, as optparse can't deal with bool types.
@Micket
Copy link
Contributor Author

Micket commented Oct 31, 2024

OK the optparser thing won't permit setting bools in any way. Listing options they get converted to strings, which is ugly to work with, and optparse doesn't support bool types for selection. So it's a enabling flag instead.

Also, due to how classes are sneakily initialized by EB, the static class variables aren't always defined, so, they might be None. As existing codes just if self.xxxx is not None: then I guess i'll just do the same.

@boegel boegel changed the title Add global option to set default toolchain option of "debug" Add global option to set default toolchain option of "debug", and enable it by default Nov 6, 2024
@boegel boegel added the EasyBuild-5.0 EasyBuild 5.0 label Nov 6, 2024
@@ -392,6 +392,7 @@ def override_options(self):
'debug-lmod': ("Run Lmod modules tool commands in debug module", None, 'store_true', False),
'default-opt-level': ("Specify default optimisation level", 'choice', 'store', DEFAULT_OPT_LEVEL,
Compiler.COMPILER_OPT_FLAGS),
'default-debug-symbols': ("Sets default value of debug toolchain option", None, 'store_true', True),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe retain-debug-symbols-by-default is a better name for this configuration option?

Enabling it by default makes sense I think, there should be no fallout of that...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I won't insist, though I find the wording of "retain" a bit strange, reads to me that we were intentionally stripping them out.

@@ -82,7 +82,7 @@ class Compiler(Toolchain):
'loose': (False, "Loose precision"),
'veryloose': (False, "Very loose precision"),
'verbose': (False, "Verbose output"),
'debug': (False, "Enable debug"),
'debug': (None, "Enable or disables debug symbols"), # refers to default-debug-symbols build option by default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'debug': (None, "Enable or disables debug symbols"), # refers to default-debug-symbols build option by default
# default value for 'debug' toolchain option is determined by retain-debug-symbols-by-default configuration option
'debug': (None, "Retain debug symbols"),

@@ -175,6 +175,10 @@ def set_variables(self):

def _set_compiler_toolchainoptions(self):
"""Set the compiler related toolchain options"""
# Initialize default value of debug symbols based on global build option
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Initialize default value of debug symbols based on global build option
# Initialize default value of 'debug' toolchain option based on global configuration option option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Changed default
Development

Successfully merging this pull request may close these issues.

2 participants