build: make --without-{python,perl,r} actually disable the language#12
Open
quinnjr wants to merge 1 commit into
Open
build: make --without-{python,perl,r} actually disable the language#12quinnjr wants to merge 1 commit into
quinnjr wants to merge 1 commit into
Conversation
ada55e6 to
ed68933
Compare
The SCons cleanup that landed in PR FIUBioRG#7 made the swig wrapper command itself conditional on each per-language option, but the rest of the build was still unconditional. With --without-r the build still: - Compiled src/languages/R.cxx into pluma (build_language_objects globs *.cxx unfiltered) - Linked pluma against -lR -lRInside (program_libs hard-coded) - Required PluginManager.h to #include "languages/R.h" and push a MiAMi::R instance into supportedLanguages (also unconditional) So the option appeared to do something during configure but the link would still fail on hosts without R, defeating the point. Gate the remainder: - build_language_objects filters the *.cxx glob by the disabled options. Driven by a small map of option name to filename so adding a new gated language is a one-line change. - build_main_executable composes program_libs based on which options are off, instead of dumping the full list. - PluginManager.h wraps the language #includes and the matching supported.push_back calls in #ifdef HAVE_PYTHON / HAVE_R / HAVE_PERL, matching the existing HAVE_JAVA / HAVE_RUST pattern. configure_python / configure_perl / configure_r already set those defines only when the language is enabled, so the guards work without any further SConstruct change. Java is not gated here because --without-java is not declared in OPTIONS yet (separate concern, handled in FIUBioRG#13); the existing HAVE_JAVA guard in PluginManager.h remains.
76224fa to
8c941b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After PR #7 (SConstruct cleanup), the per-language
--without-*flags only gated the SWIG wrapper invocation. The rest of the build was still unconditional, so e.g.--without-rwould still:src/languages/R.cxxinto pluma (the*.cxxglob inbuild_language_objectswas unfiltered)-lR -lRInside(hard-coded inprogram_libs)PluginManager.hto includelanguages/R.hand push aMiAMi::Rinstance intosupportedLanguagesThis PR finishes the gating so
--without-{python,perl,r}actually produces a binary that does not require the corresponding runtime at link or load time.Changes
Scope notes
Test plan