Skip to content
Snippets Groups Projects
Commit 20df19f0 authored by Andreas Dedner's avatar Andreas Dedner
Browse files

minor bugfixes after changes in builder away from cmake:

- wrong use of `self` in deprecation message
- removal of generated files was not correctly adapted
parent 14766f4f
Branches
Tags
1 merge request!1168minor bugfixes after changes in builder away from cmake:
Pipeline #53584 passed
Pipeline: Dune Nightly Test

#53585

    ......@@ -30,8 +30,8 @@ logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
    cxxFlags = None
    noDepCheck = False
    def deprecationMessage():
    print(f"Using a pre-existing old style dune-py with a newer version of dune-common. Remove dune-py folder `{self.dune_py_dir}` and re-run Python script!")
    def deprecationMessage(dune_py_dir):
    print(f"Using a pre-existing old style dune-py with a newer version of dune-common. Remove dune-py folder `{dune_py_dir}` and re-run Python script!")
    print(f"It might also be required to execute 'cmake .' in the 'dune-common' build directory")
    print(f"It is possible to continue to use the old version by typing 'export DUNE_PY_USE_CMAKEBUILDER=1'")
    sys.exit(1)
    ......@@ -234,6 +234,7 @@ class Builder:
    # check return code
    if cmake.returncode > 0:
    # retrieve stderr output
    print(stderr,stdout)
    raise CompileError(buffer_to_str(stderr))
    return stdout, stderr
    ......@@ -485,7 +486,7 @@ class MakefileBuilder(Builder):
    active=True, # print details anyway
    )
    except CompileError:
    deprecationMessage()
    deprecationMessage(dunepy_dir)
    # now also generate compiler command
    stdout, stderr = \
    ......@@ -586,7 +587,7 @@ class MakefileBuilder(Builder):
    # check that the compile script is available
    script = os.path.join(self.generated_dir,"buildScript.sh")
    if not os.path.exists(script):
    deprecationMessage()
    deprecationMessage(self.dune_py_dir)
    # nothing to be done in this class
    def compile(self, infoTxt, target='all', verbose=False):
    ......
    ......@@ -14,6 +14,9 @@ def removeGenerated(modules = [], date=False):
    moduleFiles = set()
    def rmJit(fileBase):
    # do not remove the entry belonging to the dune-py template
    if fileBase == "extractCompiler":
    return
    removed = False
    try:
    ......@@ -83,6 +86,9 @@ def removeGenerated(modules = [], date=False):
    for base in bases:
    rmJit(base)
    for line in fileinput.input( os.path.join(generated_dir, 'CMakeLists.txt'), inplace = True):
    if not any( [m in line for m in moduleFiles] ):
    print(line, end="")
    # not sure what this was for but in the new builder version
    # this is not reasonable anymore.
    # Replace with something else?
    # for line in fileinput.input( os.path.join(generated_dir, 'CMakeLists.txt'), inplace = True):
    # if not any( [m in line for m in moduleFiles] ):
    # print(line, end="")
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment