[cmake-developers] Java language support regression (compared with 3.7.x and 3.8.x) for 3.9.0

Alan W. Irwin irwin at beluga.phys.uvic.ca
Tue Jul 25 18:00:54 EDT 2017


On 2017-07-25 07:45-0400 David Cole wrote:

> Alan, you had said in your original post:
>
> "Using find and xargs -0 grep I have looked in both 3.7.2 and 3.9.0
> source code for any mention of CMAKE_Java_CREATE_SHARED_MODULE, and it
> just does not exist."
>
> Try searching for "_CREATE_SHARED_MODULE" instead... it's combined in code with the name of the language.
>
> Just a hint about how to further the investigation. I'm curious what the result will be, but don't have time right now to dig in on something peripheral to my main to do list.

Hi David:

For a v3.8.2 checkout from the release branch, here are the results
for such a search with certain specific language results excluded as
well as results from cmake.vim which listed a very large line.

software at raven> find . -type f -print0 |xargs -0 grep _CREATE_SHARED_MODULE |grep -vE '_(C|CXX|Fortran|CUDA|CSharp|ASM\${ASM_DIALECT})_CREATE_SHARED_MODULE' |grep -v cmake.vim 
Binary file ./.git/index matches
./Help/manual/cmake-variables.7.rst:   /variable/CMAKE_LANG_CREATE_SHARED_MODULE
./Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst:CMAKE_<LANG>_CREATE_SHARED_MODULE
./Source/cmGeneratorTarget.cxx:      return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
./Source/cmMakefileLibraryTargetGenerator.cxx:  linkRuleVar += "_CREATE_SHARED_MODULE";
./Modules/Platform/Windows-GNU.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE
./Modules/Platform/CYGWIN-GNU.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE
./Modules/Platform/Windows-MSVC.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
./Modules/Platform/Windows-Embarcadero.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE
./Modules/Platform/Windows-Embarcadero.cmake:    ${CMAKE_${lang}_CREATE_SHARED_MODULE}
./Modules/CMakeAddNewLanguage.txt:   CMAKE_(LANG)_CREATE_SHARED_MODULE

Here are the corresponding results for v3.9.0 (without the cmake.vim
exclusion since that file does not appear to be present in that release).

software at raven> find . -type f -print0 |xargs -0 grep _CREATE_SHARED_MODULE |grep -vE '_(C|CXX|Fortran|CUDA|CSharp|ASM\${ASM_DIALECT})_CREATE_SHARED_MODULE'
Binary file ./.git/index matches
./Help/manual/cmake-variables.7.rst:   /variable/CMAKE_LANG_CREATE_SHARED_MODULE
./Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst:CMAKE_<LANG>_CREATE_SHARED_MODULE
./Source/cmGeneratorTarget.cxx:      return "CMAKE_" + lang + "_CREATE_SHARED_MODULE";
./Source/cmMakefileLibraryTargetGenerator.cxx:  linkRuleVar += "_CREATE_SHARED_MODULE";
./Modules/Platform/Windows-GNU.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE
./Modules/Platform/CYGWIN-GNU.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE
./Modules/Platform/Windows-MSVC.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
./Modules/Platform/Windows-Embarcadero.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE
./Modules/Platform/Windows-Embarcadero.cmake:    ${CMAKE_${lang}_CREATE_SHARED_MODULE}
./Modules/Platform/Windows-PGI.cmake:  set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
./Modules/CMakeAddNewLanguage.txt:   CMAKE_(LANG)_CREATE_SHARED_MODULE

I don't spot any differences between (working) CMake-3.8.x and
(non-working) CMake-3.9.0 except for some new Windows-PGI support
which is not relevant to this problem.

The error message I got was

-- Configuring done
CMake Error: Error required internal CMake variable not set, cmake may
not be built correctly.
Missing variable is:
CMAKE_Java_CREATE_SHARED_MODULE


Further finding and grepping found the function (in
Source/cmMakefile.cxx) that emitted that error message which is
defined as follows:

const char* cmMakefile::GetRequiredDefinition(const std::string& name) const
{
   const char* ret = this->GetDefinition(name);
   if (!ret) {
     cmSystemTools::Error("Error required internal CMake variable not "
                          "set, cmake may not be built correctly.\n",
                          "Missing variable is:\n", name.c_str());
     return "";
   }
   return ret;
}

A further check

software at raven> find . -type f -print0 |xargs -0 grep GetRequiredDefinition |wc -l
52

showed ~50 calls of that function, and I don't know which one of those
calls is generating this error message for 3.9.0 but not for
a release candidate for 3.8.0 (nor for 3.7.2).  But presumably that
call is somewhere down the call stack from the two mentions of
_CREATE_SHARED_MODULE shown above that are in Source.

I was hoping some CMake developer here could remember a fairly recent
language support infrastructure change in the run-up to 3.9.0 that is
likely causing this issue, and better yet could immediately think of
the Java language support changes that would need to be made to be
consistent with that hypothesized language support infrastructure
change.  But if nobody gets back to me on that question soon, then I
will go ahead and do a git bisect to help find the commit where the
Java language support issue first showed up.  (I have been reluctant
to spend the fairly substantial time to do that git bisect up to now
because I was fairly confident someone would respond on that
particular hypothesis, and most of my time right now is consumed with
dealing with some late release-cycle issues with PLplot.)

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the cmake-developers mailing list