From 686672aa5062a0363c037635b6d945160e9094c4 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 12 May 2020 13:57:08 -0700 Subject: Initial import from mongodb tree. https://github.com/mongodb/mongo --- SCons/Tool/compilation_db.py | 211 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 SCons/Tool/compilation_db.py diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py new file mode 100644 index 0000000..833be4a --- /dev/null +++ b/SCons/Tool/compilation_db.py @@ -0,0 +1,211 @@ +# Copyright 2020 MongoDB Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +import json +import SCons +import itertools + +# Implements the ability for SCons to emit a compilation database for the MongoDB project. See +# http://clang.llvm.org/docs/JSONCompilationDatabase.html for details on what a compilation +# database is, and why you might want one. The only user visible entry point here is +# 'env.CompilationDatabase'. This method takes an optional 'target' to name the file that +# should hold the compilation database, otherwise, the file defaults to compile_commands.json, +# which is the name that most clang tools search for by default. + +# TODO: Is there a better way to do this than this global? Right now this exists so that the +# emitter we add can record all of the things it emits, so that the scanner for the top level +# compilation database can access the complete list, and also so that the writer has easy +# access to write all of the files. But it seems clunky. How can the emitter and the scanner +# communicate more gracefully? +__COMPILATION_DB_ENTRIES = [] + +# Cribbed from Tool/cc.py and Tool/c++.py. It would be better if +# we could obtain this from SCons. +_CSuffixes = [".c"] +if not SCons.Util.case_sensitive_suffixes(".c", ".C"): + _CSuffixes.append(".C") + +_CXXSuffixes = [".cpp", ".cc", ".cxx", ".c++", ".C++"] +if SCons.Util.case_sensitive_suffixes(".c", ".C"): + _CXXSuffixes.append(".C") + + +# We make no effort to avoid rebuilding the entries. Someday, perhaps we could and even +# integrate with the cache, but there doesn't seem to be much call for it. +class __CompilationDbNode(SCons.Node.Python.Value): + def __init__(self, value): + SCons.Node.Python.Value.__init__(self, value) + self.Decider(changed_since_last_build_node) + + +def changed_since_last_build_node(child, target, prev_ni, node): + """ Dummy decider to force always building""" + return True + + +def makeEmitCompilationDbEntry(comstr): + """ + Effectively this creates a lambda function to capture: + * command line + * source + * target + :param comstr: unevaluated command line + :return: an emitter which has captured the above + """ + user_action = SCons.Action.Action(comstr) + + def EmitCompilationDbEntry(target, source, env): + """ + This emitter will be added to each c/c++ object build to capture the info needed + for clang tools + :param target: target node(s) + :param source: source node(s) + :param env: Environment for use building this node + :return: target(s), source(s) + """ + + dbtarget = __CompilationDbNode(source) + + entry = env.__COMPILATIONDB_Entry( + target=dbtarget, + source=[], + __COMPILATIONDB_UTARGET=target, + __COMPILATIONDB_USOURCE=source, + __COMPILATIONDB_UACTION=user_action, + __COMPILATIONDB_ENV=env, + ) + + # TODO: Technically, these next two lines should not be required: it should be fine to + # cache the entries. However, they don't seem to update properly. Since they are quick + # to re-generate disable caching and sidestep this problem. + env.AlwaysBuild(entry) + env.NoCache(entry) + + __COMPILATION_DB_ENTRIES.append(dbtarget) + + return target, source + + return EmitCompilationDbEntry + + +def CompilationDbEntryAction(target, source, env, **kw): + """ + Create a dictionary with evaluated command line, target, source + and store that info as an attribute on the target + (Which has been stored in __COMPILATION_DB_ENTRIES array + :param target: target node(s) + :param source: source node(s) + :param env: Environment for use building this node + :param kw: + :return: None + """ + + command = env["__COMPILATIONDB_UACTION"].strfunction( + target=env["__COMPILATIONDB_UTARGET"], + source=env["__COMPILATIONDB_USOURCE"], + env=env["__COMPILATIONDB_ENV"], + ) + + entry = { + "directory": env.Dir("#").abspath, + "command": command, + "file": str(env["__COMPILATIONDB_USOURCE"][0]), + } + + target[0].write(entry) + + +def WriteCompilationDb(target, source, env): + entries = [] + + for s in __COMPILATION_DB_ENTRIES: + entries.append(s.read()) + + with open(str(target[0]), "w") as target_file: + json.dump( + entries, target_file, sort_keys=True, indent=4, separators=(",", ": ") + ) + + +def ScanCompilationDb(node, env, path): + return __COMPILATION_DB_ENTRIES + + +def generate(env, **kwargs): + + static_obj, shared_obj = SCons.Tool.createObjBuilders(env) + + env["COMPILATIONDB_COMSTR"] = kwargs.get( + "COMPILATIONDB_COMSTR", "Building compilation database $TARGET" + ) + + components_by_suffix = itertools.chain( + itertools.product( + _CSuffixes, + [ + (static_obj, SCons.Defaults.StaticObjectEmitter, "$CCCOM"), + (shared_obj, SCons.Defaults.SharedObjectEmitter, "$SHCCCOM"), + ], + ), + itertools.product( + _CXXSuffixes, + [ + (static_obj, SCons.Defaults.StaticObjectEmitter, "$CXXCOM"), + (shared_obj, SCons.Defaults.SharedObjectEmitter, "$SHCXXCOM"), + ], + ), + ) + + for entry in components_by_suffix: + suffix = entry[0] + builder, base_emitter, command = entry[1] + + # Assumes a dictionary emitter + emitter = builder.emitter[suffix] + builder.emitter[suffix] = SCons.Builder.ListEmitter( + [emitter, makeEmitCompilationDbEntry(command),] + ) + + env["BUILDERS"]["__COMPILATIONDB_Entry"] = SCons.Builder.Builder( + action=SCons.Action.Action(CompilationDbEntryAction, None), + ) + + env["BUILDERS"]["__COMPILATIONDB_Database"] = SCons.Builder.Builder( + action=SCons.Action.Action(WriteCompilationDb, "$COMPILATIONDB_COMSTR"), + target_scanner=SCons.Scanner.Scanner( + function=ScanCompilationDb, node_class=None + ), + ) + + def CompilationDatabase(env, target): + result = env.__COMPILATIONDB_Database(target=target, source=[]) + + env.AlwaysBuild(result) + env.NoCache(result) + + return result + + env.AddMethod(CompilationDatabase, "CompilationDatabase") + + +def exists(env): + return True -- cgit v0.12 From bf151381fc07a335c87766cc8165b64c54b67f2a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 12 May 2020 14:16:57 -0700 Subject: refactor function names per PEP8. Pull C & C++ file extensions from cc and cxx tools respectively --- SCons/Tool/compilation_db.py | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index 833be4a..75fa696 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -23,6 +23,8 @@ import json import SCons import itertools +from cxx import CXXSuffixes +from cc import CSuffixes # Implements the ability for SCons to emit a compilation database for the MongoDB project. See # http://clang.llvm.org/docs/JSONCompilationDatabase.html for details on what a compilation @@ -38,16 +40,6 @@ import itertools # communicate more gracefully? __COMPILATION_DB_ENTRIES = [] -# Cribbed from Tool/cc.py and Tool/c++.py. It would be better if -# we could obtain this from SCons. -_CSuffixes = [".c"] -if not SCons.Util.case_sensitive_suffixes(".c", ".C"): - _CSuffixes.append(".C") - -_CXXSuffixes = [".cpp", ".cc", ".cxx", ".c++", ".C++"] -if SCons.Util.case_sensitive_suffixes(".c", ".C"): - _CXXSuffixes.append(".C") - # We make no effort to avoid rebuilding the entries. Someday, perhaps we could and even # integrate with the cache, but there doesn't seem to be much call for it. @@ -62,7 +54,7 @@ def changed_since_last_build_node(child, target, prev_ni, node): return True -def makeEmitCompilationDbEntry(comstr): +def make_emit_compilation_DB_entry(comstr): """ Effectively this creates a lambda function to capture: * command line @@ -73,7 +65,7 @@ def makeEmitCompilationDbEntry(comstr): """ user_action = SCons.Action.Action(comstr) - def EmitCompilationDbEntry(target, source, env): + def emit_compilation_db_entry(target, source, env): """ This emitter will be added to each c/c++ object build to capture the info needed for clang tools @@ -104,10 +96,10 @@ def makeEmitCompilationDbEntry(comstr): return target, source - return EmitCompilationDbEntry + return emit_compilation_db_entry -def CompilationDbEntryAction(target, source, env, **kw): +def compilation_db_entry_action(target, source, env, **kw): """ Create a dictionary with evaluated command line, target, source and store that info as an attribute on the target @@ -134,7 +126,7 @@ def CompilationDbEntryAction(target, source, env, **kw): target[0].write(entry) -def WriteCompilationDb(target, source, env): +def write_compilation_db(target, source, env): entries = [] for s in __COMPILATION_DB_ENTRIES: @@ -146,7 +138,7 @@ def WriteCompilationDb(target, source, env): ) -def ScanCompilationDb(node, env, path): +def scan_compilation_db(node, env, path): return __COMPILATION_DB_ENTRIES @@ -160,14 +152,14 @@ def generate(env, **kwargs): components_by_suffix = itertools.chain( itertools.product( - _CSuffixes, + CSuffixes, [ (static_obj, SCons.Defaults.StaticObjectEmitter, "$CCCOM"), (shared_obj, SCons.Defaults.SharedObjectEmitter, "$SHCCCOM"), ], ), itertools.product( - _CXXSuffixes, + CXXSuffixes, [ (static_obj, SCons.Defaults.StaticObjectEmitter, "$CXXCOM"), (shared_obj, SCons.Defaults.SharedObjectEmitter, "$SHCXXCOM"), @@ -182,17 +174,17 @@ def generate(env, **kwargs): # Assumes a dictionary emitter emitter = builder.emitter[suffix] builder.emitter[suffix] = SCons.Builder.ListEmitter( - [emitter, makeEmitCompilationDbEntry(command),] + [emitter, make_emit_compilation_DB_entry(command), ] ) env["BUILDERS"]["__COMPILATIONDB_Entry"] = SCons.Builder.Builder( - action=SCons.Action.Action(CompilationDbEntryAction, None), + action=SCons.Action.Action(compilation_db_entry_action, None), ) env["BUILDERS"]["__COMPILATIONDB_Database"] = SCons.Builder.Builder( - action=SCons.Action.Action(WriteCompilationDb, "$COMPILATIONDB_COMSTR"), + action=SCons.Action.Action(write_compilation_db, "$COMPILATIONDB_COMSTR"), target_scanner=SCons.Scanner.Scanner( - function=ScanCompilationDb, node_class=None + function=scan_compilation_db, node_class=None ), ) -- cgit v0.12 From 02dbb38a03e88cbce75af348d3045874f3fa8acc Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 13:18:46 -0700 Subject: Rename as.py to asm.py and add to TOOL_ALIASES. 'as' is reserved keyword so couldn't be imported into compilation_db tool. Add initial bits of test and docs --- CHANGES.txt | 3 + SCons/Tool/__init__.py | 7 +- SCons/Tool/as.py | 40 +----- SCons/Tool/asm.py | 78 +++++++++++ SCons/Tool/compilation_db.py | 62 ++++++--- SCons/Tool/compilation_db.xml | 209 ++++++++++++++++++++++++++++ test/CompilationDatabase/basic.py | 7 + test/CompilationDatabase/fixture/SConstruct | 6 + 8 files changed, 354 insertions(+), 58 deletions(-) create mode 100644 SCons/Tool/asm.py create mode 100644 SCons/Tool/compilation_db.xml create mode 100644 test/CompilationDatabase/basic.py create mode 100644 test/CompilationDatabase/fixture/SConstruct diff --git a/CHANGES.txt b/CHANGES.txt index f336170..414825d 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -53,6 +53,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Speedup bin/docs-update-generated by caching parsed docbook schema. (60x speedup) - Reorganized source tree. Moved src/engine/SCons to SCons to be more in line with current Python source tree organization practices. + - Renamed as.py to asm.py and left redirecting tool. 'as' is a reserved word and so + changing the name was required as we wanted to import symbols for use in compilation_db + tool. From Jeremy Elson: - Updated design doc to use the correct syntax for Depends() diff --git a/SCons/Tool/__init__.py b/SCons/Tool/__init__.py index 7aab554..dc9fb45 100644 --- a/SCons/Tool/__init__.py +++ b/SCons/Tool/__init__.py @@ -94,11 +94,14 @@ for suffix in LaTeXSuffixes: SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner) # Tool aliases are needed for those tools whose module names also -# occur in the python standard library. This causes module shadowing and -# can break using python library functions under python3 +# occur in the python standard library (This causes module shadowing and +# can break using python library functions under python3) or if the current tool/file names +# are not legal module names (violate python's identifier rules or are +# python language keywords). TOOL_ALIASES = { 'gettext': 'gettext_tool', 'clang++': 'clangxx', + 'as': 'asm', } diff --git a/SCons/Tool/as.py b/SCons/Tool/as.py index c748251..2c9f1a1 100644 --- a/SCons/Tool/as.py +++ b/SCons/Tool/as.py @@ -1,11 +1,10 @@ """SCons.Tool.as -Tool-specific initialization for as, the generic Posix assembler. +Tool-specific initialization for generic assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. - """ # @@ -33,43 +32,10 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.Defaults -import SCons.Tool -import SCons.Util - -assemblers = ['as'] - -ASSuffixes = ['.s', '.asm', '.ASM'] -ASPPSuffixes = ['.spp', '.SPP', '.sx'] -if SCons.Util.case_sensitive_suffixes('.s', '.S'): - ASPPSuffixes.extend(['.S']) -else: - ASSuffixes.extend(['.S']) - -def generate(env): - """Add Builders and construction variables for as to an Environment.""" - static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - - for suffix in ASSuffixes: - static_obj.add_action(suffix, SCons.Defaults.ASAction) - shared_obj.add_action(suffix, SCons.Defaults.ASAction) - static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) - shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) - - for suffix in ASPPSuffixes: - static_obj.add_action(suffix, SCons.Defaults.ASPPAction) - shared_obj.add_action(suffix, SCons.Defaults.ASPPAction) - static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) - shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) - env['AS'] = env.Detect(assemblers) or 'as' - env['ASFLAGS'] = SCons.Util.CLVar('') - env['ASCOM'] = '$AS $ASFLAGS -o $TARGET $SOURCES' - env['ASPPFLAGS'] = '$ASFLAGS' - env['ASPPCOM'] = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' +#forward proxy to the preffered asm version +from SCons.Tool.asm import * -def exists(env): - return env.Detect(assemblers) # Local Variables: # tab-width:4 diff --git a/SCons/Tool/asm.py b/SCons/Tool/asm.py new file mode 100644 index 0000000..c748251 --- /dev/null +++ b/SCons/Tool/asm.py @@ -0,0 +1,78 @@ +"""SCons.Tool.as + +Tool-specific initialization for as, the generic Posix assembler. + +There normally shouldn't be any need to import this module directly. +It will usually be imported through the generic SCons.Tool.Tool() +selection method. + +""" + +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +import SCons.Defaults +import SCons.Tool +import SCons.Util + +assemblers = ['as'] + +ASSuffixes = ['.s', '.asm', '.ASM'] +ASPPSuffixes = ['.spp', '.SPP', '.sx'] +if SCons.Util.case_sensitive_suffixes('.s', '.S'): + ASPPSuffixes.extend(['.S']) +else: + ASSuffixes.extend(['.S']) + +def generate(env): + """Add Builders and construction variables for as to an Environment.""" + static_obj, shared_obj = SCons.Tool.createObjBuilders(env) + + for suffix in ASSuffixes: + static_obj.add_action(suffix, SCons.Defaults.ASAction) + shared_obj.add_action(suffix, SCons.Defaults.ASAction) + static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) + shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) + + for suffix in ASPPSuffixes: + static_obj.add_action(suffix, SCons.Defaults.ASPPAction) + shared_obj.add_action(suffix, SCons.Defaults.ASPPAction) + static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter) + shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter) + + env['AS'] = env.Detect(assemblers) or 'as' + env['ASFLAGS'] = SCons.Util.CLVar('') + env['ASCOM'] = '$AS $ASFLAGS -o $TARGET $SOURCES' + env['ASPPFLAGS'] = '$ASFLAGS' + env['ASPPCOM'] = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' + +def exists(env): + return env.Detect(assemblers) + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index 75fa696..4767d9e 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -1,3 +1,12 @@ +""" +Implements the ability for SCons to emit a compilation database for the MongoDB project. See +http://clang.llvm.org/docs/JSONCompilationDatabase.html for details on what a compilation +database is, and why you might want one. The only user visible entry point here is +'env.CompilationDatabase'. This method takes an optional 'target' to name the file that +should hold the compilation database, otherwise, the file defaults to compile_commands.json, +which is the name that most clang tools search for by default. +""" + # Copyright 2020 MongoDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining @@ -21,17 +30,12 @@ # import json -import SCons import itertools -from cxx import CXXSuffixes -from cc import CSuffixes +import SCons -# Implements the ability for SCons to emit a compilation database for the MongoDB project. See -# http://clang.llvm.org/docs/JSONCompilationDatabase.html for details on what a compilation -# database is, and why you might want one. The only user visible entry point here is -# 'env.CompilationDatabase'. This method takes an optional 'target' to name the file that -# should hold the compilation database, otherwise, the file defaults to compile_commands.json, -# which is the name that most clang tools search for by default. +from .cxx import CXXSuffixes +from .cc import CSuffixes +from .asm import ASSuffixes, ASPPSuffixes # TODO: Is there a better way to do this than this global? Right now this exists so that the # emitter we add can record all of the things it emits, so that the scanner for the top level @@ -117,10 +121,18 @@ def compilation_db_entry_action(target, source, env, **kw): env=env["__COMPILATIONDB_ENV"], ) + if env['COMPILATIONDB_USE_ABSPATH']: + filename = env["__COMPILATIONDB_USOURCE"][0].abspath + target_name = env['__COMPILATIONDB_UTARGET'][0].abspath + else: + filename = env["__COMPILATIONDB_USOURCE"][0].path + target_name = env['__COMPILATIONDB_UTARGET'][0].path + entry = { "directory": env.Dir("#").abspath, "command": command, - "file": str(env["__COMPILATIONDB_USOURCE"][0]), + "file": filename, + "target": target_name } target[0].write(entry) @@ -132,7 +144,7 @@ def write_compilation_db(target, source, env): for s in __COMPILATION_DB_ENTRIES: entries.append(s.read()) - with open(str(target[0]), "w") as target_file: + with open(target[0].path, "w") as target_file: json.dump( entries, target_file, sort_keys=True, indent=4, separators=(",", ": ") ) @@ -142,8 +154,16 @@ def scan_compilation_db(node, env, path): return __COMPILATION_DB_ENTRIES -def generate(env, **kwargs): +def CompilationDatabase(env, target='compile_commands.json'): + result = env.__COMPILATIONDB_Database(target=target, source=[]) + + env.AlwaysBuild(result) + env.NoCache(result) + + return result + +def generate(env, **kwargs): static_obj, shared_obj = SCons.Tool.createObjBuilders(env) env["COMPILATIONDB_COMSTR"] = kwargs.get( @@ -165,6 +185,16 @@ def generate(env, **kwargs): (shared_obj, SCons.Defaults.SharedObjectEmitter, "$SHCXXCOM"), ], ), + itertools.product( + ASSuffixes, + [(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASCOM")], + [(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASCOM")], + ), + itertools.product( + ASPPSuffixes, + [(static_obj, SCons.Defaults.StaticObjectEmitter, "$ASPPCOM")], + [(shared_obj, SCons.Defaults.SharedObjectEmitter, "$ASPPCOM")], + ), ) for entry in components_by_suffix: @@ -188,13 +218,7 @@ def generate(env, **kwargs): ), ) - def CompilationDatabase(env, target): - result = env.__COMPILATIONDB_Database(target=target, source=[]) - - env.AlwaysBuild(result) - env.NoCache(result) - - return result + env['COMPILATIONDB_USE_ABSPATH'] = False env.AddMethod(CompilationDatabase, "CompilationDatabase") diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml new file mode 100644 index 0000000..bb7bfb6 --- /dev/null +++ b/SCons/Tool/compilation_db.xml @@ -0,0 +1,209 @@ + + + + +%scons; + +%builders-mod; + +%functions-mod; + +%tools-mod; + +%variables-mod; +]> + + + + + + +Sets up CompilationDatabase builder. + + + This builder generates a clang tooling compatible compilation database. + + + +COMPILATIONDB_COMSTR +__COMPILATIONDB_UACTION +__COMPILATIONDB_UTARGET +__COMPILATIONDB_USOURCE +__COMPILATIONDB_ENV +COMPILATIONDB_USE_ABSPATH + + + + + + + + + + + +The C compiler. + + + + + + + +The command line used to compile a C source file to a (static) object +file. Any options specified in the &cv-link-CFLAGS;, &cv-link-CCFLAGS; and +&cv-link-CPPFLAGS; construction variables are included on this command line. +See also &cv-link-SHCCCOM; for compiling to shared objects. + + + + + + + +If set, the string displayed when a C source file +is compiled to a (static) object file. +If not set, then &cv-link-CCCOM; (the command line) is displayed. +See also &cv-link-SHCCCOMSTR; for compiling to shared objects. + + + +env = Environment(CCCOMSTR = "Compiling static object $TARGET") + + + + + + + +General options that are passed to the C and C++ compilers. +See also &cv-link-SHCCFLAGS; for compiling to shared objects. + + + + + + + +General options that are passed to the C compiler (C only; not C++). +See also &cv-link-SHCFLAGS; for compiling to shared objects. + + + + + + + +User-specified C preprocessor options. +These will be included in any command that uses the C preprocessor, +including not just compilation of C and C++ source files +via the &cv-link-CCCOM;, +&cv-link-SHCCCOM;, +&cv-link-CXXCOM; and +&cv-link-SHCXXCOM; command lines, +but also the &cv-link-FORTRANPPCOM;, +&cv-link-SHFORTRANPPCOM;, +&cv-link-F77PPCOM; and +&cv-link-SHF77PPCOM; command lines +used to compile a Fortran source file, +and the &cv-link-ASPPCOM; command line +used to assemble an assembly language source file, +after first running each file through the C preprocessor. +Note that this variable does +not +contain + +(or similar) include search path options +that scons generates automatically from &cv-link-CPPPATH;. +See &cv-link-_CPPINCFLAGS;, below, +for the variable that expands to those options. + + + + + + + +The list of suffixes of files that will be scanned +for C preprocessor implicit dependencies +(#include lines). +The default list is: + + + +[".c", ".C", ".cxx", ".cpp", ".c++", ".cc", + ".h", ".H", ".hxx", ".hpp", ".hh", + ".F", ".fpp", ".FPP", + ".m", ".mm", + ".S", ".spp", ".SPP"] + + + + + + + +The C compiler used for generating shared-library objects. +See also &cv-link-CC; for compiling to static objects. + + + + + + + +The command line used to compile a C source file +to a shared-library object file. +Any options specified in the &cv-link-SHCFLAGS;, +&cv-link-SHCCFLAGS; and +&cv-link-CPPFLAGS; construction variables +are included on this command line. +See also &cv-link-CCCOM; for compiling to static objects. + + + + + + + +If set, the string displayed when a C source file +is compiled to a shared object file. +If not set, then &cv-link-SHCCCOM; (the command line) is displayed. +See also &cv-link-CCCOMSTR; for compiling to static objects. + + + +env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET") + + + + + + + +Options that are passed to the C and C++ compilers +to generate shared-library objects. +See also &cv-link-CCFLAGS; for compiling to static objects. + + + + + + + +Options that are passed to the C compiler (only; not C++) +to generate shared-library objects. +See also &cv-link-CFLAGS; for compiling to static objects. + + + + + diff --git a/test/CompilationDatabase/basic.py b/test/CompilationDatabase/basic.py new file mode 100644 index 0000000..b2808eb --- /dev/null +++ b/test/CompilationDatabase/basic.py @@ -0,0 +1,7 @@ +import TestSCons + +test = TestSCons.TestSCons() +test.file_fixture('fixture/SConstruct') +test.file_fixture('test_main.c') +test.run() +test.must_exist('compile_commands.jxson') \ No newline at end of file diff --git a/test/CompilationDatabase/fixture/SConstruct b/test/CompilationDatabase/fixture/SConstruct new file mode 100644 index 0000000..d01ac91 --- /dev/null +++ b/test/CompilationDatabase/fixture/SConstruct @@ -0,0 +1,6 @@ +DefaultEnvironment(tools=[]) +env = Environment() +env.Tool('compilation_db') + +env.Program('main', 'test_main.c') +env.CompilationDatabase('compile_commands.json') -- cgit v0.12 From a1a47b77666e20e391ebbf81053caf0154a93093 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 14:53:13 -0700 Subject: Updates to doc. Still WIP --- SCons/Tool/compilation_db.xml | 290 ++++++++++++++---------------------------- bin/SConsDoc.py | 1 + 2 files changed, 99 insertions(+), 192 deletions(-) diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index bb7bfb6..b9141b6 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -7,203 +7,109 @@ See its __doc__ string for a discussion of the format. --> -%scons; - -%builders-mod; - -%functions-mod; - -%tools-mod; - -%variables-mod; -]> + + %scons; + + %builders-mod; + + %functions-mod; + + %tools-mod; + + %variables-mod; + ]> - - - -Sets up CompilationDatabase builder. - - - This builder generates a clang tooling compatible compilation database. - - - -COMPILATIONDB_COMSTR -__COMPILATIONDB_UACTION -__COMPILATIONDB_UTARGET -__COMPILATIONDB_USOURCE -__COMPILATIONDB_ENV -COMPILATIONDB_USE_ABSPATH - - - - - - - + + + + Sets up &b-CompilationDatabase; Pseudo builder. + + + This builder generates a clang tooling compatible compilation database. + Note: If there's no specified target file, it will default to + compile_commands.json + + + + COMPILATIONDB_COMSTR + __COMPILATIONDB_UACTION + __COMPILATIONDB_UTARGET + __COMPILATIONDB_USOURCE + __COMPILATIONDB_ENV + COMPILATIONDB_USE_ABSPATH + + + + + + + The &b-CompilationDatabase; builder writes a + clang formatted compilation + database + + + + This is consumed by a number of clang tools. + + + + + + + + The string displayed when CompilationDatabase builder's action is run. + + + + + + + + This is a boolean flag to instruct &b-link-CompilationDatabase; to + write the file and target members + in the target file with absolute or relative path. + + + The default value is False. + + + + + + + This variable stores the action for building a target. + It's intended for internal usage by &b-link-CompilationDatabase; only. + + + + + + + This variable stores the action for building a target. + It's intended for internal usage by &b-link-CompilationDatabase; only. + + + + + + + This variable stores the action for building a target. + It's intended for internal usage by &b-link-CompilationDatabase; only. + + + + + + + This variable stores the action for building a target. + It's intended for internal usage by &b-link-CompilationDatabase; only. + + + - - - -The C compiler. - - - - - - - -The command line used to compile a C source file to a (static) object -file. Any options specified in the &cv-link-CFLAGS;, &cv-link-CCFLAGS; and -&cv-link-CPPFLAGS; construction variables are included on this command line. -See also &cv-link-SHCCCOM; for compiling to shared objects. - - - - - - - -If set, the string displayed when a C source file -is compiled to a (static) object file. -If not set, then &cv-link-CCCOM; (the command line) is displayed. -See also &cv-link-SHCCCOMSTR; for compiling to shared objects. - - - -env = Environment(CCCOMSTR = "Compiling static object $TARGET") - - - - - - - -General options that are passed to the C and C++ compilers. -See also &cv-link-SHCCFLAGS; for compiling to shared objects. - - - - - - - -General options that are passed to the C compiler (C only; not C++). -See also &cv-link-SHCFLAGS; for compiling to shared objects. - - - - - - - -User-specified C preprocessor options. -These will be included in any command that uses the C preprocessor, -including not just compilation of C and C++ source files -via the &cv-link-CCCOM;, -&cv-link-SHCCCOM;, -&cv-link-CXXCOM; and -&cv-link-SHCXXCOM; command lines, -but also the &cv-link-FORTRANPPCOM;, -&cv-link-SHFORTRANPPCOM;, -&cv-link-F77PPCOM; and -&cv-link-SHF77PPCOM; command lines -used to compile a Fortran source file, -and the &cv-link-ASPPCOM; command line -used to assemble an assembly language source file, -after first running each file through the C preprocessor. -Note that this variable does -not -contain - -(or similar) include search path options -that scons generates automatically from &cv-link-CPPPATH;. -See &cv-link-_CPPINCFLAGS;, below, -for the variable that expands to those options. - - - - - - - -The list of suffixes of files that will be scanned -for C preprocessor implicit dependencies -(#include lines). -The default list is: - - - -[".c", ".C", ".cxx", ".cpp", ".c++", ".cc", - ".h", ".H", ".hxx", ".hpp", ".hh", - ".F", ".fpp", ".FPP", - ".m", ".mm", - ".S", ".spp", ".SPP"] - - - - - - - -The C compiler used for generating shared-library objects. -See also &cv-link-CC; for compiling to static objects. - - - - - - - -The command line used to compile a C source file -to a shared-library object file. -Any options specified in the &cv-link-SHCFLAGS;, -&cv-link-SHCCFLAGS; and -&cv-link-CPPFLAGS; construction variables -are included on this command line. -See also &cv-link-CCCOM; for compiling to static objects. - - - - - - - -If set, the string displayed when a C source file -is compiled to a shared object file. -If not set, then &cv-link-SHCCCOM; (the command line) is displayed. -See also &cv-link-CCCOMSTR; for compiling to static objects. - - - -env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET") - - - - - - - -Options that are passed to the C and C++ compilers -to generate shared-library objects. -See also &cv-link-CCFLAGS; for compiling to static objects. - - - - - - - -Options that are passed to the C compiler (only; not C++) -to generate shared-library objects. -See also &cv-link-CFLAGS; for compiling to static objects. - - - diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py index 960a0c9..e869146 100644 --- a/bin/SConsDoc.py +++ b/bin/SConsDoc.py @@ -688,6 +688,7 @@ def validate_all_xml(dpaths, xsdfile=default_xsd): fpaths.append(fp) fails = [] + fpaths = sorted(fpaths) for idx, fp in enumerate(fpaths): fpath = os.path.join(path, fp) print("%.2f%s (%d/%d) %s" % (float(idx + 1) * 100.0 /float(len(fpaths)), -- cgit v0.12 From 97bc344bcb78a8cfbea0e5417b7b461f1d066ce7 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 16:14:50 -0700 Subject: extract fake gcc and link python scripts to fixture. We'll use these for CompilationDatabase tests --- test/CPPFLAGS.py | 57 ++++---------------------------------------- test/fixture/mygcc.py | 17 +++++++++++++ test/fixture/mylink_win32.py | 0 3 files changed, 21 insertions(+), 53 deletions(-) create mode 100644 test/fixture/mygcc.py create mode 100644 test/fixture/mylink_win32.py diff --git a/test/CPPFLAGS.py b/test/CPPFLAGS.py index 4c656a1..78d28e8 100644 --- a/test/CPPFLAGS.py +++ b/test/CPPFLAGS.py @@ -32,68 +32,19 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -# Writing this to accomodate both our in-line tool chain and the +# Writing this to accommodate both our in-line tool chain and the # MSVC command lines is too hard, and will be completely unnecessary # some day when we separate our tests. Punt for now. if sys.platform == 'win32': test.skip_test('Skipping on win32.\n') - - if sys.platform == 'win32': - - test.write('mylink.py', r""" -import sys -args = sys.argv[1:] -while args: - a = args[0] - if a[0] != '/': - break - args.pop(0) - if a[:5] == '/OUT:': out = a[5:] -with open(out, 'w') as ofp, open(args[0], 'r') as ifp: - for l in ifp.readlines(): - if l[:5] != '#link': - ofp.write(l) -sys.exit(0) -""") - + test.file_fixture('mylink_win32.py', 'mylink.py') else: + test.file_fixture('mylink.py') - test.write('mylink.py', r""" -import getopt -import sys -opts, args = getopt.getopt(sys.argv[1:], 'o:s:') -for opt, arg in opts: - if opt == '-o': out = arg -with open(out, 'w') as ofp: - for f in args: - with open(f, 'r') as ifp: - for l in ifp.readlines(): - if l[:5] != '#link': - ofp.write(l) -sys.exit(0) -""") - -test.write('mygcc.py', r""" -import getopt -import os -import sys -compiler = sys.argv[1] -clen = len(compiler) + 1 -opts, args = getopt.getopt(sys.argv[2:], 'co:xf:K:') -for opt, arg in opts: - if opt == '-o': out = arg - elif opt == '-x': - with open('mygcc.out', 'a') as f: - f.write(compiler + "\n") -with open(out, 'w') as ofp, open(args[0], 'r') as ifp: - for l in ifp.readlines(): - if l[:clen] != '#' + compiler: - ofp.write(l) -sys.exit(0) -""") +test.file_fixture('mygcc.py') test.write('SConstruct', """ diff --git a/test/fixture/mygcc.py b/test/fixture/mygcc.py new file mode 100644 index 0000000..76634cb --- /dev/null +++ b/test/fixture/mygcc.py @@ -0,0 +1,17 @@ + +import getopt +import os +import sys +compiler = sys.argv[1] +clen = len(compiler) + 1 +opts, args = getopt.getopt(sys.argv[2:], 'co:xf:K:') +for opt, arg in opts: + if opt == '-o': out = arg + elif opt == '-x': + with open('mygcc.out', 'a') as f: + f.write(compiler + "\n") +with open(out, 'w') as ofp, open(args[0], 'r') as ifp: + for l in ifp.readlines(): + if l[:clen] != '#' + compiler: + ofp.write(l) +sys.exit(0) diff --git a/test/fixture/mylink_win32.py b/test/fixture/mylink_win32.py new file mode 100644 index 0000000..e69de29 -- cgit v0.12 From 9d1cae7754e208dbb5a45769563eb5581d4b3dd4 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 16:21:58 -0700 Subject: more test updates --- test/CPPFLAGS.py | 1 - test/CompilationDatabase/basic.py | 17 +++++++++- test/CompilationDatabase/fixture/SConstruct | 17 ++++++++-- test/fixture/mygcc.py | 6 ++-- test/fixture/mylink.py | 50 ++++++++--------------------- test/fixture/mylink_win32.py | 16 +++++++++ 6 files changed, 64 insertions(+), 43 deletions(-) diff --git a/test/CPPFLAGS.py b/test/CPPFLAGS.py index 78d28e8..2808a53 100644 --- a/test/CPPFLAGS.py +++ b/test/CPPFLAGS.py @@ -43,7 +43,6 @@ if sys.platform == 'win32': else: test.file_fixture('mylink.py') - test.file_fixture('mygcc.py') diff --git a/test/CompilationDatabase/basic.py b/test/CompilationDatabase/basic.py index b2808eb..927bec7 100644 --- a/test/CompilationDatabase/basic.py +++ b/test/CompilationDatabase/basic.py @@ -1,7 +1,22 @@ +import sys import TestSCons + test = TestSCons.TestSCons() + +if sys.platform == 'win32': + test.file_fixture('mylink_win32.py', 'mylink.py') +else: + test.file_fixture('mylink.py') + +test.file_fixture('mygcc.py') + +test.verbose_set(1) test.file_fixture('fixture/SConstruct') test.file_fixture('test_main.c') test.run() -test.must_exist('compile_commands.jxson') \ No newline at end of file +test.must_exist('compile_commands.json') + +# Now test with absolute paths +test.run(arguments='ABSPATH=1') +test.must_exist('compile_commands_abs.json') diff --git a/test/CompilationDatabase/fixture/SConstruct b/test/CompilationDatabase/fixture/SConstruct index d01ac91..0f8944e 100644 --- a/test/CompilationDatabase/fixture/SConstruct +++ b/test/CompilationDatabase/fixture/SConstruct @@ -1,6 +1,19 @@ +import sys + DefaultEnvironment(tools=[]) -env = Environment() +env = Environment( + PYTHON=sys.executable, + LINK='$PYTHON mylink.py', + LINKFLAGS=[], + CC='$PYTHON mygcc.py cc', + CXX='$PYTHON mygcc.py c++', +) env.Tool('compilation_db') +if ARGUMENTS.get('ABSPATH', False): + env['COMPILATIONDB_USE_ABSPATH'] = True + env.CompilationDatabase('compile_commands_abs.json') +else: + env.CompilationDatabase('compile_commands.json') + env.Program('main', 'test_main.c') -env.CompilationDatabase('compile_commands.json') diff --git a/test/fixture/mygcc.py b/test/fixture/mygcc.py index 76634cb..02480ee 100644 --- a/test/fixture/mygcc.py +++ b/test/fixture/mygcc.py @@ -1,15 +1,17 @@ - import getopt import os import sys + compiler = sys.argv[1] clen = len(compiler) + 1 opts, args = getopt.getopt(sys.argv[2:], 'co:xf:K:') for opt, arg in opts: - if opt == '-o': out = arg + if opt == '-o': + out = arg elif opt == '-x': with open('mygcc.out', 'a') as f: f.write(compiler + "\n") + with open(out, 'w') as ofp, open(args[0], 'r') as ifp: for l in ifp.readlines(): if l[:clen] != '#' + compiler: diff --git a/test/fixture/mylink.py b/test/fixture/mylink.py index 38d9846..85646a4 100644 --- a/test/fixture/mylink.py +++ b/test/fixture/mylink.py @@ -1,39 +1,15 @@ -r""" -Phony "linker" for testing SCons. - -Recognizes the option to specify an output file, ignoring -all others; copies input lines to the output file except -ones that contain a pattern, so we can recognize the tool -has made a modification. -""" - +import getopt import sys -if __name__ == '__main__': - if sys.platform == 'win32': - args = sys.argv[1:] - while args: - a = args[0] - if a == '-o': - out = args[1] - args = args[2:] - continue - if not a[0] in '/-': - break - args = args[1:] - if a[:5].lower() == '/out:': out = a[5:] - with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: - for line in ifp: - if not line.startswith(b'#link'): - ofp.write(line) - sys.exit(0) - else: - import getopt - opts, args = getopt.getopt(sys.argv[1:], 'o:') - for opt, arg in opts: - if opt == '-o': out = arg - with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: - for line in ifp: - if not line.startswith(b'#link'): - ofp.write(line) - sys.exit(0) +opts, args = getopt.getopt(sys.argv[1:], 'o:s:') +for opt, arg in opts: + if opt == '-o': + out = arg + +with open(out, 'w') as ofp: + for f in args: + with open(f, 'r') as ifp: + for l in ifp.readlines(): + if l[:5] != '#link': + ofp.write(l) +sys.exit(0) diff --git a/test/fixture/mylink_win32.py b/test/fixture/mylink_win32.py index e69de29..438e920 100644 --- a/test/fixture/mylink_win32.py +++ b/test/fixture/mylink_win32.py @@ -0,0 +1,16 @@ +import sys + +args = sys.argv[1:] +while args: + a = args[0] + if a[0] != '/': + break + args.pop(0) + if a[:5] == '/OUT:': + out = a[5:] + +with open(out, 'w') as ofp, open(args[0], 'r') as ifp: + for l in ifp.readlines(): + if l[:5] != '#link': + ofp.write(l) +sys.exit(0) -- cgit v0.12 From 97650c632c4798f939cef6222292e4cf24c7595e Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 16:28:17 -0700 Subject: address sider issues --- SCons/Tool/as.py | 7 ++++--- test/fixture/mygcc.py | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SCons/Tool/as.py b/SCons/Tool/as.py index 2c9f1a1..8ec0ce2 100644 --- a/SCons/Tool/as.py +++ b/SCons/Tool/as.py @@ -32,9 +32,10 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -#forward proxy to the preffered asm version -from SCons.Tool.asm import * +# +# forward proxy to the preffered asm version +# +from SCons.Tool.asm import generate, exists # Local Variables: diff --git a/test/fixture/mygcc.py b/test/fixture/mygcc.py index 02480ee..d701883 100644 --- a/test/fixture/mygcc.py +++ b/test/fixture/mygcc.py @@ -1,5 +1,4 @@ import getopt -import os import sys compiler = sys.argv[1] -- cgit v0.12 From 876f98d2d546a82fc1aba0d7b6421a1b06c4f0b7 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 16:30:51 -0700 Subject: fix typo --- SCons/Tool/as.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCons/Tool/as.py b/SCons/Tool/as.py index 8ec0ce2..03cea82 100644 --- a/SCons/Tool/as.py +++ b/SCons/Tool/as.py @@ -33,7 +33,7 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" # -# forward proxy to the preffered asm version +# forward proxy to the preferred asm version # from SCons.Tool.asm import generate, exists -- cgit v0.12 From 7d8ea4182d67e2a1e803f266bb92c4ab8c10d0e6 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 16:33:35 -0700 Subject: Don't use from..import, rather import and copy generate,exists to address sider complaint --- SCons/Tool/as.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SCons/Tool/as.py b/SCons/Tool/as.py index 03cea82..d21cc8e 100644 --- a/SCons/Tool/as.py +++ b/SCons/Tool/as.py @@ -35,7 +35,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" # # forward proxy to the preferred asm version # -from SCons.Tool.asm import generate, exists +import SCons.Tool.asm + +# Resolve FLAKE8 F401 (make sider happy) +generate = SCons.Tool.asm.generate +exists = SCons.Tool.asm.exists # Local Variables: -- cgit v0.12 From 6878db720dbcf12e50208917268a47326452735d Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 19 May 2020 20:26:42 -0700 Subject: More doc updates. Hide internal env variables. Fix broken test/import.py. Handle when not all of cc,cxx and as tools are configured --- SCons/Tool/compilation_db.py | 12 +++++--- SCons/Tool/compilation_db.xml | 65 ++++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index 4767d9e..6433d96 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -122,6 +122,7 @@ def compilation_db_entry_action(target, source, env, **kw): ) if env['COMPILATIONDB_USE_ABSPATH']: + print("ABSPATH") filename = env["__COMPILATIONDB_USOURCE"][0].abspath target_name = env['__COMPILATIONDB_UTARGET'][0].abspath else: @@ -202,10 +203,13 @@ def generate(env, **kwargs): builder, base_emitter, command = entry[1] # Assumes a dictionary emitter - emitter = builder.emitter[suffix] - builder.emitter[suffix] = SCons.Builder.ListEmitter( - [emitter, make_emit_compilation_DB_entry(command), ] - ) + emitter = builder.emitter.get(suffix, False) + if emitter: + # We may not have tools installed which initialize all or any of + # cxx, cc, or assembly. If not skip resetting the respective emitter. + builder.emitter[suffix] = SCons.Builder.ListEmitter( + [emitter, make_emit_compilation_DB_entry(command), ] + ) env["BUILDERS"]["__COMPILATIONDB_Entry"] = SCons.Builder.Builder( action=SCons.Action.Action(compilation_db_entry_action, None), diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index b9141b6..65b557b 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -78,38 +78,39 @@ See its __doc__ string for a discussion of the format. - - - - This variable stores the action for building a target. - It's intended for internal usage by &b-link-CompilationDatabase; only. - - - - - - - This variable stores the action for building a target. - It's intended for internal usage by &b-link-CompilationDatabase; only. - - - - - - - This variable stores the action for building a target. - It's intended for internal usage by &b-link-CompilationDatabase; only. - - - - - - - This variable stores the action for building a target. - It's intended for internal usage by &b-link-CompilationDatabase; only. - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v0.12 From 45df0d7e82d792f8f66bfe41d9123ea0b9c77f74 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 22 May 2020 11:19:40 -0700 Subject: resolve sider complaints in test fixtures --- test/fixture/mygcc.py | 6 +++--- test/fixture/mylink.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/fixture/mygcc.py b/test/fixture/mygcc.py index d701883..ceb10e5 100644 --- a/test/fixture/mygcc.py +++ b/test/fixture/mygcc.py @@ -12,7 +12,7 @@ for opt, arg in opts: f.write(compiler + "\n") with open(out, 'w') as ofp, open(args[0], 'r') as ifp: - for l in ifp.readlines(): - if l[:clen] != '#' + compiler: - ofp.write(l) + for line in ifp.readlines(): + if line[:clen] != '#' + compiler: + ofp.write(line) sys.exit(0) diff --git a/test/fixture/mylink.py b/test/fixture/mylink.py index 85646a4..fe4af58 100644 --- a/test/fixture/mylink.py +++ b/test/fixture/mylink.py @@ -9,7 +9,7 @@ for opt, arg in opts: with open(out, 'w') as ofp: for f in args: with open(f, 'r') as ifp: - for l in ifp.readlines(): - if l[:5] != '#link': - ofp.write(l) + for line in ifp.readlines(): + if line[:5] != '#link': + ofp.write(line) sys.exit(0) -- cgit v0.12 From 10b7f6beb261c41ac87e915cbd20e7f069f67c45 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 22 May 2020 11:27:34 -0700 Subject: [skip appveyor] [skip travis] resolve sider complaints in test fixtures --- test/fixture/mylink_win32.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fixture/mylink_win32.py b/test/fixture/mylink_win32.py index 438e920..477fc95 100644 --- a/test/fixture/mylink_win32.py +++ b/test/fixture/mylink_win32.py @@ -10,7 +10,7 @@ while args: out = a[5:] with open(out, 'w') as ofp, open(args[0], 'r') as ifp: - for l in ifp.readlines(): - if l[:5] != '#link': - ofp.write(l) + for line in ifp.readlines(): + if line[:5] != '#link': + ofp.write(line) sys.exit(0) -- cgit v0.12 From 4b4eadbcbb8a9017321b8a508ec6af6b9d22b9e7 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 22 May 2020 13:55:00 -0700 Subject: Remove debug output --- SCons/Tool/compilation_db.py | 1 - 1 file changed, 1 deletion(-) diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index 6433d96..0b7c9b8 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -122,7 +122,6 @@ def compilation_db_entry_action(target, source, env, **kw): ) if env['COMPILATIONDB_USE_ABSPATH']: - print("ABSPATH") filename = env["__COMPILATIONDB_USOURCE"][0].abspath target_name = env['__COMPILATIONDB_UTARGET'][0].abspath else: -- cgit v0.12 From a56a563e1a21b8dd02bd5fb8267cec92da525ea2 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 26 May 2020 18:54:30 -0700 Subject: add comment to indicate which sections are appendix --- doc/user/main.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/user/main.xml b/doc/user/main.xml index 85dcf00..34555af 100644 --- a/doc/user/main.xml +++ b/doc/user/main.xml @@ -159,6 +159,8 @@ + + -- cgit v0.12 From 8c28b830c282acd4338bc4c250f04854cce1dada Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 26 May 2020 18:54:57 -0700 Subject: add commented out XSLTFLAGS info which may enable creating PDF bookmarks --- doc/user/SConstruct | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/SConstruct b/doc/user/SConstruct index 4e96319..cfd85cf 100644 --- a/doc/user/SConstruct +++ b/doc/user/SConstruct @@ -29,6 +29,7 @@ import os env = Environment(ENV={'PATH' : os.environ['PATH']}, tools=['docbook','gs','zip'], toolpath=['../../SCons/Tool'], + # DOCBOOK_XSLTPROCFLAGS="--stringparam fop.extensions 1", DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_HTMLCHUNKED='chtml.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') -- cgit v0.12 From 897e738e626f528618ff3c2f97e67767d2644fdf Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 26 May 2020 18:55:24 -0700 Subject: [ci skip] Add initial section for Users Guide misc section for compilation database --- doc/user/misc.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/doc/user/misc.xml b/doc/user/misc.xml index b093629..f2531b6 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -675,4 +675,46 @@ env.Command('directory_build_info', +
+ Creating LLVM Compilation Database + + + + LLVM has defined a JSON Compilation Database Format. This file is in common use as input into LLVM tools and many IDE's and editors as well. + + + See JSON Compilation Database Format Specification¶ for complete information + + + + + Currently SCons supports two variations. One is to output source and target files with paths relative to the top of the SCons build, or to output those files with their absolute path. + + This is controlled by COMPILATIONDB_USE_ABSPATH=(True|False) + + Example of absolute paths for target and source + +[ + { + "command": "gcc -o test_main.o -c test_main.c", + "directory": "/home/user/sandbox", + "file": "/home/user/sandbox/test_main.c", + "target": "/home/user/sandbox/test_main.o" + } +] + + Example of relative paths for target and source + + +[ + { + "command": "gcc -o test_main.o -c test_main.c", + "directory": "/home/user/sandbox", + "file": "test_main.c", + "target": "test_main.o" + } +] + + +
-- cgit v0.12 From ef7265e6b2bc4f005a48fcc5c8f9e724f08d0ed6 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 29 May 2020 15:22:08 -0700 Subject: [ci skip] a little formatting change --- doc/user/misc.xml | 57 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/doc/user/misc.xml b/doc/user/misc.xml index f2531b6..e9b078d 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -675,25 +675,34 @@ env.Command('directory_build_info', -
- Creating LLVM Compilation Database - - - - LLVM has defined a JSON Compilation Database Format. This file is in common use as input into LLVM tools and many IDE's and editors as well. - - - See JSON Compilation Database Format Specification¶ for complete information - - - - - Currently SCons supports two variations. One is to output source and target files with paths relative to the top of the SCons build, or to output those files with their absolute path. - - This is controlled by COMPILATIONDB_USE_ABSPATH=(True|False) - - Example of absolute paths for target and source - +
+ Creating LLVM Compilation Database + + + + LLVM has defined a JSON Compilation Database Format. This file is in common use as input into LLVM tools + and many IDE's and editors as well. + + + See + + JSON Compilation Database Format Specification¶ + + for complete information + + + + + Currently SCons supports two variations. One is to output source and target files with paths relative to the + top + of the SCons build, or to output those files with their absolute path. + + This is controlled by + COMPILATIONDB_USE_ABSPATH=(True|False) + + + Example of absolute paths for target and source + [ { "command": "gcc -o test_main.o -c test_main.c", @@ -702,10 +711,10 @@ env.Command('directory_build_info', "target": "/home/user/sandbox/test_main.o" } ] - - Example of relative paths for target and source + + Example of relative paths for target and source - + [ { "command": "gcc -o test_main.o -c test_main.c", @@ -714,7 +723,7 @@ env.Command('directory_build_info', "target": "test_main.o" } ] - + -
+
-- cgit v0.12 From 71ea183f614037fab50a24432363e1833e2809e5 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 6 May 2020 08:29:03 -0600 Subject: [WIP] Add Sphinx build of API docs [ci skip] First cut includes a Makefile as generated by Sphinx plumbling, needs to be wired into sconscripts instead. A few regular scons files are updated to address build errors/warnings. Signed-off-by: Mats Wichmann --- doc/Makefile | 20 + doc/sphinx/SCons.Node.rst | 38 ++ doc/sphinx/SCons.Platform.rst | 102 ++++ doc/sphinx/SCons.Scanner.rst | 86 ++++ doc/sphinx/SCons.Script.rst | 46 ++ doc/sphinx/SCons.Tool.MSCommon.rst | 62 +++ doc/sphinx/SCons.Tool.clangCommon.rst | 10 + doc/sphinx/SCons.Tool.docbook.rst | 10 + doc/sphinx/SCons.Tool.packaging.rst | 102 ++++ doc/sphinx/SCons.Tool.rst | 904 ++++++++++++++++++++++++++++++++++ doc/sphinx/SCons.Variables.rst | 54 ++ doc/sphinx/SCons.compat.rst | 10 + doc/sphinx/SCons.rst | 211 ++++++++ doc/sphinx/conf.py | 189 +++++++ doc/sphinx/index.rst | 32 ++ 15 files changed, 1876 insertions(+) create mode 100644 doc/Makefile create mode 100644 doc/sphinx/SCons.Node.rst create mode 100644 doc/sphinx/SCons.Platform.rst create mode 100644 doc/sphinx/SCons.Scanner.rst create mode 100644 doc/sphinx/SCons.Script.rst create mode 100644 doc/sphinx/SCons.Tool.MSCommon.rst create mode 100644 doc/sphinx/SCons.Tool.clangCommon.rst create mode 100644 doc/sphinx/SCons.Tool.docbook.rst create mode 100644 doc/sphinx/SCons.Tool.packaging.rst create mode 100644 doc/sphinx/SCons.Tool.rst create mode 100644 doc/sphinx/SCons.Variables.rst create mode 100644 doc/sphinx/SCons.compat.rst create mode 100644 doc/sphinx/SCons.rst create mode 100644 doc/sphinx/conf.py create mode 100644 doc/sphinx/index.rst diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..4da19e3 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = SCons +SOURCEDIR = sphinx +BUILDDIR = ../build/doc/api + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/sphinx/SCons.Node.rst b/doc/sphinx/SCons.Node.rst new file mode 100644 index 0000000..b6d5c8f --- /dev/null +++ b/doc/sphinx/SCons.Node.rst @@ -0,0 +1,38 @@ +SCons.Node package +================== + +Submodules +---------- + +SCons.Node.Alias module +----------------------- + +.. automodule:: SCons.Node.Alias + :members: + :undoc-members: + :show-inheritance: + +SCons.Node.FS module +-------------------- + +.. automodule:: SCons.Node.FS + :members: + :undoc-members: + :show-inheritance: + +SCons.Node.Python module +------------------------ + +.. automodule:: SCons.Node.Python + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Node + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Platform.rst b/doc/sphinx/SCons.Platform.rst new file mode 100644 index 0000000..8a55744 --- /dev/null +++ b/doc/sphinx/SCons.Platform.rst @@ -0,0 +1,102 @@ +SCons.Platform package +====================== + +Submodules +---------- + +SCons.Platform.aix module +------------------------- + +.. automodule:: SCons.Platform.aix + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.cygwin module +---------------------------- + +.. automodule:: SCons.Platform.cygwin + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.darwin module +---------------------------- + +.. automodule:: SCons.Platform.darwin + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.hpux module +-------------------------- + +.. automodule:: SCons.Platform.hpux + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.irix module +-------------------------- + +.. automodule:: SCons.Platform.irix + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.mingw module +--------------------------- + +.. automodule:: SCons.Platform.mingw + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.os2 module +------------------------- + +.. automodule:: SCons.Platform.os2 + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.posix module +--------------------------- + +.. automodule:: SCons.Platform.posix + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.sunos module +--------------------------- + +.. automodule:: SCons.Platform.sunos + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.virtualenv module +-------------------------------- + +.. automodule:: SCons.Platform.virtualenv + :members: + :undoc-members: + :show-inheritance: + +SCons.Platform.win32 module +--------------------------- + +.. automodule:: SCons.Platform.win32 + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Platform + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Scanner.rst b/doc/sphinx/SCons.Scanner.rst new file mode 100644 index 0000000..181dbde --- /dev/null +++ b/doc/sphinx/SCons.Scanner.rst @@ -0,0 +1,86 @@ +SCons.Scanner package +===================== + +Submodules +---------- + +SCons.Scanner.C module +---------------------- + +.. automodule:: SCons.Scanner.C + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.D module +---------------------- + +.. automodule:: SCons.Scanner.D + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.Dir module +------------------------ + +.. automodule:: SCons.Scanner.Dir + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.Fortran module +---------------------------- + +.. automodule:: SCons.Scanner.Fortran + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.IDL module +------------------------ + +.. automodule:: SCons.Scanner.IDL + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.LaTeX module +-------------------------- + +.. automodule:: SCons.Scanner.LaTeX + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.Prog module +------------------------- + +.. automodule:: SCons.Scanner.Prog + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.RC module +----------------------- + +.. automodule:: SCons.Scanner.RC + :members: + :undoc-members: + :show-inheritance: + +SCons.Scanner.SWIG module +------------------------- + +.. automodule:: SCons.Scanner.SWIG + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Scanner + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Script.rst b/doc/sphinx/SCons.Script.rst new file mode 100644 index 0000000..704b8fa --- /dev/null +++ b/doc/sphinx/SCons.Script.rst @@ -0,0 +1,46 @@ +SCons.Script package +==================== + +Submodules +---------- + +SCons.Script.Interactive module +------------------------------- + +.. automodule:: SCons.Script.Interactive + :members: + :undoc-members: + :show-inheritance: + +SCons.Script.Main module +------------------------ + +.. automodule:: SCons.Script.Main + :members: + :undoc-members: + :show-inheritance: + +SCons.Script.SConsOptions module +-------------------------------- + +.. automodule:: SCons.Script.SConsOptions + :members: + :undoc-members: + :show-inheritance: + +SCons.Script.SConscript module +------------------------------ + +.. automodule:: SCons.Script.SConscript + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Script + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.MSCommon.rst b/doc/sphinx/SCons.Tool.MSCommon.rst new file mode 100644 index 0000000..a9271ae --- /dev/null +++ b/doc/sphinx/SCons.Tool.MSCommon.rst @@ -0,0 +1,62 @@ +SCons.Tool.MSCommon package +=========================== + +Submodules +---------- + +SCons.Tool.MSCommon.arch module +------------------------------- + +.. automodule:: SCons.Tool.MSCommon.arch + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.MSCommon.common module +--------------------------------- + +.. automodule:: SCons.Tool.MSCommon.common + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.MSCommon.netframework module +--------------------------------------- + +.. automodule:: SCons.Tool.MSCommon.netframework + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.MSCommon.sdk module +------------------------------ + +.. automodule:: SCons.Tool.MSCommon.sdk + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.MSCommon.vc module +----------------------------- + +.. automodule:: SCons.Tool.MSCommon.vc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.MSCommon.vs module +----------------------------- + +.. automodule:: SCons.Tool.MSCommon.vs + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Tool.MSCommon + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.clangCommon.rst b/doc/sphinx/SCons.Tool.clangCommon.rst new file mode 100644 index 0000000..33fce97 --- /dev/null +++ b/doc/sphinx/SCons.Tool.clangCommon.rst @@ -0,0 +1,10 @@ +SCons.Tool.clangCommon package +============================== + +Module contents +--------------- + +.. automodule:: SCons.Tool.clangCommon + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.docbook.rst b/doc/sphinx/SCons.Tool.docbook.rst new file mode 100644 index 0000000..3a9e0b6 --- /dev/null +++ b/doc/sphinx/SCons.Tool.docbook.rst @@ -0,0 +1,10 @@ +SCons.Tool.docbook package +========================== + +Module contents +--------------- + +.. automodule:: SCons.Tool.docbook + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.packaging.rst b/doc/sphinx/SCons.Tool.packaging.rst new file mode 100644 index 0000000..40b2fab --- /dev/null +++ b/doc/sphinx/SCons.Tool.packaging.rst @@ -0,0 +1,102 @@ +SCons.Tool.packaging package +============================ + +Submodules +---------- + +SCons.Tool.packaging.ipk module +------------------------------- + +.. automodule:: SCons.Tool.packaging.ipk + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.msi module +------------------------------- + +.. automodule:: SCons.Tool.packaging.msi + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.rpm module +------------------------------- + +.. automodule:: SCons.Tool.packaging.rpm + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.src\_tarbz2 module +--------------------------------------- + +.. automodule:: SCons.Tool.packaging.src_tarbz2 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.src\_targz module +-------------------------------------- + +.. automodule:: SCons.Tool.packaging.src_targz + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.src\_tarxz module +-------------------------------------- + +.. automodule:: SCons.Tool.packaging.src_tarxz + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.src\_zip module +------------------------------------ + +.. automodule:: SCons.Tool.packaging.src_zip + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.tarbz2 module +---------------------------------- + +.. automodule:: SCons.Tool.packaging.tarbz2 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.targz module +--------------------------------- + +.. automodule:: SCons.Tool.packaging.targz + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.tarxz module +--------------------------------- + +.. automodule:: SCons.Tool.packaging.tarxz + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.packaging.zip module +------------------------------- + +.. automodule:: SCons.Tool.packaging.zip + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Tool.packaging + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.rst b/doc/sphinx/SCons.Tool.rst new file mode 100644 index 0000000..cc5c721 --- /dev/null +++ b/doc/sphinx/SCons.Tool.rst @@ -0,0 +1,904 @@ +SCons.Tool package +================== + +Subpackages +----------- + +.. toctree:: + + SCons.Tool.MSCommon + SCons.Tool.clangCommon + SCons.Tool.docbook + SCons.Tool.packaging + +Submodules +---------- + +SCons.Tool.386asm module +------------------------ + +.. automodule:: SCons.Tool.386asm + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.DCommon module +------------------------- + +.. automodule:: SCons.Tool.DCommon + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.FortranCommon module +------------------------------- + +.. automodule:: SCons.Tool.FortranCommon + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.GettextCommon module +------------------------------- + +.. automodule:: SCons.Tool.GettextCommon + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.JavaCommon module +---------------------------- + +.. automodule:: SCons.Tool.JavaCommon + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.PharLapCommon module +------------------------------- + +.. automodule:: SCons.Tool.PharLapCommon + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.aixc\+\+ module +-------------------------- + +.. automodule:: SCons.Tool.aixc++ + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.aixcc module +----------------------- + +.. automodule:: SCons.Tool.aixcc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.aixcxx module +------------------------ + +.. automodule:: SCons.Tool.aixcxx + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.aixf77 module +------------------------ + +.. automodule:: SCons.Tool.aixf77 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.aixlink module +------------------------- + +.. automodule:: SCons.Tool.aixlink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.applelink module +--------------------------- + +.. automodule:: SCons.Tool.applelink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.ar module +-------------------- + +.. automodule:: SCons.Tool.ar + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.as module +-------------------- + +.. automodule:: SCons.Tool.as + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.bcc32 module +----------------------- + +.. automodule:: SCons.Tool.bcc32 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.c\+\+ module +----------------------- + +.. automodule:: SCons.Tool.c++ + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.cc module +-------------------- + +.. automodule:: SCons.Tool.cc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.clang module +----------------------- + +.. automodule:: SCons.Tool.clang + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.clangxx module +------------------------- + +.. automodule:: SCons.Tool.clangxx + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.cvf module +--------------------- + +.. automodule:: SCons.Tool.cvf + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.cxx module +--------------------- + +.. automodule:: SCons.Tool.cxx + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.cyglink module +------------------------- + +.. automodule:: SCons.Tool.cyglink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.default module +------------------------- + +.. automodule:: SCons.Tool.default + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.dmd module +--------------------- + +.. automodule:: SCons.Tool.dmd + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.dvi module +--------------------- + +.. automodule:: SCons.Tool.dvi + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.dvipdf module +------------------------ + +.. automodule:: SCons.Tool.dvipdf + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.dvips module +----------------------- + +.. automodule:: SCons.Tool.dvips + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.f03 module +--------------------- + +.. automodule:: SCons.Tool.f03 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.f08 module +--------------------- + +.. automodule:: SCons.Tool.f08 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.f77 module +--------------------- + +.. automodule:: SCons.Tool.f77 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.f90 module +--------------------- + +.. automodule:: SCons.Tool.f90 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.f95 module +--------------------- + +.. automodule:: SCons.Tool.f95 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.filesystem module +---------------------------- + +.. automodule:: SCons.Tool.filesystem + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.fortran module +------------------------- + +.. automodule:: SCons.Tool.fortran + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.g\+\+ module +----------------------- + +.. automodule:: SCons.Tool.g++ + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.g77 module +--------------------- + +.. automodule:: SCons.Tool.g77 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gas module +--------------------- + +.. automodule:: SCons.Tool.gas + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gcc module +--------------------- + +.. automodule:: SCons.Tool.gcc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gdc module +--------------------- + +.. automodule:: SCons.Tool.gdc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gettext\_tool module +------------------------------- + +.. automodule:: SCons.Tool.gettext_tool + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gfortran module +-------------------------- + +.. automodule:: SCons.Tool.gfortran + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gnulink module +------------------------- + +.. automodule:: SCons.Tool.gnulink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gs module +-------------------- + +.. automodule:: SCons.Tool.gs + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.gxx module +--------------------- + +.. automodule:: SCons.Tool.gxx + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.hpc\+\+ module +------------------------- + +.. automodule:: SCons.Tool.hpc++ + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.hpcc module +---------------------- + +.. automodule:: SCons.Tool.hpcc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.hpcxx module +----------------------- + +.. automodule:: SCons.Tool.hpcxx + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.hplink module +------------------------ + +.. automodule:: SCons.Tool.hplink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.icc module +--------------------- + +.. automodule:: SCons.Tool.icc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.icl module +--------------------- + +.. automodule:: SCons.Tool.icl + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.ifl module +--------------------- + +.. automodule:: SCons.Tool.ifl + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.ifort module +----------------------- + +.. automodule:: SCons.Tool.ifort + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.ilink module +----------------------- + +.. automodule:: SCons.Tool.ilink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.ilink32 module +------------------------- + +.. automodule:: SCons.Tool.ilink32 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.install module +------------------------- + +.. automodule:: SCons.Tool.install + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.intelc module +------------------------ + +.. automodule:: SCons.Tool.intelc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.ipkg module +---------------------- + +.. automodule:: SCons.Tool.ipkg + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.jar module +--------------------- + +.. automodule:: SCons.Tool.jar + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.javac module +----------------------- + +.. automodule:: SCons.Tool.javac + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.javah module +----------------------- + +.. automodule:: SCons.Tool.javah + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.latex module +----------------------- + +.. automodule:: SCons.Tool.latex + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.ldc module +--------------------- + +.. automodule:: SCons.Tool.ldc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.lex module +--------------------- + +.. automodule:: SCons.Tool.lex + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.link module +---------------------- + +.. automodule:: SCons.Tool.link + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.linkloc module +------------------------- + +.. automodule:: SCons.Tool.linkloc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.m4 module +-------------------- + +.. automodule:: SCons.Tool.m4 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.masm module +---------------------- + +.. automodule:: SCons.Tool.masm + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.midl module +---------------------- + +.. automodule:: SCons.Tool.midl + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.mingw module +----------------------- + +.. automodule:: SCons.Tool.mingw + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.msgfmt module +------------------------ + +.. automodule:: SCons.Tool.msgfmt + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.msginit module +------------------------- + +.. automodule:: SCons.Tool.msginit + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.msgmerge module +-------------------------- + +.. automodule:: SCons.Tool.msgmerge + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.mslib module +----------------------- + +.. automodule:: SCons.Tool.mslib + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.mslink module +------------------------ + +.. automodule:: SCons.Tool.mslink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.mssdk module +----------------------- + +.. automodule:: SCons.Tool.mssdk + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.msvc module +---------------------- + +.. automodule:: SCons.Tool.msvc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.msvs module +---------------------- + +.. automodule:: SCons.Tool.msvs + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.mwcc module +---------------------- + +.. automodule:: SCons.Tool.mwcc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.mwld module +---------------------- + +.. automodule:: SCons.Tool.mwld + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.nasm module +---------------------- + +.. automodule:: SCons.Tool.nasm + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.pdf module +--------------------- + +.. automodule:: SCons.Tool.pdf + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.pdflatex module +-------------------------- + +.. automodule:: SCons.Tool.pdflatex + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.pdftex module +------------------------ + +.. automodule:: SCons.Tool.pdftex + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.qt module +-------------------- + +.. automodule:: SCons.Tool.qt + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.rmic module +---------------------- + +.. automodule:: SCons.Tool.rmic + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.rpcgen module +------------------------ + +.. automodule:: SCons.Tool.rpcgen + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.rpm module +--------------------- + +.. automodule:: SCons.Tool.rpm + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.rpmutils module +-------------------------- + +.. automodule:: SCons.Tool.rpmutils + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sgiar module +----------------------- + +.. automodule:: SCons.Tool.sgiar + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sgic\+\+ module +-------------------------- + +.. automodule:: SCons.Tool.sgic++ + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sgicc module +----------------------- + +.. automodule:: SCons.Tool.sgicc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sgicxx module +------------------------ + +.. automodule:: SCons.Tool.sgicxx + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sgilink module +------------------------- + +.. automodule:: SCons.Tool.sgilink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sunar module +----------------------- + +.. automodule:: SCons.Tool.sunar + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sunc\+\+ module +-------------------------- + +.. automodule:: SCons.Tool.sunc++ + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.suncc module +----------------------- + +.. automodule:: SCons.Tool.suncc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.suncxx module +------------------------ + +.. automodule:: SCons.Tool.suncxx + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sunf77 module +------------------------ + +.. automodule:: SCons.Tool.sunf77 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sunf90 module +------------------------ + +.. automodule:: SCons.Tool.sunf90 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sunf95 module +------------------------ + +.. automodule:: SCons.Tool.sunf95 + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.sunlink module +------------------------- + +.. automodule:: SCons.Tool.sunlink + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.swig module +---------------------- + +.. automodule:: SCons.Tool.swig + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.tar module +--------------------- + +.. automodule:: SCons.Tool.tar + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.tex module +--------------------- + +.. automodule:: SCons.Tool.tex + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.textfile module +-------------------------- + +.. automodule:: SCons.Tool.textfile + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.tlib module +---------------------- + +.. automodule:: SCons.Tool.tlib + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.wix module +--------------------- + +.. automodule:: SCons.Tool.wix + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.xgettext module +-------------------------- + +.. automodule:: SCons.Tool.xgettext + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.yacc module +---------------------- + +.. automodule:: SCons.Tool.yacc + :members: + :undoc-members: + :show-inheritance: + +SCons.Tool.zip module +--------------------- + +.. automodule:: SCons.Tool.zip + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Tool + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.Variables.rst b/doc/sphinx/SCons.Variables.rst new file mode 100644 index 0000000..dc2388a --- /dev/null +++ b/doc/sphinx/SCons.Variables.rst @@ -0,0 +1,54 @@ +SCons.Variables package +======================= + +Submodules +---------- + +SCons.Variables.BoolVariable module +----------------------------------- + +.. automodule:: SCons.Variables.BoolVariable + :members: + :undoc-members: + :show-inheritance: + +SCons.Variables.EnumVariable module +----------------------------------- + +.. automodule:: SCons.Variables.EnumVariable + :members: + :undoc-members: + :show-inheritance: + +SCons.Variables.ListVariable module +----------------------------------- + +.. automodule:: SCons.Variables.ListVariable + :members: + :undoc-members: + :show-inheritance: + +SCons.Variables.PackageVariable module +-------------------------------------- + +.. automodule:: SCons.Variables.PackageVariable + :members: + :undoc-members: + :show-inheritance: + +SCons.Variables.PathVariable module +----------------------------------- + +.. automodule:: SCons.Variables.PathVariable + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons.Variables + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.compat.rst b/doc/sphinx/SCons.compat.rst new file mode 100644 index 0000000..d80b555 --- /dev/null +++ b/doc/sphinx/SCons.compat.rst @@ -0,0 +1,10 @@ +SCons.compat package +==================== + +Module contents +--------------- + +.. automodule:: SCons.compat + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/SCons.rst b/doc/sphinx/SCons.rst new file mode 100644 index 0000000..817011b --- /dev/null +++ b/doc/sphinx/SCons.rst @@ -0,0 +1,211 @@ +SCons package +============= + +Subpackages +----------- + +.. toctree:: + + SCons.Node + SCons.Platform + SCons.Scanner + SCons.Script + SCons.Tool + SCons.Variables + SCons.compat + +Submodules +---------- + +SCons.Action module +------------------- + +.. automodule:: SCons.Action + :members: + :undoc-members: + :show-inheritance: + +SCons.Builder module +-------------------- + +.. automodule:: SCons.Builder + :members: + :undoc-members: + :show-inheritance: + +SCons.CacheDir module +--------------------- + +.. automodule:: SCons.CacheDir + :members: + :undoc-members: + :show-inheritance: + +SCons.Conftest module +--------------------- + +.. automodule:: SCons.Conftest + :members: + :undoc-members: + :show-inheritance: + +SCons.Debug module +------------------ + +.. automodule:: SCons.Debug + :members: + :undoc-members: + :show-inheritance: + +SCons.Defaults module +--------------------- + +.. automodule:: SCons.Defaults + :members: + :undoc-members: + :show-inheritance: + +SCons.Environment module +------------------------ + +.. automodule:: SCons.Environment + :members: + :undoc-members: + :show-inheritance: + +SCons.EnvironmentValues module +------------------------------ + +.. automodule:: SCons.EnvironmentValues + :members: + :undoc-members: + :show-inheritance: + +SCons.EnvironmentValuesTest module +---------------------------------- + +.. automodule:: SCons.EnvironmentValuesTest + :members: + :undoc-members: + :show-inheritance: + +SCons.Errors module +------------------- + +.. automodule:: SCons.Errors + :members: + :undoc-members: + :show-inheritance: + +SCons.Executor module +--------------------- + +.. automodule:: SCons.Executor + :members: + :undoc-members: + :show-inheritance: + +SCons.Job module +---------------- + +.. automodule:: SCons.Job + :members: + :undoc-members: + :show-inheritance: + +SCons.Memoize module +-------------------- + +.. automodule:: SCons.Memoize + :members: + :undoc-members: + :show-inheritance: + +SCons.PathList module +--------------------- + +.. automodule:: SCons.PathList + :members: + :undoc-members: + :show-inheritance: + +SCons.SConf module +------------------ + +.. automodule:: SCons.SConf + :members: + :undoc-members: + :show-inheritance: + +SCons.SConsign module +--------------------- + +.. automodule:: SCons.SConsign + :members: + :undoc-members: + :show-inheritance: + +SCons.Subst module +------------------ + +.. automodule:: SCons.Subst + :members: + :undoc-members: + :show-inheritance: + +SCons.Taskmaster module +----------------------- + +.. automodule:: SCons.Taskmaster + :members: + :undoc-members: + :show-inheritance: + +SCons.Util module +----------------- + +.. automodule:: SCons.Util + :members: + :undoc-members: + :show-inheritance: + +SCons.Warnings module +--------------------- + +.. automodule:: SCons.Warnings + :members: + :undoc-members: + :show-inheritance: + +SCons.cpp module +---------------- + +.. automodule:: SCons.cpp + :members: + :undoc-members: + :show-inheritance: + +SCons.dblite module +------------------- + +.. automodule:: SCons.dblite + :members: + :undoc-members: + :show-inheritance: + +SCons.exitfuncs module +---------------------- + +.. automodule:: SCons.exitfuncs + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: SCons + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py new file mode 100644 index 0000000..7761910 --- /dev/null +++ b/doc/sphinx/conf.py @@ -0,0 +1,189 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# SCons documentation build configuration file, created by +# sphinx-quickstart on Mon Apr 30 09:36:53 2018. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +sys.path.insert(0, os.path.abspath('../../src/engine/')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +needs_sphinx = '1.3' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + 'sphinx.ext.napoleon', + 'sphinx.ext.todo', + 'sphinx.ext.viewcode', + 'sphinx.ext.githubpages' +] + +autodoc_default_flags = [":members:", ":undoc-members:", ":show-inheritance:"] +autodoc_exclude_members = ['*Tests'] +napoleon_include_special_with_doc = False +napoleon_include_private_with_doc = False + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'SCons API' +copyright = '2020, SCons Project' +author = 'SCons Project' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '4.0' +# The full version, including alpha/beta/rc tags. +release = '4.0.0a1' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = ["*Tests.py"] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +#html_theme = 'alabaster' +html_theme = 'classic' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'SConsAPIDocs' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + master_doc, + "SConsAPIDocs.tex", + "SCons API Documentation", + "SCons Project", + "manual", + ) +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'sconsapidocs', 'SCons API Documentation', [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + master_doc, + "SConsAPIDocs", + "SCons API Documentation", + author, + "SConsAPIDocs", + "One line description of project.", + "Miscellaneous", + ) +] + + +# -- Options for Epub output ------------------------------------------------- + diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst new file mode 100644 index 0000000..996d258 --- /dev/null +++ b/doc/sphinx/index.rst @@ -0,0 +1,32 @@ +.. SCons documentation master file, created by + sphinx-quickstart on Mon Apr 30 09:36:53 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +SCons Project API Documentation +=============================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + SCons + SCons.compat + SCons.Node + SCons.Platform + SCons.Scanner + SCons.Script + SCons.Tool + SCons.Tool.clangCommon + SCons.Tool.docbook + SCons.Tool.MSCommon + SCons.Tool.packaging. + SCons.Variables + + +Indices and Tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` -- cgit v0.12 From 3494131597b69a355474b348a4b890668e9f30be Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 6 May 2020 09:06:54 -0600 Subject: Commit the files changed for Sphinx docbuild [ci skip] Signed-off-by: Mats Wichmann --- SCons/Environment.py | 6 +++--- SCons/Errors.py | 7 ++----- SCons/Platform/__init__.py | 13 ++++++++----- SCons/Script/SConsOptions.py | 4 +++- SCons/Tool/dmd.py | 35 +++++++++++++++++++++++------------ SCons/Tool/intelc.py | 14 +++++++------- SCons/Tool/packaging/rpm.py | 22 ++++++++++++---------- SCons/Util.py | 27 ++++++++++++++++----------- SCons/cpp.py | 3 +-- doc/sphinx/index.rst | 2 +- 10 files changed, 76 insertions(+), 57 deletions(-) diff --git a/SCons/Environment.py b/SCons/Environment.py index cd52ee5..7d4db39 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -1502,11 +1502,11 @@ class Base(SubstitutionEnvironment): def Dictionary(self, *args): """Return construction variables from an environment. - :param *args: (optional) variable names to look up + :param args: (optional) variable names to look up :returns: if args omitted, the dictionary of all constr. vars. If one arg, the corresponding value is returned. If more than one arg, a list of values is returned. - :raises KeyError: if any of *args is not in the construction env. + :raises KeyError: if any of args is not in the construction env. """ if not args: @@ -2017,7 +2017,7 @@ class Base(SubstitutionEnvironment): pass else: del kw['target_factory'] - + bld = SCons.Builder.Builder(**bkw) return bld(self, target, source, **kw) diff --git a/SCons/Errors.py b/SCons/Errors.py index a3a891f..882ae82 100644 --- a/SCons/Errors.py +++ b/SCons/Errors.py @@ -35,13 +35,11 @@ import SCons.Util class BuildError(Exception): - """ Errors occurring while building. + """SCons Errors that can occur while building. - BuildError have the following attributes: - ========================================= + BuildError has the following attributes: Information about the cause of the build error: - ----------------------------------------------- errstr : a description of the error message @@ -71,7 +69,6 @@ class BuildError(Exception): Information about the cause of the location of the error: - --------------------------------------------------------- node : the error occured while building this target node(s) diff --git a/SCons/Platform/__init__.py b/SCons/Platform/__init__.py index 12db824..b6a7b97 100644 --- a/SCons/Platform/__init__.py +++ b/SCons/Platform/__init__.py @@ -58,8 +58,8 @@ import SCons.Tool def platform_default(): """Return the platform string for our execution environment. - The returned value should map to one of the SCons/Platform/*.py - files. Since we're architecture independent, though, we don't + The returned value should map to one of the SCons/Platform/\*.py + files. Since scons is architecture independent, though, we don't care about the machine architecture. """ osname = os.name @@ -136,20 +136,23 @@ class TempFileMunge: file substitution on it. This is used to circumvent the long command line limitation. - Example usage: + Example: + env["TEMPFILE"] = TempFileMunge env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}" By default, the name of the temporary file used begins with a prefix of '@'. This may be configured for other tool chains by - setting '$TEMPFILEPREFIX': + setting '$TEMPFILEPREFIX'. Example: + env["TEMPFILEPREFIX"] = '-@' # diab compiler env["TEMPFILEPREFIX"] = '-via' # arm tool chain env["TEMPFILEPREFIX"] = '' # (the empty string) PC Lint You can configure the extension of the temporary file through the TEMPFILESUFFIX variable, which defaults to '.lnk' (see comments - in the code below): + in the code below). Example: + env["TEMPFILESUFFIX"] = '.lnt' # PC Lint """ def __init__(self, cmd, cmdstr = None): diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py index 10600b6..5d61e32 100644 --- a/SCons/Script/SConsOptions.py +++ b/SCons/Script/SConsOptions.py @@ -345,7 +345,8 @@ class SConsOptionParser(optparse.OptionParser): Else, this would lead to problems in add_local_option() below. When called from there, we try to reparse the - command-line arguments that + command-line arguments that: + 1. haven't been processed so far (self.largs), but 2. are possibly not added to the list of options yet. @@ -355,6 +356,7 @@ class SConsOptionParser(optparse.OptionParser): _match_long_opt(), which allows for partial matches of the option name, as long as the common prefix appears to be unique. + This would lead to further confusion, because we might want to add another option "--myarg" later on (see issue #2929). diff --git a/SCons/Tool/dmd.py b/SCons/Tool/dmd.py index 3cc4ed0..32b9c02 100644 --- a/SCons/Tool/dmd.py +++ b/SCons/Tool/dmd.py @@ -10,22 +10,33 @@ Evolved by Russel Winder (russel@winder.org.uk) 2010-02-07 onwards Compiler variables: - DC - The name of the D compiler to use. Defaults to dmd or gdmd, - whichever is found. - DPATH - List of paths to search for import modules. - DVERSIONS - List of version tags to enable when compiling. - DDEBUG - List of debug tags to enable when compiling. + + DC + The name of the D compiler to use. Defaults to dmd or gdmd, whichever is found. + DPATH + List of paths to search for import modules. + DVERSIONS + List of version tags to enable when compiling. + DDEBUG + List of debug tags to enable when compiling. Linker related variables: - LIBS - List of library files to link in. - DLINK - Name of the linker to use. Defaults to dmd or gdmd, - whichever is found. - DLINKFLAGS - List of linker flags. + + LIBS + List of library files to link in. + DLINK + Name of the linker to use. Defaults to dmd or gdmd, whichever is found. + DLINKFLAGS + List of linker flags. Lib tool variables: - DLIB - Name of the lib tool to use. Defaults to lib. - DLIBFLAGS - List of flags to pass to the lib tool. - LIBS - Same as for the linker. (libraries to pull into the .lib) + + DLIB + Name of the lib tool to use. Defaults to lib. + DLIBFLAGS + List of flags to pass to the lib tool. + LIBS + Same as for the linker. (libraries to pull into the .lib) """ # diff --git a/SCons/Tool/intelc.py b/SCons/Tool/intelc.py index 0880976..2242e60 100644 --- a/SCons/Tool/intelc.py +++ b/SCons/Tool/intelc.py @@ -387,13 +387,13 @@ def get_intel_compiler_top(version, abi): def generate(env, version=None, abi=None, topdir=None, verbose=0): r"""Add Builders and construction variables for Intel C/C++ compiler to an Environment. - args: - version: (string) compiler version to use, like "80" - abi: (string) 'win32' or whatever Itanium version wants - topdir: (string) compiler top dir, like - "c:\Program Files\Intel\Compiler70" - If topdir is used, version and abi are ignored. - verbose: (int) if >0, prints compiler version used. + + :param string version: compiler version to use, like "80" + :param string abi: 'win32' or whatever Itanium version wants + :param string topdir: directory containing compiler tree, e.g. + "c:\\Program Files\\Intel\\Compiler70". + If `topdir` is used, `version` and `abi` are ignored. + :param int verbose: if >0, prints compiler version used. """ if not (is_mac or is_linux or is_windows): # can't handle this platform diff --git a/SCons/Tool/packaging/rpm.py b/SCons/Tool/packaging/rpm.py index 0e44bf9..9e2bbb0 100644 --- a/SCons/Tool/packaging/rpm.py +++ b/SCons/Tool/packaging/rpm.py @@ -302,21 +302,23 @@ def build_specfile_filesection(spec, files): return str class SimpleTagCompiler: - """ This class is a simple string substition utility: - the replacement specfication is stored in the tagset dictionary, something - like: - { "abc" : "cdef %s ", - "abc_" : "cdef %s %s" } + """ Compile RPM tags by doing simple string substitution. - the compile function gets a value dictionary, which may look like: - { "abc" : "ghij", - "abc_gh" : "ij" } + The replacement specfication is stored in the *tagset* dictionary, + something like: + + {"abc" : "cdef %s ", "abc_": "cdef %s %s"} + + The :func:`compile` function gets a value dictionary, which may look like: + + {"abc": "ghij", "abc_gh": "ij"} The resulting string will be: - "cdef ghij cdef gh ij" + + "cdef ghij cdef gh ij" """ def __init__(self, tagset, mandatory=1): - self.tagset = tagset + self.tagset = tagset self.mandatory = mandatory def compile(self, values): diff --git a/SCons/Util.py b/SCons/Util.py index 1ec0cf8..effe4c4 100644 --- a/SCons/Util.py +++ b/SCons/Util.py @@ -1611,16 +1611,18 @@ def cmp(a, b): def get_env_bool(env, name, default=False): - """Get a value of env[name] converted to boolean. The value of env[name] is - interpreted as follows: 'true', 'yes', 'y', 'on' (case insensitive) and - anything convertible to int that yields non-zero integer are True values; - '0', 'false', 'no', 'n' and 'off' (case insensitive) are False values. For - all other cases, default value is returned. - - :Parameters: - - `env` - dict or dict-like object, a convainer with variables - - `name` - name of the variable in env to be returned - - `default` - returned when env[name] does not exist or can't be converted to bool + """Convert a construction variable to bool. + + If the value of *name* in *env* is 'true', 'yes', 'y', 'on' (case + insensitive) or anything convertible to int that yields non-zero then + return True; if 'false', 'no', 'n', 'off' (case insensitive) + or a number that converts to integer zero return False. + Otherwise, return *default*. + + :param env: construction environment, or any dict-like object + :param name: name of the variable + :param default: value to return if name not in env or cannot be converted (default: False) + :rtype: bool """ try: var = env[name] @@ -1638,7 +1640,10 @@ def get_env_bool(env, name, default=False): def get_os_env_bool(name, default=False): - """Same as get_env_bool(os.environ, name, default).""" + """Convert an environment variable to bool. + + Conversion is the same as for :func:`get_env_bool`. + """ return get_env_bool(os.environ, name, default) # Local Variables: diff --git a/SCons/cpp.py b/SCons/cpp.py index 1113be5..0811c71 100644 --- a/SCons/cpp.py +++ b/SCons/cpp.py @@ -603,8 +603,7 @@ class PreProcessor: This handles recursive expansion of values without "" or <> surrounding the name until an initial " or < is found, to handle - #include FILE - where FILE is a #define somewhere else. + #include FILE where FILE is a #define somewhere else. """ s = t[1].strip() while not s[0] in '<"': diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index 996d258..3c3ee0e 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -20,7 +20,7 @@ SCons Project API Documentation SCons.Tool.clangCommon SCons.Tool.docbook SCons.Tool.MSCommon - SCons.Tool.packaging. + SCons.Tool.packaging SCons.Variables -- cgit v0.12 From 19bc1520f0fe52662c9fc49a68652730f4544448 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 24 May 2020 08:30:34 -0600 Subject: Update sphinx build, add autoclasstoc [ci skip] autoclasstoc enabled, but not particularly used yet. Signed-off-by: Mats Wichmann --- bin/scons_dev_master.py | 20 +- doc/sphinx/SCons.Tool.MSCommon.rst | 62 --- doc/sphinx/SCons.Tool.clangCommon.rst | 10 - doc/sphinx/SCons.Tool.docbook.rst | 10 - doc/sphinx/SCons.Tool.packaging.rst | 102 ---- doc/sphinx/SCons.Tool.rst | 894 ---------------------------------- doc/sphinx/SCons.rst | 17 +- doc/sphinx/conf.py | 19 +- doc/sphinx/index.rst | 4 - 9 files changed, 32 insertions(+), 1106 deletions(-) delete mode 100644 doc/sphinx/SCons.Tool.MSCommon.rst delete mode 100644 doc/sphinx/SCons.Tool.clangCommon.rst delete mode 100644 doc/sphinx/SCons.Tool.docbook.rst delete mode 100644 doc/sphinx/SCons.Tool.packaging.rst diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py index 5ed7d49..26beb62 100755 --- a/bin/scons_dev_master.py +++ b/bin/scons_dev_master.py @@ -33,14 +33,12 @@ PYTHON_PACKAGES = [ ] BUILDING_PACKAGES = [ - 'python-libxml2', - 'python-libxslt1', + 'python3-lxml', 'fop', - 'python-dev', - 'python-epydoc', + 'python3-dev', 'rpm', 'tar', - 'lynx' + 'lynx', # additional packages that Bill Deegan's web page suggests #'docbook-to-man', @@ -51,15 +49,17 @@ BUILDING_PACKAGES = [ # for ubuntu 9.10 # 'texlive-lang-french' + 'python3-sphinx', + 'sphinx-rtd-theme-common', ] DOCUMENTATION_PACKAGES = [ 'docbook-doc', - 'epydoc-doc', + 'sphinx-doc', 'gcc-doc', 'pkg-config', - 'python-doc', + 'python3-doc', 'openjdk-8-doc', 'swig-doc', 'texlive-doc', @@ -79,10 +79,10 @@ TESTING_PACKAGES = [ 'm4', 'openssh-client', 'openssh-server', - 'python-profiler', - 'python-all-dev', + 'python3-profiler', + 'python3-line-profiler', 'python3-all-dev', - 'pypy-dev', + 'pypy3-dev', 'rcs', 'rpm', 'openjdk-8-jdk', diff --git a/doc/sphinx/SCons.Tool.MSCommon.rst b/doc/sphinx/SCons.Tool.MSCommon.rst deleted file mode 100644 index a9271ae..0000000 --- a/doc/sphinx/SCons.Tool.MSCommon.rst +++ /dev/null @@ -1,62 +0,0 @@ -SCons.Tool.MSCommon package -=========================== - -Submodules ----------- - -SCons.Tool.MSCommon.arch module -------------------------------- - -.. automodule:: SCons.Tool.MSCommon.arch - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.MSCommon.common module ---------------------------------- - -.. automodule:: SCons.Tool.MSCommon.common - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.MSCommon.netframework module ---------------------------------------- - -.. automodule:: SCons.Tool.MSCommon.netframework - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.MSCommon.sdk module ------------------------------- - -.. automodule:: SCons.Tool.MSCommon.sdk - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.MSCommon.vc module ------------------------------ - -.. automodule:: SCons.Tool.MSCommon.vc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.MSCommon.vs module ------------------------------ - -.. automodule:: SCons.Tool.MSCommon.vs - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: SCons.Tool.MSCommon - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.clangCommon.rst b/doc/sphinx/SCons.Tool.clangCommon.rst deleted file mode 100644 index 33fce97..0000000 --- a/doc/sphinx/SCons.Tool.clangCommon.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCons.Tool.clangCommon package -============================== - -Module contents ---------------- - -.. automodule:: SCons.Tool.clangCommon - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.docbook.rst b/doc/sphinx/SCons.Tool.docbook.rst deleted file mode 100644 index 3a9e0b6..0000000 --- a/doc/sphinx/SCons.Tool.docbook.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCons.Tool.docbook package -========================== - -Module contents ---------------- - -.. automodule:: SCons.Tool.docbook - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.packaging.rst b/doc/sphinx/SCons.Tool.packaging.rst deleted file mode 100644 index 40b2fab..0000000 --- a/doc/sphinx/SCons.Tool.packaging.rst +++ /dev/null @@ -1,102 +0,0 @@ -SCons.Tool.packaging package -============================ - -Submodules ----------- - -SCons.Tool.packaging.ipk module -------------------------------- - -.. automodule:: SCons.Tool.packaging.ipk - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.msi module -------------------------------- - -.. automodule:: SCons.Tool.packaging.msi - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.rpm module -------------------------------- - -.. automodule:: SCons.Tool.packaging.rpm - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.src\_tarbz2 module ---------------------------------------- - -.. automodule:: SCons.Tool.packaging.src_tarbz2 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.src\_targz module --------------------------------------- - -.. automodule:: SCons.Tool.packaging.src_targz - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.src\_tarxz module --------------------------------------- - -.. automodule:: SCons.Tool.packaging.src_tarxz - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.src\_zip module ------------------------------------- - -.. automodule:: SCons.Tool.packaging.src_zip - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.tarbz2 module ----------------------------------- - -.. automodule:: SCons.Tool.packaging.tarbz2 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.targz module ---------------------------------- - -.. automodule:: SCons.Tool.packaging.targz - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.tarxz module ---------------------------------- - -.. automodule:: SCons.Tool.packaging.tarxz - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.packaging.zip module -------------------------------- - -.. automodule:: SCons.Tool.packaging.zip - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: SCons.Tool.packaging - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/sphinx/SCons.Tool.rst b/doc/sphinx/SCons.Tool.rst index cc5c721..151e6fa 100644 --- a/doc/sphinx/SCons.Tool.rst +++ b/doc/sphinx/SCons.Tool.rst @@ -1,900 +1,6 @@ SCons.Tool package ================== -Subpackages ------------ - -.. toctree:: - - SCons.Tool.MSCommon - SCons.Tool.clangCommon - SCons.Tool.docbook - SCons.Tool.packaging - -Submodules ----------- - -SCons.Tool.386asm module ------------------------- - -.. automodule:: SCons.Tool.386asm - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.DCommon module -------------------------- - -.. automodule:: SCons.Tool.DCommon - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.FortranCommon module -------------------------------- - -.. automodule:: SCons.Tool.FortranCommon - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.GettextCommon module -------------------------------- - -.. automodule:: SCons.Tool.GettextCommon - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.JavaCommon module ----------------------------- - -.. automodule:: SCons.Tool.JavaCommon - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.PharLapCommon module -------------------------------- - -.. automodule:: SCons.Tool.PharLapCommon - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.aixc\+\+ module --------------------------- - -.. automodule:: SCons.Tool.aixc++ - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.aixcc module ------------------------ - -.. automodule:: SCons.Tool.aixcc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.aixcxx module ------------------------- - -.. automodule:: SCons.Tool.aixcxx - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.aixf77 module ------------------------- - -.. automodule:: SCons.Tool.aixf77 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.aixlink module -------------------------- - -.. automodule:: SCons.Tool.aixlink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.applelink module ---------------------------- - -.. automodule:: SCons.Tool.applelink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.ar module --------------------- - -.. automodule:: SCons.Tool.ar - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.as module --------------------- - -.. automodule:: SCons.Tool.as - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.bcc32 module ------------------------ - -.. automodule:: SCons.Tool.bcc32 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.c\+\+ module ------------------------ - -.. automodule:: SCons.Tool.c++ - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.cc module --------------------- - -.. automodule:: SCons.Tool.cc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.clang module ------------------------ - -.. automodule:: SCons.Tool.clang - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.clangxx module -------------------------- - -.. automodule:: SCons.Tool.clangxx - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.cvf module ---------------------- - -.. automodule:: SCons.Tool.cvf - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.cxx module ---------------------- - -.. automodule:: SCons.Tool.cxx - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.cyglink module -------------------------- - -.. automodule:: SCons.Tool.cyglink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.default module -------------------------- - -.. automodule:: SCons.Tool.default - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.dmd module ---------------------- - -.. automodule:: SCons.Tool.dmd - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.dvi module ---------------------- - -.. automodule:: SCons.Tool.dvi - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.dvipdf module ------------------------- - -.. automodule:: SCons.Tool.dvipdf - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.dvips module ------------------------ - -.. automodule:: SCons.Tool.dvips - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.f03 module ---------------------- - -.. automodule:: SCons.Tool.f03 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.f08 module ---------------------- - -.. automodule:: SCons.Tool.f08 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.f77 module ---------------------- - -.. automodule:: SCons.Tool.f77 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.f90 module ---------------------- - -.. automodule:: SCons.Tool.f90 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.f95 module ---------------------- - -.. automodule:: SCons.Tool.f95 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.filesystem module ----------------------------- - -.. automodule:: SCons.Tool.filesystem - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.fortran module -------------------------- - -.. automodule:: SCons.Tool.fortran - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.g\+\+ module ------------------------ - -.. automodule:: SCons.Tool.g++ - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.g77 module ---------------------- - -.. automodule:: SCons.Tool.g77 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gas module ---------------------- - -.. automodule:: SCons.Tool.gas - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gcc module ---------------------- - -.. automodule:: SCons.Tool.gcc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gdc module ---------------------- - -.. automodule:: SCons.Tool.gdc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gettext\_tool module -------------------------------- - -.. automodule:: SCons.Tool.gettext_tool - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gfortran module --------------------------- - -.. automodule:: SCons.Tool.gfortran - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gnulink module -------------------------- - -.. automodule:: SCons.Tool.gnulink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gs module --------------------- - -.. automodule:: SCons.Tool.gs - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.gxx module ---------------------- - -.. automodule:: SCons.Tool.gxx - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.hpc\+\+ module -------------------------- - -.. automodule:: SCons.Tool.hpc++ - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.hpcc module ----------------------- - -.. automodule:: SCons.Tool.hpcc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.hpcxx module ------------------------ - -.. automodule:: SCons.Tool.hpcxx - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.hplink module ------------------------- - -.. automodule:: SCons.Tool.hplink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.icc module ---------------------- - -.. automodule:: SCons.Tool.icc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.icl module ---------------------- - -.. automodule:: SCons.Tool.icl - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.ifl module ---------------------- - -.. automodule:: SCons.Tool.ifl - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.ifort module ------------------------ - -.. automodule:: SCons.Tool.ifort - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.ilink module ------------------------ - -.. automodule:: SCons.Tool.ilink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.ilink32 module -------------------------- - -.. automodule:: SCons.Tool.ilink32 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.install module -------------------------- - -.. automodule:: SCons.Tool.install - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.intelc module ------------------------- - -.. automodule:: SCons.Tool.intelc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.ipkg module ----------------------- - -.. automodule:: SCons.Tool.ipkg - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.jar module ---------------------- - -.. automodule:: SCons.Tool.jar - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.javac module ------------------------ - -.. automodule:: SCons.Tool.javac - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.javah module ------------------------ - -.. automodule:: SCons.Tool.javah - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.latex module ------------------------ - -.. automodule:: SCons.Tool.latex - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.ldc module ---------------------- - -.. automodule:: SCons.Tool.ldc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.lex module ---------------------- - -.. automodule:: SCons.Tool.lex - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.link module ----------------------- - -.. automodule:: SCons.Tool.link - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.linkloc module -------------------------- - -.. automodule:: SCons.Tool.linkloc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.m4 module --------------------- - -.. automodule:: SCons.Tool.m4 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.masm module ----------------------- - -.. automodule:: SCons.Tool.masm - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.midl module ----------------------- - -.. automodule:: SCons.Tool.midl - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.mingw module ------------------------ - -.. automodule:: SCons.Tool.mingw - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.msgfmt module ------------------------- - -.. automodule:: SCons.Tool.msgfmt - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.msginit module -------------------------- - -.. automodule:: SCons.Tool.msginit - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.msgmerge module --------------------------- - -.. automodule:: SCons.Tool.msgmerge - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.mslib module ------------------------ - -.. automodule:: SCons.Tool.mslib - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.mslink module ------------------------- - -.. automodule:: SCons.Tool.mslink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.mssdk module ------------------------ - -.. automodule:: SCons.Tool.mssdk - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.msvc module ----------------------- - -.. automodule:: SCons.Tool.msvc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.msvs module ----------------------- - -.. automodule:: SCons.Tool.msvs - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.mwcc module ----------------------- - -.. automodule:: SCons.Tool.mwcc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.mwld module ----------------------- - -.. automodule:: SCons.Tool.mwld - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.nasm module ----------------------- - -.. automodule:: SCons.Tool.nasm - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.pdf module ---------------------- - -.. automodule:: SCons.Tool.pdf - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.pdflatex module --------------------------- - -.. automodule:: SCons.Tool.pdflatex - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.pdftex module ------------------------- - -.. automodule:: SCons.Tool.pdftex - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.qt module --------------------- - -.. automodule:: SCons.Tool.qt - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.rmic module ----------------------- - -.. automodule:: SCons.Tool.rmic - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.rpcgen module ------------------------- - -.. automodule:: SCons.Tool.rpcgen - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.rpm module ---------------------- - -.. automodule:: SCons.Tool.rpm - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.rpmutils module --------------------------- - -.. automodule:: SCons.Tool.rpmutils - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sgiar module ------------------------ - -.. automodule:: SCons.Tool.sgiar - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sgic\+\+ module --------------------------- - -.. automodule:: SCons.Tool.sgic++ - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sgicc module ------------------------ - -.. automodule:: SCons.Tool.sgicc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sgicxx module ------------------------- - -.. automodule:: SCons.Tool.sgicxx - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sgilink module -------------------------- - -.. automodule:: SCons.Tool.sgilink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sunar module ------------------------ - -.. automodule:: SCons.Tool.sunar - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sunc\+\+ module --------------------------- - -.. automodule:: SCons.Tool.sunc++ - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.suncc module ------------------------ - -.. automodule:: SCons.Tool.suncc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.suncxx module ------------------------- - -.. automodule:: SCons.Tool.suncxx - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sunf77 module ------------------------- - -.. automodule:: SCons.Tool.sunf77 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sunf90 module ------------------------- - -.. automodule:: SCons.Tool.sunf90 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sunf95 module ------------------------- - -.. automodule:: SCons.Tool.sunf95 - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.sunlink module -------------------------- - -.. automodule:: SCons.Tool.sunlink - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.swig module ----------------------- - -.. automodule:: SCons.Tool.swig - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.tar module ---------------------- - -.. automodule:: SCons.Tool.tar - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.tex module ---------------------- - -.. automodule:: SCons.Tool.tex - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.textfile module --------------------------- - -.. automodule:: SCons.Tool.textfile - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.tlib module ----------------------- - -.. automodule:: SCons.Tool.tlib - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.wix module ---------------------- - -.. automodule:: SCons.Tool.wix - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.xgettext module --------------------------- - -.. automodule:: SCons.Tool.xgettext - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.yacc module ----------------------- - -.. automodule:: SCons.Tool.yacc - :members: - :undoc-members: - :show-inheritance: - -SCons.Tool.zip module ---------------------- - -.. automodule:: SCons.Tool.zip - :members: - :undoc-members: - :show-inheritance: - - Module contents --------------- diff --git a/doc/sphinx/SCons.rst b/doc/sphinx/SCons.rst index 817011b..c92b957 100644 --- a/doc/sphinx/SCons.rst +++ b/doc/sphinx/SCons.rst @@ -1,6 +1,14 @@ SCons package ============= +Module contents +--------------- + +.. automodule:: SCons + :members: + :undoc-members: + :show-inheritance: + Subpackages ----------- @@ -200,12 +208,3 @@ SCons.exitfuncs module :members: :undoc-members: :show-inheritance: - - -Module contents ---------------- - -.. automodule:: SCons - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 7761910..474f765 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -31,18 +31,27 @@ needs_sphinx = '1.3' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'autoclasstoc', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', + #'sphinx.ext.githubpages' 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext.viewcode', - 'sphinx.ext.githubpages' ] autodoc_default_flags = [":members:", ":undoc-members:", ":show-inheritance:"] +autodoc_default_options = { + "members": True, + "special-members": True, + "private-members": True, + "inherited-members": True, + "undoc-members": True, + "exclude-members": '__weakref__', +} autodoc_exclude_members = ['*Tests'] -napoleon_include_special_with_doc = False -napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_include_private_with_doc = True # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -56,9 +65,9 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = 'SCons API' +project = 'SCons' copyright = '2020, SCons Project' -author = 'SCons Project' +author = 'SCons Project Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index 3c3ee0e..eec3750 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -17,10 +17,6 @@ SCons Project API Documentation SCons.Scanner SCons.Script SCons.Tool - SCons.Tool.clangCommon - SCons.Tool.docbook - SCons.Tool.MSCommon - SCons.Tool.packaging SCons.Variables -- cgit v0.12 From ff57c327cd155d5e1c734b81ee954663ab2c5a20 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 27 May 2020 08:11:43 -0600 Subject: A bit more sphinx docbuild tweaking [ci skip] Signed-off-by: Mats Wichmann --- SCons/Environment.py | 2 +- SCons/Platform/__init__.py | 17 +++++++++-------- SCons/Script/SConsOptions.py | 4 ++-- SCons/dblite.py | 1 + doc/sphinx/SCons.rst | 16 ---------------- doc/sphinx/conf.py | 3 ++- 6 files changed, 15 insertions(+), 28 deletions(-) diff --git a/SCons/Environment.py b/SCons/Environment.py index 7d4db39..28906ea 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -1500,7 +1500,7 @@ class Base(SubstitutionEnvironment): def Dictionary(self, *args): - """Return construction variables from an environment. + r"""Return construction variables from an environment. :param args: (optional) variable names to look up :returns: if args omitted, the dictionary of all constr. vars. diff --git a/SCons/Platform/__init__.py b/SCons/Platform/__init__.py index b6a7b97..20048ee 100644 --- a/SCons/Platform/__init__.py +++ b/SCons/Platform/__init__.py @@ -56,9 +56,9 @@ import SCons.Tool def platform_default(): - """Return the platform string for our execution environment. + r"""Return the platform string for our execution environment. - The returned value should map to one of the SCons/Platform/\*.py + The returned value should map to one of the SCons/Platform/*.py files. Since scons is architecture independent, though, we don't care about the machine architecture. """ @@ -131,19 +131,19 @@ class PlatformSpec: class TempFileMunge: - """A callable class. You can set an Environment variable to this, + """A callable class to enable temp files for long command lines. + + You can set an Environment variable to this, then call it with a string argument, then it will perform temporary file substitution on it. This is used to circumvent the long command - line limitation. - - Example: + line limitation. Example:: env["TEMPFILE"] = TempFileMunge env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}" By default, the name of the temporary file used begins with a prefix of '@'. This may be configured for other tool chains by - setting '$TEMPFILEPREFIX'. Example: + setting '$TEMPFILEPREFIX'. Example:: env["TEMPFILEPREFIX"] = '-@' # diab compiler env["TEMPFILEPREFIX"] = '-via' # arm tool chain @@ -151,9 +151,10 @@ class TempFileMunge: You can configure the extension of the temporary file through the TEMPFILESUFFIX variable, which defaults to '.lnk' (see comments - in the code below). Example: + in the code below). Example:: env["TEMPFILESUFFIX"] = '.lnt' # PC Lint + """ def __init__(self, cmd, cmdstr = None): self.cmd = cmd diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py index 5d61e32..9d5fb47 100644 --- a/SCons/Script/SConsOptions.py +++ b/SCons/Script/SConsOptions.py @@ -347,8 +347,8 @@ class SConsOptionParser(optparse.OptionParser): below. When called from there, we try to reparse the command-line arguments that: - 1. haven't been processed so far (self.largs), but - 2. are possibly not added to the list of options yet. + 1. haven't been processed so far (self.largs), but + 2. are possibly not added to the list of options yet. So, when we only have a value for "--myargument" yet, a command-line argument of "--myarg=test" would set it. diff --git a/SCons/dblite.py b/SCons/dblite.py index b9269f1..338dcc7 100644 --- a/SCons/dblite.py +++ b/SCons/dblite.py @@ -37,6 +37,7 @@ class dblite: See the discussion at: http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html + """ _open = open diff --git a/doc/sphinx/SCons.rst b/doc/sphinx/SCons.rst index c92b957..b9959e3 100644 --- a/doc/sphinx/SCons.rst +++ b/doc/sphinx/SCons.rst @@ -81,22 +81,6 @@ SCons.Environment module :undoc-members: :show-inheritance: -SCons.EnvironmentValues module ------------------------------- - -.. automodule:: SCons.EnvironmentValues - :members: - :undoc-members: - :show-inheritance: - -SCons.EnvironmentValuesTest module ----------------------------------- - -.. automodule:: SCons.EnvironmentValuesTest - :members: - :undoc-members: - :show-inheritance: - SCons.Errors module ------------------- diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 474f765..bfd7057 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -40,7 +40,8 @@ extensions = [ 'sphinx.ext.viewcode', ] -autodoc_default_flags = [":members:", ":undoc-members:", ":show-inheritance:"] +autosummary_generate = True + autodoc_default_options = { "members": True, "special-members": True, -- cgit v0.12 From 7ea666723c18c7fbd13fe282697591a0a2fd26d2 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 27 May 2020 12:10:44 -0600 Subject: More sphinx build tweaks [ci skip] Signed-off-by: Mats Wichmann --- SCons/Environment.py | 39 ++++++++++++++++++++++++--------------- SCons/Script/SConsOptions.py | 2 +- SCons/Variables/__init__.py | 43 +++++++++++++++++++++++++------------------ doc/sphinx/conf.py | 2 +- 4 files changed, 51 insertions(+), 35 deletions(-) diff --git a/SCons/Environment.py b/SCons/Environment.py index 28906ea..188631e 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -1500,13 +1500,18 @@ class Base(SubstitutionEnvironment): def Dictionary(self, *args): - r"""Return construction variables from an environment. + """Return construction variables from an environment. - :param args: (optional) variable names to look up - :returns: if args omitted, the dictionary of all constr. vars. - If one arg, the corresponding value is returned. - If more than one arg, a list of values is returned. - :raises KeyError: if any of args is not in the construction env. + Args: + args: (optional) variable names to look up + + Returns: + if args omitted, the dictionary of all consvars. + If one arg, the corresponding value is returned. + If more than one arg, a list of values is returned. + + Raises: + KeyError: if any of args is not in the construction env. """ if not args: @@ -1520,12 +1525,13 @@ class Base(SubstitutionEnvironment): def Dump(self, key=None, format='pretty'): """ Serialize the construction variables to a string. - :param key: if None, format the whole dict of variables. - Else look up and format just the value for key. - - :param format: specify the format of the variables to be serialized: + Args: + key: if None, format the whole dict of variables. + Else format just the value for key (Default value = None) + format: specify the format of the variables to be serialized: - pretty: pretty-printed string. - json: JSON-formatted string. + (Default value = None) """ if key: @@ -1556,12 +1562,15 @@ class Base(SubstitutionEnvironment): def FindIxes(self, paths, prefix, suffix): - """ - Search a list of paths for something that matches the prefix and suffix. + """Search a list of paths for something that matches the prefix and suffix. + + Args: + paths: the list of paths or nodes. + prefix: construction variable for the prefix. + suffix: construction variable for the suffix. + + Returns: the matched path or None - paths - the list of paths or nodes. - prefix - construction variable for the prefix. - suffix - construction variable for the suffix. """ suffix = self.subst('$'+suffix) diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py index 9d5fb47..ffd3c4a 100644 --- a/SCons/Script/SConsOptions.py +++ b/SCons/Script/SConsOptions.py @@ -345,7 +345,7 @@ class SConsOptionParser(optparse.OptionParser): Else, this would lead to problems in add_local_option() below. When called from there, we try to reparse the - command-line arguments that: + command-line arguments that 1. haven't been processed so far (self.largs), but 2. are possibly not added to the list of options yet. diff --git a/SCons/Variables/__init__.py b/SCons/Variables/__init__.py index 59b63eb..832ee58 100644 --- a/SCons/Variables/__init__.py +++ b/SCons/Variables/__init__.py @@ -49,16 +49,22 @@ class Variables: Holds all the options, updates the environment with the variables, and renders the help text. """ - instance=None + instance = None - def __init__(self, files=None, args=None, is_global=1): - """ - files - [optional] List of option configuration files to load - (backward compatibility) If a single string is passed it is - automatically placed in a file list - args - dictionary to override values set from files. - """ + def __init__(self, files=None, args=None, is_global=True): + """Create Variables instance. + + If is_global is True, this is a singleton, create only once. + + Args: + files: [optional] List of option configuration files to load + (backward compatibility). If a single string is passed it is + automatically placed in a file list (Default value = None) + args - dictionary to override values set from files. + (Default value = None) + is_global - global instance? (Default value = True) + """ if args is None: args = {} self.options = [] @@ -112,18 +118,19 @@ class Variables: return [o.key for o in self.options] def Add(self, key, help="", default=None, validator=None, converter=None, **kw): - """ - Add an option. + """Add an option. + + Args: + key: the name of the variable, or a list or tuple of arguments + help: optional help text for the options (Default value = "") + default: optional default value for option (Default value = None) + validator: optional function called to validate the option's value + (Default value = None) + converter: optional function to be called to convert the option's + value before putting it in the environment. (Default value = None) + kw: keyword args, unused. - - @param key: the name of the variable, or a list or tuple of arguments - @param help: optional help text for the options - @param default: optional default value - @param validator: optional function that is called to validate the option's value - @type validator: Called with (key, value, environment) - @param converter: optional function that is called to convert the option's value before putting it in the environment. """ - if SCons.Util.is_List(key) or isinstance(key, tuple): self._do_add(*key) return diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index bfd7057..141d089 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -19,7 +19,7 @@ # import os import sys -sys.path.insert(0, os.path.abspath('../../src/engine/')) +sys.path.insert(0, os.path.abspath('../../')) # -- General configuration ------------------------------------------------ -- cgit v0.12 From be613a49ef4e12b5b71b6ba1238e6762f29878cd Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 28 May 2020 08:49:38 -0600 Subject: sphinx build: drop special members [ci skip] Opinion time - when special members are included in the docs, the output isn't really readable, it's too cluttered. Don't seem to be able to get the autoclasstoc stuff working, which was supposed to help with that. Signed-off-by: Mats Wichmann --- SCons/Environment.py | 2 +- doc/sphinx/conf.py | 4 ++-- doc/sphinx/index.rst | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/SCons/Environment.py b/SCons/Environment.py index 188631e..c30a661 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -1527,7 +1527,7 @@ class Base(SubstitutionEnvironment): Args: key: if None, format the whole dict of variables. - Else format just the value for key (Default value = None) + Else format just the value for key (Default value = None) format: specify the format of the variables to be serialized: - pretty: pretty-printed string. - json: JSON-formatted string. diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 141d089..21a982f 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -44,14 +44,14 @@ autosummary_generate = True autodoc_default_options = { "members": True, - "special-members": True, + #"special-members": True, "private-members": True, "inherited-members": True, "undoc-members": True, "exclude-members": '__weakref__', } autodoc_exclude_members = ['*Tests'] -napoleon_include_special_with_doc = True +napoleon_include_special_with_doc = False napoleon_include_private_with_doc = True # Add any paths that contain templates here, relative to this directory. diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index eec3750..6828154 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -6,6 +6,15 @@ SCons Project API Documentation =============================== +This is the internal API Documentation for SCons. +The Documentation is generated using the Sphinx tool. +The target audience is developers working on SCons itself, +so it does not clearly delineate what is "Public API" - +interfaces for use in your SCons configuration scripts +which have a consistency guarantee, and what is internal, +so always keep the SCons manual page around for helping +with such determinations. + .. toctree:: :maxdepth: 2 :caption: Contents: -- cgit v0.12 From 261f1d187b92adfbe262e0fad394743c8c0f80be Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 30 May 2020 08:13:35 -0600 Subject: sphinx build: move docstring changes to own PR [ci skip] Split this patchset so it contains only the Sphinx-build configuration itself, and not any docstring changes suggested by running Sphinx. Signed-off-by: Mats Wichmann --- SCons/Environment.py | 39 +++++++++++++++------------------------ SCons/Errors.py | 7 +++++-- SCons/Platform/__init__.py | 18 +++++++----------- SCons/Script/SConsOptions.py | 6 ++---- SCons/Tool/dmd.py | 35 ++++++++++++----------------------- SCons/Tool/intelc.py | 14 +++++++------- SCons/Tool/packaging/rpm.py | 22 ++++++++++------------ SCons/Util.py | 27 +++++++++++---------------- SCons/Variables/__init__.py | 43 ++++++++++++++++++------------------------- SCons/cpp.py | 3 ++- SCons/dblite.py | 1 - 11 files changed, 89 insertions(+), 126 deletions(-) diff --git a/SCons/Environment.py b/SCons/Environment.py index c30a661..cd52ee5 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -1502,16 +1502,11 @@ class Base(SubstitutionEnvironment): def Dictionary(self, *args): """Return construction variables from an environment. - Args: - args: (optional) variable names to look up - - Returns: - if args omitted, the dictionary of all consvars. - If one arg, the corresponding value is returned. - If more than one arg, a list of values is returned. - - Raises: - KeyError: if any of args is not in the construction env. + :param *args: (optional) variable names to look up + :returns: if args omitted, the dictionary of all constr. vars. + If one arg, the corresponding value is returned. + If more than one arg, a list of values is returned. + :raises KeyError: if any of *args is not in the construction env. """ if not args: @@ -1525,13 +1520,12 @@ class Base(SubstitutionEnvironment): def Dump(self, key=None, format='pretty'): """ Serialize the construction variables to a string. - Args: - key: if None, format the whole dict of variables. - Else format just the value for key (Default value = None) - format: specify the format of the variables to be serialized: + :param key: if None, format the whole dict of variables. + Else look up and format just the value for key. + + :param format: specify the format of the variables to be serialized: - pretty: pretty-printed string. - json: JSON-formatted string. - (Default value = None) """ if key: @@ -1562,15 +1556,12 @@ class Base(SubstitutionEnvironment): def FindIxes(self, paths, prefix, suffix): - """Search a list of paths for something that matches the prefix and suffix. - - Args: - paths: the list of paths or nodes. - prefix: construction variable for the prefix. - suffix: construction variable for the suffix. - - Returns: the matched path or None + """ + Search a list of paths for something that matches the prefix and suffix. + paths - the list of paths or nodes. + prefix - construction variable for the prefix. + suffix - construction variable for the suffix. """ suffix = self.subst('$'+suffix) @@ -2026,7 +2017,7 @@ class Base(SubstitutionEnvironment): pass else: del kw['target_factory'] - + bld = SCons.Builder.Builder(**bkw) return bld(self, target, source, **kw) diff --git a/SCons/Errors.py b/SCons/Errors.py index 882ae82..a3a891f 100644 --- a/SCons/Errors.py +++ b/SCons/Errors.py @@ -35,11 +35,13 @@ import SCons.Util class BuildError(Exception): - """SCons Errors that can occur while building. + """ Errors occurring while building. - BuildError has the following attributes: + BuildError have the following attributes: + ========================================= Information about the cause of the build error: + ----------------------------------------------- errstr : a description of the error message @@ -69,6 +71,7 @@ class BuildError(Exception): Information about the cause of the location of the error: + --------------------------------------------------------- node : the error occured while building this target node(s) diff --git a/SCons/Platform/__init__.py b/SCons/Platform/__init__.py index 20048ee..12db824 100644 --- a/SCons/Platform/__init__.py +++ b/SCons/Platform/__init__.py @@ -56,10 +56,10 @@ import SCons.Tool def platform_default(): - r"""Return the platform string for our execution environment. + """Return the platform string for our execution environment. The returned value should map to one of the SCons/Platform/*.py - files. Since scons is architecture independent, though, we don't + files. Since we're architecture independent, though, we don't care about the machine architecture. """ osname = os.name @@ -131,30 +131,26 @@ class PlatformSpec: class TempFileMunge: - """A callable class to enable temp files for long command lines. - - You can set an Environment variable to this, + """A callable class. You can set an Environment variable to this, then call it with a string argument, then it will perform temporary file substitution on it. This is used to circumvent the long command - line limitation. Example:: + line limitation. + Example usage: env["TEMPFILE"] = TempFileMunge env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}" By default, the name of the temporary file used begins with a prefix of '@'. This may be configured for other tool chains by - setting '$TEMPFILEPREFIX'. Example:: - + setting '$TEMPFILEPREFIX': env["TEMPFILEPREFIX"] = '-@' # diab compiler env["TEMPFILEPREFIX"] = '-via' # arm tool chain env["TEMPFILEPREFIX"] = '' # (the empty string) PC Lint You can configure the extension of the temporary file through the TEMPFILESUFFIX variable, which defaults to '.lnk' (see comments - in the code below). Example:: - + in the code below): env["TEMPFILESUFFIX"] = '.lnt' # PC Lint - """ def __init__(self, cmd, cmdstr = None): self.cmd = cmd diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py index ffd3c4a..10600b6 100644 --- a/SCons/Script/SConsOptions.py +++ b/SCons/Script/SConsOptions.py @@ -346,9 +346,8 @@ class SConsOptionParser(optparse.OptionParser): Else, this would lead to problems in add_local_option() below. When called from there, we try to reparse the command-line arguments that - - 1. haven't been processed so far (self.largs), but - 2. are possibly not added to the list of options yet. + 1. haven't been processed so far (self.largs), but + 2. are possibly not added to the list of options yet. So, when we only have a value for "--myargument" yet, a command-line argument of "--myarg=test" would set it. @@ -356,7 +355,6 @@ class SConsOptionParser(optparse.OptionParser): _match_long_opt(), which allows for partial matches of the option name, as long as the common prefix appears to be unique. - This would lead to further confusion, because we might want to add another option "--myarg" later on (see issue #2929). diff --git a/SCons/Tool/dmd.py b/SCons/Tool/dmd.py index 32b9c02..3cc4ed0 100644 --- a/SCons/Tool/dmd.py +++ b/SCons/Tool/dmd.py @@ -10,33 +10,22 @@ Evolved by Russel Winder (russel@winder.org.uk) 2010-02-07 onwards Compiler variables: - - DC - The name of the D compiler to use. Defaults to dmd or gdmd, whichever is found. - DPATH - List of paths to search for import modules. - DVERSIONS - List of version tags to enable when compiling. - DDEBUG - List of debug tags to enable when compiling. + DC - The name of the D compiler to use. Defaults to dmd or gdmd, + whichever is found. + DPATH - List of paths to search for import modules. + DVERSIONS - List of version tags to enable when compiling. + DDEBUG - List of debug tags to enable when compiling. Linker related variables: - - LIBS - List of library files to link in. - DLINK - Name of the linker to use. Defaults to dmd or gdmd, whichever is found. - DLINKFLAGS - List of linker flags. + LIBS - List of library files to link in. + DLINK - Name of the linker to use. Defaults to dmd or gdmd, + whichever is found. + DLINKFLAGS - List of linker flags. Lib tool variables: - - DLIB - Name of the lib tool to use. Defaults to lib. - DLIBFLAGS - List of flags to pass to the lib tool. - LIBS - Same as for the linker. (libraries to pull into the .lib) + DLIB - Name of the lib tool to use. Defaults to lib. + DLIBFLAGS - List of flags to pass to the lib tool. + LIBS - Same as for the linker. (libraries to pull into the .lib) """ # diff --git a/SCons/Tool/intelc.py b/SCons/Tool/intelc.py index 2242e60..0880976 100644 --- a/SCons/Tool/intelc.py +++ b/SCons/Tool/intelc.py @@ -387,13 +387,13 @@ def get_intel_compiler_top(version, abi): def generate(env, version=None, abi=None, topdir=None, verbose=0): r"""Add Builders and construction variables for Intel C/C++ compiler to an Environment. - - :param string version: compiler version to use, like "80" - :param string abi: 'win32' or whatever Itanium version wants - :param string topdir: directory containing compiler tree, e.g. - "c:\\Program Files\\Intel\\Compiler70". - If `topdir` is used, `version` and `abi` are ignored. - :param int verbose: if >0, prints compiler version used. + args: + version: (string) compiler version to use, like "80" + abi: (string) 'win32' or whatever Itanium version wants + topdir: (string) compiler top dir, like + "c:\Program Files\Intel\Compiler70" + If topdir is used, version and abi are ignored. + verbose: (int) if >0, prints compiler version used. """ if not (is_mac or is_linux or is_windows): # can't handle this platform diff --git a/SCons/Tool/packaging/rpm.py b/SCons/Tool/packaging/rpm.py index 9e2bbb0..0e44bf9 100644 --- a/SCons/Tool/packaging/rpm.py +++ b/SCons/Tool/packaging/rpm.py @@ -302,23 +302,21 @@ def build_specfile_filesection(spec, files): return str class SimpleTagCompiler: - """ Compile RPM tags by doing simple string substitution. + """ This class is a simple string substition utility: + the replacement specfication is stored in the tagset dictionary, something + like: + { "abc" : "cdef %s ", + "abc_" : "cdef %s %s" } - The replacement specfication is stored in the *tagset* dictionary, - something like: - - {"abc" : "cdef %s ", "abc_": "cdef %s %s"} - - The :func:`compile` function gets a value dictionary, which may look like: - - {"abc": "ghij", "abc_gh": "ij"} + the compile function gets a value dictionary, which may look like: + { "abc" : "ghij", + "abc_gh" : "ij" } The resulting string will be: - - "cdef ghij cdef gh ij" + "cdef ghij cdef gh ij" """ def __init__(self, tagset, mandatory=1): - self.tagset = tagset + self.tagset = tagset self.mandatory = mandatory def compile(self, values): diff --git a/SCons/Util.py b/SCons/Util.py index effe4c4..1ec0cf8 100644 --- a/SCons/Util.py +++ b/SCons/Util.py @@ -1611,18 +1611,16 @@ def cmp(a, b): def get_env_bool(env, name, default=False): - """Convert a construction variable to bool. - - If the value of *name* in *env* is 'true', 'yes', 'y', 'on' (case - insensitive) or anything convertible to int that yields non-zero then - return True; if 'false', 'no', 'n', 'off' (case insensitive) - or a number that converts to integer zero return False. - Otherwise, return *default*. - - :param env: construction environment, or any dict-like object - :param name: name of the variable - :param default: value to return if name not in env or cannot be converted (default: False) - :rtype: bool + """Get a value of env[name] converted to boolean. The value of env[name] is + interpreted as follows: 'true', 'yes', 'y', 'on' (case insensitive) and + anything convertible to int that yields non-zero integer are True values; + '0', 'false', 'no', 'n' and 'off' (case insensitive) are False values. For + all other cases, default value is returned. + + :Parameters: + - `env` - dict or dict-like object, a convainer with variables + - `name` - name of the variable in env to be returned + - `default` - returned when env[name] does not exist or can't be converted to bool """ try: var = env[name] @@ -1640,10 +1638,7 @@ def get_env_bool(env, name, default=False): def get_os_env_bool(name, default=False): - """Convert an environment variable to bool. - - Conversion is the same as for :func:`get_env_bool`. - """ + """Same as get_env_bool(os.environ, name, default).""" return get_env_bool(os.environ, name, default) # Local Variables: diff --git a/SCons/Variables/__init__.py b/SCons/Variables/__init__.py index 832ee58..59b63eb 100644 --- a/SCons/Variables/__init__.py +++ b/SCons/Variables/__init__.py @@ -49,22 +49,16 @@ class Variables: Holds all the options, updates the environment with the variables, and renders the help text. """ - instance = None - - def __init__(self, files=None, args=None, is_global=True): - """Create Variables instance. - - If is_global is True, this is a singleton, create only once. - - Args: - files: [optional] List of option configuration files to load - (backward compatibility). If a single string is passed it is - automatically placed in a file list (Default value = None) - args - dictionary to override values set from files. - (Default value = None) - is_global - global instance? (Default value = True) + instance=None + def __init__(self, files=None, args=None, is_global=1): + """ + files - [optional] List of option configuration files to load + (backward compatibility) If a single string is passed it is + automatically placed in a file list + args - dictionary to override values set from files. """ + if args is None: args = {} self.options = [] @@ -118,19 +112,18 @@ class Variables: return [o.key for o in self.options] def Add(self, key, help="", default=None, validator=None, converter=None, **kw): - """Add an option. - - Args: - key: the name of the variable, or a list or tuple of arguments - help: optional help text for the options (Default value = "") - default: optional default value for option (Default value = None) - validator: optional function called to validate the option's value - (Default value = None) - converter: optional function to be called to convert the option's - value before putting it in the environment. (Default value = None) - kw: keyword args, unused. + """ + Add an option. + + @param key: the name of the variable, or a list or tuple of arguments + @param help: optional help text for the options + @param default: optional default value + @param validator: optional function that is called to validate the option's value + @type validator: Called with (key, value, environment) + @param converter: optional function that is called to convert the option's value before putting it in the environment. """ + if SCons.Util.is_List(key) or isinstance(key, tuple): self._do_add(*key) return diff --git a/SCons/cpp.py b/SCons/cpp.py index 0811c71..1113be5 100644 --- a/SCons/cpp.py +++ b/SCons/cpp.py @@ -603,7 +603,8 @@ class PreProcessor: This handles recursive expansion of values without "" or <> surrounding the name until an initial " or < is found, to handle - #include FILE where FILE is a #define somewhere else. + #include FILE + where FILE is a #define somewhere else. """ s = t[1].strip() while not s[0] in '<"': diff --git a/SCons/dblite.py b/SCons/dblite.py index 338dcc7..b9269f1 100644 --- a/SCons/dblite.py +++ b/SCons/dblite.py @@ -37,7 +37,6 @@ class dblite: See the discussion at: http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html - """ _open = open -- cgit v0.12 From d53f6129f48e1c0ed755e4aedda0085a528a1426 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 6 Jun 2020 11:28:41 -0700 Subject: change CompilationDatabase from psuedo builder to builder. Add emitter to clear source and set default target as 'compile_commands.json'. --- CHANGES.txt | 1 + SCons/Tool/compilation_db.py | 21 +++++++++++++-------- SCons/Tool/compilation_db.xml | 8 +++++--- doc/user/misc.xml | 15 +++++++++++++++ test/CompilationDatabase/fixture/SConstruct | 4 ++-- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 414825d..b04615f 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -56,6 +56,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Renamed as.py to asm.py and left redirecting tool. 'as' is a reserved word and so changing the name was required as we wanted to import symbols for use in compilation_db tool. + - Add CompilationDatabase() builder in compilation_db tool. Contributed by MongoDB. From Jeremy Elson: - Updated design doc to use the correct syntax for Depends() diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index 0b7c9b8..788f454 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -154,13 +154,18 @@ def scan_compilation_db(node, env, path): return __COMPILATION_DB_ENTRIES -def CompilationDatabase(env, target='compile_commands.json'): - result = env.__COMPILATIONDB_Database(target=target, source=[]) +def compilation_db_emitter(target, source, env): + """ fix up the source/targets """ - env.AlwaysBuild(result) - env.NoCache(result) + # Default target name is compilation_db.json + if not target: + target = ['compile_commands.json', ] - return result + # No source should have been passed. Drop it. + if source: + source = [] + + return target, source def generate(env, **kwargs): @@ -214,17 +219,17 @@ def generate(env, **kwargs): action=SCons.Action.Action(compilation_db_entry_action, None), ) - env["BUILDERS"]["__COMPILATIONDB_Database"] = SCons.Builder.Builder( + env["BUILDERS"]["CompilationDatabase"] = SCons.Builder.Builder( action=SCons.Action.Action(write_compilation_db, "$COMPILATIONDB_COMSTR"), target_scanner=SCons.Scanner.Scanner( function=scan_compilation_db, node_class=None ), + emitter=compilation_db_emitter, + suffix='json', ) env['COMPILATIONDB_USE_ABSPATH'] = False - env.AddMethod(CompilationDatabase, "CompilationDatabase") - def exists(env): return True diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index 65b557b..12a4db0 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -26,12 +26,14 @@ See its __doc__ string for a discussion of the format. - Sets up &b-CompilationDatabase; Pseudo builder. + Sets up &b-CompilationDatabase; builder. This builder generates a clang tooling compatible compilation database. - Note: If there's no specified target file, it will default to - compile_commands.json + + + Note: The target file is typically named + compile_commands.json. diff --git a/doc/user/misc.xml b/doc/user/misc.xml index e9b078d..8aa7d62 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -699,9 +699,17 @@ env.Command('directory_build_info', This is controlled by COMPILATIONDB_USE_ABSPATH=(True|False) + which defaults to False. Example of absolute paths for target and source + + +env = Environment(COMPILATIONDB_USE_ABSPATH=True) +env.Tool('compilation_db') +env.CompilationDatabase('compile_commands.json') + + [ { @@ -712,8 +720,15 @@ env.Command('directory_build_info', } ] + + Example of relative paths for target and source + +env = Environment() +env.Tool('compilation_db') +env.CompilationDatabase('compile_commands.json') + [ { diff --git a/test/CompilationDatabase/fixture/SConstruct b/test/CompilationDatabase/fixture/SConstruct index 0f8944e..0bbcafa 100644 --- a/test/CompilationDatabase/fixture/SConstruct +++ b/test/CompilationDatabase/fixture/SConstruct @@ -12,8 +12,8 @@ env.Tool('compilation_db') if ARGUMENTS.get('ABSPATH', False): env['COMPILATIONDB_USE_ABSPATH'] = True - env.CompilationDatabase('compile_commands_abs.json') + env.CompilationDatabase('compile_commands_abs.json', source=[]) else: - env.CompilationDatabase('compile_commands.json') + env.CompilationDatabase('compile_commands.json', source=[]) env.Program('main', 'test_main.c') -- cgit v0.12 From f65a1d8642381193c3673c3642a2f7b2b1bafddb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 6 Jun 2020 12:23:29 -0700 Subject: [ci skip] Updates to docs --- SCons/Tool/compilation_db.xml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index 12a4db0..1aec177 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -26,14 +26,7 @@ See its __doc__ string for a discussion of the format. - Sets up &b-CompilationDatabase; builder. - - - This builder generates a clang tooling compatible compilation database. - - - Note: The target file is typically named - compile_commands.json. + Sets up &b-CompilationDatabase; builder which generates a clang tooling compatible compilation database. @@ -52,10 +45,25 @@ See its __doc__ string for a discussion of the format. The &b-CompilationDatabase; builder writes a clang formatted compilation database - + which is consumed by a number of clang tools, editors, and other tools. + + + If you don't specify any files, the builder will default to compile_commands.json. + + + If you specify a single file as below + +env.CompilationDatabase('my_output.json') + + SCons will automatically use that as the target file. + If you specify more than one source, the source list will be ignored. + + + You should not specify source files. The &b-CompilationDatabase; builder instruments SCons to collect them from all + the C, C++, assembly source/target pairs. - This is consumed by a number of clang tools. + New in &SCons; 4.0.0 -- cgit v0.12 From 9e70741b4508367bb064c4d783e522fb80479df2 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 6 Jun 2020 12:25:10 -0700 Subject: Allow override environments to affect whether output file has abs or relative paths. If user doesn't specify target CompilationDatabase('my_output.json') SCons will swap what is by default the source to be the target and clear the source list. If no target specified use compile_commands.json. If more than one item specified as source, source is set to empty list --- SCons/Tool/compilation_db.py | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index 788f454..171e7f1 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -121,18 +121,11 @@ def compilation_db_entry_action(target, source, env, **kw): env=env["__COMPILATIONDB_ENV"], ) - if env['COMPILATIONDB_USE_ABSPATH']: - filename = env["__COMPILATIONDB_USOURCE"][0].abspath - target_name = env['__COMPILATIONDB_UTARGET'][0].abspath - else: - filename = env["__COMPILATIONDB_USOURCE"][0].path - target_name = env['__COMPILATIONDB_UTARGET'][0].path - entry = { "directory": env.Dir("#").abspath, "command": command, - "file": filename, - "target": target_name + "file": env["__COMPILATIONDB_USOURCE"][0], + "target": env['__COMPILATIONDB_UTARGET'][0] } target[0].write(entry) @@ -141,8 +134,26 @@ def compilation_db_entry_action(target, source, env, **kw): def write_compilation_db(target, source, env): entries = [] + use_abspath = env['COMPILATIONDB_USE_ABSPATH'] in [True, 1, 'True', 'true'] + for s in __COMPILATION_DB_ENTRIES: - entries.append(s.read()) + entry = s.read() + source_file = entry['file'] + target_file = entry['target'] + + if use_abspath: + source_file = source_file.abspath + target_file = target_file.abspath + else: + source_file = source_file.path + target_file = target_file.path + + path_entry = {'directory': entry['directory'], + 'command': entry['command'], + 'file': source_file, + 'target': target_file} + + entries.append(path_entry) with open(target[0].path, "w") as target_file: json.dump( @@ -157,6 +168,10 @@ def scan_compilation_db(node, env, path): def compilation_db_emitter(target, source, env): """ fix up the source/targets """ + # Someone called env.CompilationDatabase('my_targetname.json') + if not target and len(source) == 1: + target = source + # Default target name is compilation_db.json if not target: target = ['compile_commands.json', ] -- cgit v0.12 From cddeec37f196eeb279ea9f06ec658d21c0971975 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 6 Jun 2020 16:25:53 -0700 Subject: Added tests which should cover all the variations of ways to call CompilationDatabase --- CHANGES.txt | 2 + SCons/Tool/compilation_db.xml | 4 ++ test/CompilationDatabase/basic.py | 79 ++++++++++++++++++++++++++--- test/CompilationDatabase/fixture/SConstruct | 27 ++++++++-- 4 files changed, 101 insertions(+), 11 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b04615f..26df3c5 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -57,6 +57,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER changing the name was required as we wanted to import symbols for use in compilation_db tool. - Add CompilationDatabase() builder in compilation_db tool. Contributed by MongoDB. + Setting COMPILATIONDB_USE_ABSPATH to True|False controls whether the files are absolute or relative + paths. From Jeremy Elson: - Updated design doc to use the correct syntax for Depends() diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index 1aec177..47126a7 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -63,6 +63,10 @@ env.CompilationDatabase('my_output.json') the C, C++, assembly source/target pairs. + NOTE: You must load the compilation_db tool prior to specifying any part of your build or some source/target + files will not show up in your output file. + + New in &SCons; 4.0.0 diff --git a/test/CompilationDatabase/basic.py b/test/CompilationDatabase/basic.py index 927bec7..b06098b 100644 --- a/test/CompilationDatabase/basic.py +++ b/test/CompilationDatabase/basic.py @@ -1,13 +1,40 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +""" +Test CompilationDatabase and several variations of ways to call it +and values of COMPILATIONDB_USE_ABSPATH +""" + import sys import TestSCons - test = TestSCons.TestSCons() if sys.platform == 'win32': test.file_fixture('mylink_win32.py', 'mylink.py') else: - test.file_fixture('mylink.py') + test.file_fixture('mylink.py') test.file_fixture('mygcc.py') @@ -15,8 +42,48 @@ test.verbose_set(1) test.file_fixture('fixture/SConstruct') test.file_fixture('test_main.c') test.run() -test.must_exist('compile_commands.json') -# Now test with absolute paths -test.run(arguments='ABSPATH=1') -test.must_exist('compile_commands_abs.json') +rel_files = [ + 'compile_commands_only_arg.json', + 'compile_commands_target.json', + 'compile_commands.json', + 'compile_commands_over_rel.json', + 'compile_commands_over_abs_0.json' +] + +abs_files = [ + 'compile_commands_clone_abs.json', + 'compile_commands_over_abs.json', + 'compile_commands_target_over_abs.json', + 'compile_commands_over_abs_1.json', +] + +example_rel_file = """[ + { + "command": "%s mygcc.py cc -o test_main.o -c test_main.c", + "directory": "%s", + "file": "test_main.c", + "target": "test_main.o" + } +]""" % (sys.executable, test.workdir) + +for f in rel_files: + # print("Checking:%s" % f) + test.must_exist(f) + test.must_match(f, example_rel_file) + +example_abs_file = """[ + { + "command": "%s mygcc.py cc -o test_main.o -c test_main.c", + "directory": "%s", + "file": "%s/test_main.c", + "target": "%s/test_main.o" + } +]""" % (sys.executable, test.workdir, test.workdir, test.workdir) + +for f in abs_files: + test.must_exist(f) + test.must_match(f, example_abs_file) + + +test.pass_test() diff --git a/test/CompilationDatabase/fixture/SConstruct b/test/CompilationDatabase/fixture/SConstruct index 0bbcafa..7453161 100644 --- a/test/CompilationDatabase/fixture/SConstruct +++ b/test/CompilationDatabase/fixture/SConstruct @@ -10,10 +10,27 @@ env = Environment( ) env.Tool('compilation_db') -if ARGUMENTS.get('ABSPATH', False): - env['COMPILATIONDB_USE_ABSPATH'] = True - env.CompilationDatabase('compile_commands_abs.json', source=[]) -else: - env.CompilationDatabase('compile_commands.json', source=[]) +env_abs = env.Clone(COMPILATIONDB_USE_ABSPATH=True) +env_abs.CompilationDatabase('compile_commands_clone_abs.json') + +# Should be relative paths +env.CompilationDatabase('compile_commands_only_arg.json') +env.CompilationDatabase(target='compile_commands_target.json') + +# Should default name compile_commands.json +env.CompilationDatabase() + +# Should be absolute paths +env.CompilationDatabase('compile_commands_over_abs.json', COMPILATIONDB_USE_ABSPATH=True) +env.CompilationDatabase(target='compile_commands_target_over_abs.json', COMPILATIONDB_USE_ABSPATH=True) + +# Should be relative paths +env.CompilationDatabase('compile_commands_over_rel.json', COMPILATIONDB_USE_ABSPATH=False) + + +# Try 1/0 for COMPILATIONDB_USE_ABSPATH +env.CompilationDatabase('compile_commands_over_abs_1.json', COMPILATIONDB_USE_ABSPATH=1) +env.CompilationDatabase('compile_commands_over_abs_0.json', COMPILATIONDB_USE_ABSPATH=0) + env.Program('main', 'test_main.c') -- cgit v0.12 From 12739bbdb2d67a376c23fbffc9fd6e53b8b77403 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 6 Jun 2020 16:26:47 -0700 Subject: Fix test SConstruct formatting --- test/CompilationDatabase/fixture/SConstruct | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/CompilationDatabase/fixture/SConstruct b/test/CompilationDatabase/fixture/SConstruct index 7453161..4043b5a 100644 --- a/test/CompilationDatabase/fixture/SConstruct +++ b/test/CompilationDatabase/fixture/SConstruct @@ -27,10 +27,8 @@ env.CompilationDatabase(target='compile_commands_target_over_abs.json', COMPILAT # Should be relative paths env.CompilationDatabase('compile_commands_over_rel.json', COMPILATIONDB_USE_ABSPATH=False) - # Try 1/0 for COMPILATIONDB_USE_ABSPATH env.CompilationDatabase('compile_commands_over_abs_1.json', COMPILATIONDB_USE_ABSPATH=1) env.CompilationDatabase('compile_commands_over_abs_0.json', COMPILATIONDB_USE_ABSPATH=0) - env.Program('main', 'test_main.c') -- cgit v0.12 From c2829674b04927e17784dd9653298ee25c440376 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 7 Jun 2020 11:41:40 -0700 Subject: [ci skip] updates based on mwichmann's review of the PR --- SCons/Tool/compilation_db.xml | 14 +++++++------- doc/user/misc.xml | 5 ++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index 47126a7..038e9cb 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -26,7 +26,7 @@ See its __doc__ string for a discussion of the format. - Sets up &b-CompilationDatabase; builder which generates a clang tooling compatible compilation database. + Sets up &b-link-CompilationDatabase; builder which generates a clang tooling compatible compilation database. @@ -42,9 +42,9 @@ See its __doc__ string for a discussion of the format. - The &b-CompilationDatabase; builder writes a - clang formatted compilation - database + The &b-CompilationDatabase; builder writes a JSON formatted compilation + database according to the + LLVM specification which is consumed by a number of clang tools, editors, and other tools. @@ -63,7 +63,7 @@ env.CompilationDatabase('my_output.json') the C, C++, assembly source/target pairs. - NOTE: You must load the compilation_db tool prior to specifying any part of your build or some source/target + NOTE: You must load the &t-compilation_db; tool prior to specifying any part of your build or some source/target files will not show up in your output file. @@ -85,10 +85,10 @@ env.CompilationDatabase('my_output.json') This is a boolean flag to instruct &b-link-CompilationDatabase; to write the file and target members - in the target file with absolute or relative path. + in the compilation database with absolute or relative paths. - The default value is False. + The default value is False (use relative paths) diff --git a/doc/user/misc.xml b/doc/user/misc.xml index 8aa7d62..e430897 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -693,9 +693,8 @@ env.Command('directory_build_info', - Currently SCons supports two variations. One is to output source and target files with paths relative to the - top - of the SCons build, or to output those files with their absolute path. + The compilation database can be populated with source and target files either with paths relative to the + top of the build, or using absolute paths. This is controlled by COMPILATIONDB_USE_ABSPATH=(True|False) -- cgit v0.12 From ea36b6cd1ac84c4c548073b1bb7a2326c9a82826 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Tue, 9 Jun 2020 11:57:08 -0600 Subject: msvc: fiddle debugs, add flow description Further fiddling with debug prints, reformat some docstrings, etc. Add a README which describes how the flow through vc.py takes place. Signed-off-by: Mats Wichmann --- SCons/Tool/MSCommon/README | 108 +++++++++++++++++++++++++++++++++++++++++++++ SCons/Tool/MSCommon/vc.py | 62 ++++++++++++++------------ 2 files changed, 141 insertions(+), 29 deletions(-) create mode 100644 SCons/Tool/MSCommon/README diff --git a/SCons/Tool/MSCommon/README b/SCons/Tool/MSCommon/README new file mode 100644 index 0000000..b3675cc --- /dev/null +++ b/SCons/Tool/MSCommon/README @@ -0,0 +1,108 @@ +This is the flow of the compiler detection logic: + +External to MSCommon: + + The Tool init modules, in their exists() routines, call -> msvc_exists(env) + +At the moment, those modules are: + SCons/Tool/midl.py + SCons/Tool/mslib.py + SCons/Tool/mslink.py + SCons/Tool/msvc.py + SCons/Tool/msvs.py + +env may contain a version request in MSVC_VERSION, but this is not used +in the detection that follows from msvc_exists(), only in the later +batch that starts with a call to msvc_setup_env(). + +Internal to MSCommon/vc.py: + ++ MSCommon/vc.py:msvc_exists +| vcs = cached_get_installed_vcs(env) +| returns True if vcs > 0 +| ++-> MSCommon/vc.py:cached_get_installed_vcs + | checks global if we've run previously, if so return it + | populate the global from -> get_installed_vcs(env) + | + +-> MSCommon/vc.py:get_installed_vcs + | loop through "known" versions of msvc, granularity is maj.min + | check for product dir -> find_vc_pdir(env, ver) + | + +-> MSCommon/vc.py:find_vc_pdir + | From the msvc-version to pdir mapping dict, get reg key base and value + | If value is none -> find_vc_pdir_vswhere(ver, env) + | + +-> MSCommon/vc.py:find_vc_pdir_vswhere + | From the vc-version to VS-version mapping table get string + | Figure out where vswhere is -> msvc_find_vswhere() + | Use subprocess to call vswhere, return first line of match + / + | Else get product directory from registry + | Note: 14.2, 14.1, 14.1Exp are the ones which will use vswhere + / + | + | if we found one -> _check_cl_exists_in_vc_dir(env, pdir, ver) + | + +-> MSCommon/vc.py:_check_cl_exists_in_vc_dir + | Figure out host/target pair + | If version > 14.0 get specific version by looking in + | pdir + Auxiliary/Build/Microsoft/VCToolsVersion/default.txt + | look for pdir + Tools/MSVC/{specver}/bin/host/target/cl.exe + | if 14.0 or less, "do older stuff" + +All of this just got us a yes-no answer on whether /some/ msvc version +exists, but does populate __INSTALLED_VCS_RUN with all of the top-level +versions as noted for get_installed_vcs + +Externally: + + Once a module's exists() has been called (or, in the case of + clang/clangxx, after the compiler has been detected by other means - + those still expect the rest of the msvc chain but not cl.exe) + the module's generate() function calls -> msvc_setup_env_once(env) + +Internally: + ++ MSCommon/vc.py:msvc_setup_env_once +| checks for environment flag MSVC_SETUP_RUN +| if not, -> msvc_setup_env(env) and set flag +| ++-+ MSCommon/vc.py:msvc_setup_env + | set ver from -> get_default_version(env) + | + +-+ MSCommon/vc.py:get_default_version + | if no version specified in env.MSVC_VERSION: + | return first entry from -> cached_get_installed_vcs(env) + | else + | return requested version + / + | get script from MSVC_USE_SCRIPT if set to a filename + | -> script_env(script) + | + +-+ MSCommon/vc.py:script_env + | return (possibly cached) script variables matching script arg + / + | else + | -> msvc_find_valid_batch_script(env, version) + | + +-+ MSCommon/vc.py:msvc_find_valid_batch_script + | Build a list of plausible target values, and loop through + | look for host + target -> find_batch_file(env, ver, host, target) + | + +-+ MSCommon/vc.py:find_batch_file + | call -> find_vc_pdir + | use the return to construct a version-biased batfile path, check + / + | if not found, try sdk scripts (unknown if this is still useful) + + +Problems: +- As documented for MSVC_VERSION, compilers can only be requested + if versions are from the set in _VCVER, so 14.1 but not 14.16.27023 +- Information found in the first pass (msvs_exists) isn't really + available anywhere except the cached version list, since we just + return true/fails +- For vswhere-ready versions, detection does not proceed beyond the + product level ("VS 2019") into individual "features" (i.e. specific + msvc install underneath it). diff --git a/SCons/Tool/MSCommon/vc.py b/SCons/Tool/MSCommon/vc.py index 95afcca..2fe4995 100644 --- a/SCons/Tool/MSCommon/vc.py +++ b/SCons/Tool/MSCommon/vc.py @@ -190,9 +190,8 @@ def get_msvc_version_numeric(msvc_version): return ''.join([x for x in msvc_version if x in string_digits + '.']) def get_host_target(env): - debug('called') - host_platform = env.get('HOST_ARCH') + debug("HOST_ARCH:" + str(host_platform)) if not host_platform: host_platform = platform.machine() @@ -205,8 +204,7 @@ def get_host_target(env): # Retain user requested TARGET_ARCH req_target_platform = env.get('TARGET_ARCH') - debug('req_target_platform:%s' % req_target_platform) - + debug("HOST_ARCH:" + str(req_target_platform)) if req_target_platform: # If user requested a specific platform then only try that one. target_platform = req_target_platform @@ -308,12 +306,17 @@ def msvc_version_to_maj_min(msvc_version): def is_host_target_supported(host_target, msvc_version): """Check if (host, target) pair is supported for a VC version. - :note: only checks whether a given version *may* support the given (host, - target), not that the toolchain is actually present on the machine. - :param tuple host_target: canonalized host-targets pair, e.g. - ("x86", "amd64") for cross compilation from 32 bit Windows to 64 bits. - :param str msvc_version: Visual C++ version (major.minor), e.g. "10.0" - :returns: True or False + Only checks whether a given version *may* support the given + (host, target) pair, not that the toolchain is actually on the machine. + + Args: + host_target: canonalized host-target pair, e.g. + ("x86", "amd64") for cross compilation from 32- to 64-bit Windows. + msvc_version: Visual C++ version (major.minor), e.g. "10.0" + + Returns: + True or False + """ # We assume that any Visual Studio version supports x86 as a target if host_target[1] != "x86": @@ -330,9 +333,7 @@ VSWHERE_PATHS = [os.path.join(p,'vswhere.exe') for p in [ ]] def msvc_find_vswhere(): - """ - Find the location of vswhere - """ + """ Find the location of vswhere """ # For bug 3333: support default location of vswhere for both # 64 and 32 bit windows installs. # For bug 3542: also accommodate not being on C: drive. @@ -347,14 +348,19 @@ def msvc_find_vswhere(): return vswhere_path def find_vc_pdir_vswhere(msvc_version, env=None): - """ - Find the MSVC product directory using the vswhere program. + """ Find the MSVC product directory using the vswhere program. - :param msvc_version: MSVC version to search for - :return: MSVC install dir or None - :raises UnsupportedVersion: if the version is not known by this file - """ + Args: + msvc_version: MSVC version to search for + env: optional to look up VSWHERE variable + Returns: + MSVC install dir or None + + Raises: + UnsupportedVersion: if the version is not known by this file + + """ try: vswhere_version = _VCVER_TO_VSWHERE_VER[msvc_version] except KeyError: @@ -369,7 +375,7 @@ def find_vc_pdir_vswhere(msvc_version, env=None): if vswhere_path is None: return None - debug('VSWHERE = %s'%vswhere_path) + debug('VSWHERE: %s' % vswhere_path) vswhere_cmd = [ vswhere_path, "-products", "*", @@ -414,6 +420,7 @@ def find_vc_pdir(env, msvc_version): MissingConfiguration: found version but the directory is missing. Both exceptions inherit from VisualCException. + """ root = 'Software\\' try: @@ -467,7 +474,7 @@ def find_batch_file(env,msvc_version,host_arch,target_arch): pdir = find_vc_pdir(env, msvc_version) if pdir is None: raise NoVersionFound("No version of Visual Studio found") - debug('find_batch_file() in {}'.format(pdir)) + debug('looking in {}'.format(pdir)) # filter out e.g. "Exp" from the version name msvc_ver_numeric = get_msvc_version_numeric(msvc_version) @@ -590,8 +597,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): return True elif 14 >= ver_num >= 8: - - # Set default value to be -1 as "" which is the value for x86/x86 + # Set default value to be -1 as "", which is the value for x86/x86, # yields true when tested if not host_trgt_dir host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None) if host_trgt_dir is None: @@ -714,12 +720,9 @@ def script_env(script, args=None): return cache_data def get_default_version(env): - debug('called') - msvc_version = env.get('MSVC_VERSION') msvs_version = env.get('MSVS_VERSION') - - debug('msvc_version:%s msvs_version:%s' % (msvc_version,msvs_version)) + debug('msvc_version:%s msvs_version:%s' % (msvc_version, msvs_version)) if msvs_version and not msvc_version: SCons.Warnings.warn( @@ -735,6 +738,7 @@ def get_default_version(env): "visual studio version, MSVS_VERSION is deprecated" \ % (msvc_version, msvs_version)) return msvs_version + if not msvc_version: installed_vcs = cached_get_installed_vcs(env) debug('installed_vcs:%s' % installed_vcs) @@ -746,6 +750,8 @@ def get_default_version(env): return None msvc_version = installed_vcs[0] debug('using default installed MSVC version %s' % repr(msvc_version)) + else: + debug('using specified MSVC version %s' % repr(msvc_version)) return msvc_version @@ -879,14 +885,12 @@ def msvc_find_valid_batch_script(env, version): def msvc_setup_env(env): debug('called') - version = get_default_version(env) if version is None: warn_msg = "No version of Visual Studio compiler found - C/C++ " \ "compilers most likely not set correctly" SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) return None - debug('using specified MSVC version %s' % repr(version)) # XXX: we set-up both MSVS version for backward # compatibility with the msvs tool -- cgit v0.12 From 2a3aca70e0a214ab8ec5afc0600ab3949d5a5ca0 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sun, 15 Mar 2020 18:23:28 +0100 Subject: Adding Docker container files for Ubuntu 19.10. Adding a 'build' and 'test' Docker container, such that users/developers can create a clean and reproducible environment for testing and building/releasing SCons on their machines. --- docker/docker.rst | 101 +++++++++++++++++++++ docker/ubuntu19.10/build/Dockerfile | 17 ++++ docker/ubuntu19.10/build/build_image.sh | 16 ++++ docker/ubuntu19.10/build/docker-compose.yml | 22 +++++ docker/ubuntu19.10/build/readme.rst | 43 +++++++++ docker/ubuntu19.10/build/start_build_shell.sh | 18 ++++ .../ubuntu19.10/build/startup/setup_container.sh | 10 ++ docker/ubuntu19.10/build/stop_build_shell.sh | 17 ++++ docker/ubuntu19.10/test/Dockerfile | 10 ++ docker/ubuntu19.10/test/build_image.sh | 16 ++++ docker/ubuntu19.10/test/docker-compose.yml | 22 +++++ docker/ubuntu19.10/test/readme.rst | 43 +++++++++ docker/ubuntu19.10/test/start_test_shell.sh | 18 ++++ docker/ubuntu19.10/test/startup/setup_container.sh | 10 ++ docker/ubuntu19.10/test/stop_test_shell.sh | 17 ++++ 15 files changed, 380 insertions(+) create mode 100644 docker/docker.rst create mode 100644 docker/ubuntu19.10/build/Dockerfile create mode 100755 docker/ubuntu19.10/build/build_image.sh create mode 100644 docker/ubuntu19.10/build/docker-compose.yml create mode 100644 docker/ubuntu19.10/build/readme.rst create mode 100755 docker/ubuntu19.10/build/start_build_shell.sh create mode 100755 docker/ubuntu19.10/build/startup/setup_container.sh create mode 100755 docker/ubuntu19.10/build/stop_build_shell.sh create mode 100644 docker/ubuntu19.10/test/Dockerfile create mode 100755 docker/ubuntu19.10/test/build_image.sh create mode 100644 docker/ubuntu19.10/test/docker-compose.yml create mode 100644 docker/ubuntu19.10/test/readme.rst create mode 100755 docker/ubuntu19.10/test/start_test_shell.sh create mode 100755 docker/ubuntu19.10/test/startup/setup_container.sh create mode 100755 docker/ubuntu19.10/test/stop_test_shell.sh diff --git a/docker/docker.rst b/docker/docker.rst new file mode 100644 index 0000000..5845486 --- /dev/null +++ b/docker/docker.rst @@ -0,0 +1,101 @@ +================================== +Basic working with docker registry +================================== + +Install required packages +========================= + +Ensure that the following packages are installed on your local machine:: + + docker.io >= v18.09 + docker-compose >= v1.17 + +User and group +============== + +Add your local user to the `docker` group, e.g. by:: + + sudo usermod -aG docker ${USER} + +. After this step logout and login again, so that the change has been applied and the new group +is in effect. + + +Configuring docker daemon +========================= + +Reconfigure by editing `/etc/docker/daemon.json` as *root*:: + + { + "debug": false + } + +. + +Then reboot the machine or simply restart the daemon as *root* with:: + + sudo systemctl restart docker.service + +To check that the docker daemon was configured correctly, do a:: + + docker info + +which should result in an output similar to:: + + Client: + Debug Mode: false + + Server: + Containers: 0 + Running: 0 + Paused: 0 + Stopped: 0 + Images: 0 + Server Version: 19.03.6 + Storage Driver: overlay2 + Backing Filesystem: extfs + Supports d_type: true + Native Overlay Diff: true + Logging Driver: json-file + Cgroup Driver: cgroupfs + Plugins: + Volume: local + Network: bridge host ipvlan macvlan null overlay + Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog + Swarm: inactive + Runtimes: runc + Default Runtime: runc + Init Binary: docker-init + containerd version: + runc version: + init version: + Security Options: + apparmor + seccomp + Profile: default + Kernel Version: 4.15.0-88-generic + Operating System: Ubuntu 18.04.4 LTS + OSType: linux + Architecture: x86_64 + CPUs: 4 + Total Memory: 6.997GiB + Name: ubuntu + ID: H2N5:VOZ6:UO6V:B36O:MD6Q:7GXR:M4QY:7EBB:NC6R:HQCQ:7ARF:CZBH + Docker Root Dir: /var/lib/docker + Debug Mode: false + Registry: https://index.docker.io/v1/ + Labels: + Experimental: false + Insecure Registries: + 127.0.0.0/8 + Live Restore Enabled: false + + WARNING: No swap limit support + +Setup resolv.conf if necessary +=============================== + +Docker uses `etc/resolv.conf` DNS information and passes that automatically to containers. If the file is not configured +properly or if entries are not valid, the server adds automatically public Google DNS nameservers +(8.8.8.8 and 8.8.4.4) to the container's DNS configuration. + diff --git a/docker/ubuntu19.10/build/Dockerfile b/docker/ubuntu19.10/build/Dockerfile new file mode 100644 index 0000000..38f4dd7 --- /dev/null +++ b/docker/ubuntu19.10/build/Dockerfile @@ -0,0 +1,17 @@ +# Building an SCons Release Build image under Ubuntu 19.10 +FROM ubuntu:19.10 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on an Ubuntu 19.10" + +# Install additional packages +RUN apt-get update && apt-get -y install git python3-lxml fop libfontbox-java python3-dev rpm tar curl lynx xterm vim vim-common nano sudo + +# Install hyphenation patterns for FOP +RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ + +# Epydoc can be installed via pip3, but it doesn't seem to work properly. +# For the moment we don't install it and might replace it with Sphinx later... +# RUN apt-get -y install python3-pip && pip3 install epydoc + +CMD ["/bin/bash"] + diff --git a/docker/ubuntu19.10/build/build_image.sh b/docker/ubuntu19.10/build/build_image.sh new file mode 100755 index 0000000..29e0f7e --- /dev/null +++ b/docker/ubuntu19.10/build/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-build-ubuntu19.10:latest -t scons-build-ubuntu19.10:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/docker/ubuntu19.10/build/docker-compose.yml b/docker/ubuntu19.10/build/docker-compose.yml new file mode 100644 index 0000000..aa34bac --- /dev/null +++ b/docker/ubuntu19.10/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-build-ubuntu19.10:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Build_Ubuntu19.10 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/docker/ubuntu19.10/build/readme.rst b/docker/ubuntu19.10/build/readme.rst new file mode 100644 index 0000000..b21d52c --- /dev/null +++ b/docker/ubuntu19.10/build/readme.rst @@ -0,0 +1,43 @@ +================================== +Image for building/releasing SCons +================================== + +This folder contains the files and scripts that can be used to +build and release SCons, based on an Ubuntu 19.10. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_build_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the build image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_build_shell.sh + +. + diff --git a/docker/ubuntu19.10/build/start_build_shell.sh b/docker/ubuntu19.10/build/start_build_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/docker/ubuntu19.10/build/start_build_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/docker/ubuntu19.10/build/startup/setup_container.sh b/docker/ubuntu19.10/build/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/docker/ubuntu19.10/build/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/docker/ubuntu19.10/build/stop_build_shell.sh b/docker/ubuntu19.10/build/stop_build_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/docker/ubuntu19.10/build/stop_build_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + diff --git a/docker/ubuntu19.10/test/Dockerfile b/docker/ubuntu19.10/test/Dockerfile new file mode 100644 index 0000000..a86947e --- /dev/null +++ b/docker/ubuntu19.10/test/Dockerfile @@ -0,0 +1,10 @@ +# Building an SCons Test image under Ubuntu 19.10 +FROM ubuntu:19.10 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on an Ubuntu 19.10" + +# Install additional packages +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install git bison cssc cvs flex g++ gcc ghostscript m4 openssh-client openssh-server python3-profiler python3-all-dev pypy-dev rcs rpm openjdk-8-jdk swig texlive-base-bin texlive-extra-utils texlive-latex-base texlive-latex-extra zip xterm vim vim-common nano sudo + +CMD ["/bin/bash"] + diff --git a/docker/ubuntu19.10/test/build_image.sh b/docker/ubuntu19.10/test/build_image.sh new file mode 100755 index 0000000..92649a0 --- /dev/null +++ b/docker/ubuntu19.10/test/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-test-ubuntu19.10:latest -t scons-test-ubuntu19.10:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/docker/ubuntu19.10/test/docker-compose.yml b/docker/ubuntu19.10/test/docker-compose.yml new file mode 100644 index 0000000..1f3777f --- /dev/null +++ b/docker/ubuntu19.10/test/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-test-ubuntu19.10:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Test_Ubuntu19.10 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/docker/ubuntu19.10/test/readme.rst b/docker/ubuntu19.10/test/readme.rst new file mode 100644 index 0000000..d7247d2 --- /dev/null +++ b/docker/ubuntu19.10/test/readme.rst @@ -0,0 +1,43 @@ +======================= +Image for testing SCons +======================= + +This folder contains the files and scripts that can be used to +test SCons, based on an Ubuntu 19.10. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_test_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the test image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_test_shell.sh + +. + diff --git a/docker/ubuntu19.10/test/start_test_shell.sh b/docker/ubuntu19.10/test/start_test_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/docker/ubuntu19.10/test/start_test_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/docker/ubuntu19.10/test/startup/setup_container.sh b/docker/ubuntu19.10/test/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/docker/ubuntu19.10/test/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/docker/ubuntu19.10/test/stop_test_shell.sh b/docker/ubuntu19.10/test/stop_test_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/docker/ubuntu19.10/test/stop_test_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + -- cgit v0.12 From cb1943f56f40c099b9aa77d8f3aa9e8262950560 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sun, 15 Mar 2020 23:13:35 +0100 Subject: Adding Docker container files for Fedora 30. --- docker/fedora30/build/Dockerfile | 17 ++++++++++ docker/fedora30/build/build_image.sh | 16 +++++++++ docker/fedora30/build/docker-compose.yml | 22 ++++++++++++ docker/fedora30/build/readme.rst | 43 ++++++++++++++++++++++++ docker/fedora30/build/start_build_shell.sh | 18 ++++++++++ docker/fedora30/build/startup/setup_container.sh | 10 ++++++ docker/fedora30/build/stop_build_shell.sh | 17 ++++++++++ docker/fedora30/test/Dockerfile | 10 ++++++ docker/fedora30/test/build_image.sh | 16 +++++++++ docker/fedora30/test/docker-compose.yml | 22 ++++++++++++ docker/fedora30/test/readme.rst | 43 ++++++++++++++++++++++++ docker/fedora30/test/start_test_shell.sh | 18 ++++++++++ docker/fedora30/test/startup/setup_container.sh | 10 ++++++ docker/fedora30/test/stop_test_shell.sh | 17 ++++++++++ 14 files changed, 279 insertions(+) create mode 100644 docker/fedora30/build/Dockerfile create mode 100755 docker/fedora30/build/build_image.sh create mode 100644 docker/fedora30/build/docker-compose.yml create mode 100644 docker/fedora30/build/readme.rst create mode 100755 docker/fedora30/build/start_build_shell.sh create mode 100755 docker/fedora30/build/startup/setup_container.sh create mode 100755 docker/fedora30/build/stop_build_shell.sh create mode 100644 docker/fedora30/test/Dockerfile create mode 100755 docker/fedora30/test/build_image.sh create mode 100644 docker/fedora30/test/docker-compose.yml create mode 100644 docker/fedora30/test/readme.rst create mode 100755 docker/fedora30/test/start_test_shell.sh create mode 100755 docker/fedora30/test/startup/setup_container.sh create mode 100755 docker/fedora30/test/stop_test_shell.sh diff --git a/docker/fedora30/build/Dockerfile b/docker/fedora30/build/Dockerfile new file mode 100644 index 0000000..c62037b --- /dev/null +++ b/docker/fedora30/build/Dockerfile @@ -0,0 +1,17 @@ +# Building an SCons Release Build image under Fedora 30 +FROM fedora:30 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on a Fedora 30" + +# Install additional packages +RUN dnf -y install git python3-lxml fop fontbox python3-devel lynx xterm vim vim-common nano + +# Install hyphenation patterns for FOP +RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ + +# Epydoc can be installed via pip3, but it doesn't seem to work properly. +# For the moment we don't install it and might replace it with Sphinx later... +# RUN dnf -y install python3-pip && pip3 install epydoc + +CMD ["/bin/bash"] + diff --git a/docker/fedora30/build/build_image.sh b/docker/fedora30/build/build_image.sh new file mode 100755 index 0000000..afd04b8 --- /dev/null +++ b/docker/fedora30/build/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-build-fedora30:latest -t scons-build-fedora30:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/docker/fedora30/build/docker-compose.yml b/docker/fedora30/build/docker-compose.yml new file mode 100644 index 0000000..86f3031 --- /dev/null +++ b/docker/fedora30/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-build-fedora30:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Build_Fedora30 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/docker/fedora30/build/readme.rst b/docker/fedora30/build/readme.rst new file mode 100644 index 0000000..18ac401 --- /dev/null +++ b/docker/fedora30/build/readme.rst @@ -0,0 +1,43 @@ +================================== +Image for building/releasing SCons +================================== + +This folder contains the files and scripts that can be used to +build and release SCons, based on a Fedora 30. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_build_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the build image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_build_shell.sh + +. + diff --git a/docker/fedora30/build/start_build_shell.sh b/docker/fedora30/build/start_build_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/docker/fedora30/build/start_build_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/docker/fedora30/build/startup/setup_container.sh b/docker/fedora30/build/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/docker/fedora30/build/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/docker/fedora30/build/stop_build_shell.sh b/docker/fedora30/build/stop_build_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/docker/fedora30/build/stop_build_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + diff --git a/docker/fedora30/test/Dockerfile b/docker/fedora30/test/Dockerfile new file mode 100644 index 0000000..20a0749 --- /dev/null +++ b/docker/fedora30/test/Dockerfile @@ -0,0 +1,10 @@ +# Building an SCons Test image under Fedora 30 +FROM fedora:30 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on a Fedora 30" + +# Install additional packages +RUN dnf -y install git bison cvs flex g++ gcc ghostscript m4 openssh-clients openssh-server python3-line_profiler python3-devel pypy3-devel rpm-build rcs java-1.8.0-openjdk swig texlive-scheme-basic texlive-base texlive-latex zip xterm vim vim-common nano + +CMD ["/bin/bash"] + diff --git a/docker/fedora30/test/build_image.sh b/docker/fedora30/test/build_image.sh new file mode 100755 index 0000000..5e1eaba --- /dev/null +++ b/docker/fedora30/test/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-test-fedora30:latest -t scons-test-fedora30:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/docker/fedora30/test/docker-compose.yml b/docker/fedora30/test/docker-compose.yml new file mode 100644 index 0000000..25daa18 --- /dev/null +++ b/docker/fedora30/test/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-test-fedora30:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Test_Fedora30 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/docker/fedora30/test/readme.rst b/docker/fedora30/test/readme.rst new file mode 100644 index 0000000..8cba2e9 --- /dev/null +++ b/docker/fedora30/test/readme.rst @@ -0,0 +1,43 @@ +======================= +Image for testing SCons +======================= + +This folder contains the files and scripts that can be used to +test SCons, based on a Fedora 30. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_test_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the test image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_test_shell.sh + +. + diff --git a/docker/fedora30/test/start_test_shell.sh b/docker/fedora30/test/start_test_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/docker/fedora30/test/start_test_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/docker/fedora30/test/startup/setup_container.sh b/docker/fedora30/test/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/docker/fedora30/test/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/docker/fedora30/test/stop_test_shell.sh b/docker/fedora30/test/stop_test_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/docker/fedora30/test/stop_test_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + -- cgit v0.12 From eeb7d3132ca73ee72ce215b458174d474eccfa26 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Tue, 9 Jun 2020 22:53:04 +0200 Subject: Added issue reference to CHANGES.txt. --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index ea288f5..6257093 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,6 +10,9 @@ NOTE: Please include a reference to any Issues resolved by your changes in the b RELEASE VERSION/DATE TO BE FILLED IN LATER + From Dirk Baechle: + - Added Docker images for building and testing SCons. (issue #3585) + From James Benton: - Improve Visual Studio solution/project generation code to add support for a per-variant cppflags. Intellisense can be affected by cppflags, -- cgit v0.12 From 3ed4cb6fd8dfe3e0655a6af00ae9c41430e5a019 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Wed, 10 Jun 2020 08:24:25 +0200 Subject: Moved the Docker files into the testing folder. [ci skip] --- docker/docker.rst | 101 --------------------- docker/fedora30/build/Dockerfile | 17 ---- docker/fedora30/build/build_image.sh | 16 ---- docker/fedora30/build/docker-compose.yml | 22 ----- docker/fedora30/build/readme.rst | 43 --------- docker/fedora30/build/start_build_shell.sh | 18 ---- docker/fedora30/build/startup/setup_container.sh | 10 -- docker/fedora30/build/stop_build_shell.sh | 17 ---- docker/fedora30/test/Dockerfile | 10 -- docker/fedora30/test/build_image.sh | 16 ---- docker/fedora30/test/docker-compose.yml | 22 ----- docker/fedora30/test/readme.rst | 43 --------- docker/fedora30/test/start_test_shell.sh | 18 ---- docker/fedora30/test/startup/setup_container.sh | 10 -- docker/fedora30/test/stop_test_shell.sh | 17 ---- docker/ubuntu19.10/build/Dockerfile | 17 ---- docker/ubuntu19.10/build/build_image.sh | 16 ---- docker/ubuntu19.10/build/docker-compose.yml | 22 ----- docker/ubuntu19.10/build/readme.rst | 43 --------- docker/ubuntu19.10/build/start_build_shell.sh | 18 ---- .../ubuntu19.10/build/startup/setup_container.sh | 10 -- docker/ubuntu19.10/build/stop_build_shell.sh | 17 ---- docker/ubuntu19.10/test/Dockerfile | 10 -- docker/ubuntu19.10/test/build_image.sh | 16 ---- docker/ubuntu19.10/test/docker-compose.yml | 22 ----- docker/ubuntu19.10/test/readme.rst | 43 --------- docker/ubuntu19.10/test/start_test_shell.sh | 18 ---- docker/ubuntu19.10/test/startup/setup_container.sh | 10 -- docker/ubuntu19.10/test/stop_test_shell.sh | 17 ---- testing/docker/docker.rst | 101 +++++++++++++++++++++ testing/docker/fedora30/build/Dockerfile | 17 ++++ testing/docker/fedora30/build/build_image.sh | 16 ++++ testing/docker/fedora30/build/docker-compose.yml | 22 +++++ testing/docker/fedora30/build/readme.rst | 43 +++++++++ testing/docker/fedora30/build/start_build_shell.sh | 18 ++++ .../fedora30/build/startup/setup_container.sh | 10 ++ testing/docker/fedora30/build/stop_build_shell.sh | 17 ++++ testing/docker/fedora30/test/Dockerfile | 10 ++ testing/docker/fedora30/test/build_image.sh | 16 ++++ testing/docker/fedora30/test/docker-compose.yml | 22 +++++ testing/docker/fedora30/test/readme.rst | 43 +++++++++ testing/docker/fedora30/test/start_test_shell.sh | 18 ++++ .../fedora30/test/startup/setup_container.sh | 10 ++ testing/docker/fedora30/test/stop_test_shell.sh | 17 ++++ testing/docker/ubuntu19.10/build/Dockerfile | 17 ++++ testing/docker/ubuntu19.10/build/build_image.sh | 16 ++++ .../docker/ubuntu19.10/build/docker-compose.yml | 22 +++++ testing/docker/ubuntu19.10/build/readme.rst | 43 +++++++++ .../docker/ubuntu19.10/build/start_build_shell.sh | 18 ++++ .../ubuntu19.10/build/startup/setup_container.sh | 10 ++ .../docker/ubuntu19.10/build/stop_build_shell.sh | 17 ++++ testing/docker/ubuntu19.10/test/Dockerfile | 10 ++ testing/docker/ubuntu19.10/test/build_image.sh | 16 ++++ testing/docker/ubuntu19.10/test/docker-compose.yml | 22 +++++ testing/docker/ubuntu19.10/test/readme.rst | 43 +++++++++ .../docker/ubuntu19.10/test/start_test_shell.sh | 18 ++++ .../ubuntu19.10/test/startup/setup_container.sh | 10 ++ testing/docker/ubuntu19.10/test/stop_test_shell.sh | 17 ++++ 58 files changed, 659 insertions(+), 659 deletions(-) delete mode 100644 docker/docker.rst delete mode 100644 docker/fedora30/build/Dockerfile delete mode 100755 docker/fedora30/build/build_image.sh delete mode 100644 docker/fedora30/build/docker-compose.yml delete mode 100644 docker/fedora30/build/readme.rst delete mode 100755 docker/fedora30/build/start_build_shell.sh delete mode 100755 docker/fedora30/build/startup/setup_container.sh delete mode 100755 docker/fedora30/build/stop_build_shell.sh delete mode 100644 docker/fedora30/test/Dockerfile delete mode 100755 docker/fedora30/test/build_image.sh delete mode 100644 docker/fedora30/test/docker-compose.yml delete mode 100644 docker/fedora30/test/readme.rst delete mode 100755 docker/fedora30/test/start_test_shell.sh delete mode 100755 docker/fedora30/test/startup/setup_container.sh delete mode 100755 docker/fedora30/test/stop_test_shell.sh delete mode 100644 docker/ubuntu19.10/build/Dockerfile delete mode 100755 docker/ubuntu19.10/build/build_image.sh delete mode 100644 docker/ubuntu19.10/build/docker-compose.yml delete mode 100644 docker/ubuntu19.10/build/readme.rst delete mode 100755 docker/ubuntu19.10/build/start_build_shell.sh delete mode 100755 docker/ubuntu19.10/build/startup/setup_container.sh delete mode 100755 docker/ubuntu19.10/build/stop_build_shell.sh delete mode 100644 docker/ubuntu19.10/test/Dockerfile delete mode 100755 docker/ubuntu19.10/test/build_image.sh delete mode 100644 docker/ubuntu19.10/test/docker-compose.yml delete mode 100644 docker/ubuntu19.10/test/readme.rst delete mode 100755 docker/ubuntu19.10/test/start_test_shell.sh delete mode 100755 docker/ubuntu19.10/test/startup/setup_container.sh delete mode 100755 docker/ubuntu19.10/test/stop_test_shell.sh create mode 100644 testing/docker/docker.rst create mode 100644 testing/docker/fedora30/build/Dockerfile create mode 100755 testing/docker/fedora30/build/build_image.sh create mode 100644 testing/docker/fedora30/build/docker-compose.yml create mode 100644 testing/docker/fedora30/build/readme.rst create mode 100755 testing/docker/fedora30/build/start_build_shell.sh create mode 100755 testing/docker/fedora30/build/startup/setup_container.sh create mode 100755 testing/docker/fedora30/build/stop_build_shell.sh create mode 100644 testing/docker/fedora30/test/Dockerfile create mode 100755 testing/docker/fedora30/test/build_image.sh create mode 100644 testing/docker/fedora30/test/docker-compose.yml create mode 100644 testing/docker/fedora30/test/readme.rst create mode 100755 testing/docker/fedora30/test/start_test_shell.sh create mode 100755 testing/docker/fedora30/test/startup/setup_container.sh create mode 100755 testing/docker/fedora30/test/stop_test_shell.sh create mode 100644 testing/docker/ubuntu19.10/build/Dockerfile create mode 100755 testing/docker/ubuntu19.10/build/build_image.sh create mode 100644 testing/docker/ubuntu19.10/build/docker-compose.yml create mode 100644 testing/docker/ubuntu19.10/build/readme.rst create mode 100755 testing/docker/ubuntu19.10/build/start_build_shell.sh create mode 100755 testing/docker/ubuntu19.10/build/startup/setup_container.sh create mode 100755 testing/docker/ubuntu19.10/build/stop_build_shell.sh create mode 100644 testing/docker/ubuntu19.10/test/Dockerfile create mode 100755 testing/docker/ubuntu19.10/test/build_image.sh create mode 100644 testing/docker/ubuntu19.10/test/docker-compose.yml create mode 100644 testing/docker/ubuntu19.10/test/readme.rst create mode 100755 testing/docker/ubuntu19.10/test/start_test_shell.sh create mode 100755 testing/docker/ubuntu19.10/test/startup/setup_container.sh create mode 100755 testing/docker/ubuntu19.10/test/stop_test_shell.sh diff --git a/docker/docker.rst b/docker/docker.rst deleted file mode 100644 index 5845486..0000000 --- a/docker/docker.rst +++ /dev/null @@ -1,101 +0,0 @@ -================================== -Basic working with docker registry -================================== - -Install required packages -========================= - -Ensure that the following packages are installed on your local machine:: - - docker.io >= v18.09 - docker-compose >= v1.17 - -User and group -============== - -Add your local user to the `docker` group, e.g. by:: - - sudo usermod -aG docker ${USER} - -. After this step logout and login again, so that the change has been applied and the new group -is in effect. - - -Configuring docker daemon -========================= - -Reconfigure by editing `/etc/docker/daemon.json` as *root*:: - - { - "debug": false - } - -. - -Then reboot the machine or simply restart the daemon as *root* with:: - - sudo systemctl restart docker.service - -To check that the docker daemon was configured correctly, do a:: - - docker info - -which should result in an output similar to:: - - Client: - Debug Mode: false - - Server: - Containers: 0 - Running: 0 - Paused: 0 - Stopped: 0 - Images: 0 - Server Version: 19.03.6 - Storage Driver: overlay2 - Backing Filesystem: extfs - Supports d_type: true - Native Overlay Diff: true - Logging Driver: json-file - Cgroup Driver: cgroupfs - Plugins: - Volume: local - Network: bridge host ipvlan macvlan null overlay - Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog - Swarm: inactive - Runtimes: runc - Default Runtime: runc - Init Binary: docker-init - containerd version: - runc version: - init version: - Security Options: - apparmor - seccomp - Profile: default - Kernel Version: 4.15.0-88-generic - Operating System: Ubuntu 18.04.4 LTS - OSType: linux - Architecture: x86_64 - CPUs: 4 - Total Memory: 6.997GiB - Name: ubuntu - ID: H2N5:VOZ6:UO6V:B36O:MD6Q:7GXR:M4QY:7EBB:NC6R:HQCQ:7ARF:CZBH - Docker Root Dir: /var/lib/docker - Debug Mode: false - Registry: https://index.docker.io/v1/ - Labels: - Experimental: false - Insecure Registries: - 127.0.0.0/8 - Live Restore Enabled: false - - WARNING: No swap limit support - -Setup resolv.conf if necessary -=============================== - -Docker uses `etc/resolv.conf` DNS information and passes that automatically to containers. If the file is not configured -properly or if entries are not valid, the server adds automatically public Google DNS nameservers -(8.8.8.8 and 8.8.4.4) to the container's DNS configuration. - diff --git a/docker/fedora30/build/Dockerfile b/docker/fedora30/build/Dockerfile deleted file mode 100644 index c62037b..0000000 --- a/docker/fedora30/build/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Building an SCons Release Build image under Fedora 30 -FROM fedora:30 - -LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on a Fedora 30" - -# Install additional packages -RUN dnf -y install git python3-lxml fop fontbox python3-devel lynx xterm vim vim-common nano - -# Install hyphenation patterns for FOP -RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ - -# Epydoc can be installed via pip3, but it doesn't seem to work properly. -# For the moment we don't install it and might replace it with Sphinx later... -# RUN dnf -y install python3-pip && pip3 install epydoc - -CMD ["/bin/bash"] - diff --git a/docker/fedora30/build/build_image.sh b/docker/fedora30/build/build_image.sh deleted file mode 100755 index afd04b8..0000000 --- a/docker/fedora30/build/build_image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker build passing any other build options (command line options may override!) -docker build --network=host --file Dockerfile \ - -t scons-build-fedora30:latest -t scons-build-fedora30:0.0.1 "$@" . - -cd $OLD_WD - diff --git a/docker/fedora30/build/docker-compose.yml b/docker/fedora30/build/docker-compose.yml deleted file mode 100644 index 86f3031..0000000 --- a/docker/fedora30/build/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' - -services: - build: - image: scons-build-fedora30:latest - restart: always - environment: - - DISPLAY - - HOME - volumes: - - /home:/home - - /tmp:/tmp - - /etc/sudoers:/etc/sudoers:ro - - /etc/passwd:/etc/passwd:ro - - /etc/shadow:/etc/shadow:ro - - /etc/group:/etc/group:ro - - ./startup:/startup - container_name: SCons_Build_Fedora30 - entrypoint: /startup/setup_container.sh - user: $DOCKERUID:$DOCKERGID - working_dir: $HOME - diff --git a/docker/fedora30/build/readme.rst b/docker/fedora30/build/readme.rst deleted file mode 100644 index 18ac401..0000000 --- a/docker/fedora30/build/readme.rst +++ /dev/null @@ -1,43 +0,0 @@ -================================== -Image for building/releasing SCons -================================== - -This folder contains the files and scripts that can be used to -build and release SCons, based on a Fedora 30. - -Building the image -================== - -Build the local docker image by calling:: - - ./build_image.sh - -This will download the base image and install the required additional packages. - -Starting the image -================== - -Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: - - ./start_build_shell.sh - -which will open a new ``xterm`` with your current user on the host system as default. - -If you need additional setup steps or want to *mount* different folders to the build image, change the -files:: - - docker-compose.yml - ./startup/setup_container.sh - -locally. - - -Stopping the image -================== - -Simply call:: - - ./stop_build_shell.sh - -. - diff --git a/docker/fedora30/build/start_build_shell.sh b/docker/fedora30/build/start_build_shell.sh deleted file mode 100755 index 6905634..0000000 --- a/docker/fedora30/build/start_build_shell.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -xhost +local:docker -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose up -d - -cd $OLD_WD - diff --git a/docker/fedora30/build/startup/setup_container.sh b/docker/fedora30/build/startup/setup_container.sh deleted file mode 100755 index f655441..0000000 --- a/docker/fedora30/build/startup/setup_container.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Here we can add local setup steps for the finishing touches to our Docker build container. -# This can be setting symbolic links, e.g. -# sudo ln -s /disk2/stuff /stuff -# or triggering further scripts. - -# We start a separate xterm/terminal, such that the container doesn't exit right away... -/usr/bin/xterm - diff --git a/docker/fedora30/build/stop_build_shell.sh b/docker/fedora30/build/stop_build_shell.sh deleted file mode 100755 index c0a9707..0000000 --- a/docker/fedora30/build/stop_build_shell.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose down - -cd $OLD_WD - diff --git a/docker/fedora30/test/Dockerfile b/docker/fedora30/test/Dockerfile deleted file mode 100644 index 20a0749..0000000 --- a/docker/fedora30/test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Building an SCons Test image under Fedora 30 -FROM fedora:30 - -LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on a Fedora 30" - -# Install additional packages -RUN dnf -y install git bison cvs flex g++ gcc ghostscript m4 openssh-clients openssh-server python3-line_profiler python3-devel pypy3-devel rpm-build rcs java-1.8.0-openjdk swig texlive-scheme-basic texlive-base texlive-latex zip xterm vim vim-common nano - -CMD ["/bin/bash"] - diff --git a/docker/fedora30/test/build_image.sh b/docker/fedora30/test/build_image.sh deleted file mode 100755 index 5e1eaba..0000000 --- a/docker/fedora30/test/build_image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker build passing any other build options (command line options may override!) -docker build --network=host --file Dockerfile \ - -t scons-test-fedora30:latest -t scons-test-fedora30:0.0.1 "$@" . - -cd $OLD_WD - diff --git a/docker/fedora30/test/docker-compose.yml b/docker/fedora30/test/docker-compose.yml deleted file mode 100644 index 25daa18..0000000 --- a/docker/fedora30/test/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' - -services: - build: - image: scons-test-fedora30:latest - restart: always - environment: - - DISPLAY - - HOME - volumes: - - /home:/home - - /tmp:/tmp - - /etc/sudoers:/etc/sudoers:ro - - /etc/passwd:/etc/passwd:ro - - /etc/shadow:/etc/shadow:ro - - /etc/group:/etc/group:ro - - ./startup:/startup - container_name: SCons_Test_Fedora30 - entrypoint: /startup/setup_container.sh - user: $DOCKERUID:$DOCKERGID - working_dir: $HOME - diff --git a/docker/fedora30/test/readme.rst b/docker/fedora30/test/readme.rst deleted file mode 100644 index 8cba2e9..0000000 --- a/docker/fedora30/test/readme.rst +++ /dev/null @@ -1,43 +0,0 @@ -======================= -Image for testing SCons -======================= - -This folder contains the files and scripts that can be used to -test SCons, based on a Fedora 30. - -Building the image -================== - -Build the local docker image by calling:: - - ./build_image.sh - -This will download the base image and install the required additional packages. - -Starting the image -================== - -Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: - - ./start_test_shell.sh - -which will open a new ``xterm`` with your current user on the host system as default. - -If you need additional setup steps or want to *mount* different folders to the test image, change the -files:: - - docker-compose.yml - ./startup/setup_container.sh - -locally. - - -Stopping the image -================== - -Simply call:: - - ./stop_test_shell.sh - -. - diff --git a/docker/fedora30/test/start_test_shell.sh b/docker/fedora30/test/start_test_shell.sh deleted file mode 100755 index 6905634..0000000 --- a/docker/fedora30/test/start_test_shell.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -xhost +local:docker -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose up -d - -cd $OLD_WD - diff --git a/docker/fedora30/test/startup/setup_container.sh b/docker/fedora30/test/startup/setup_container.sh deleted file mode 100755 index f655441..0000000 --- a/docker/fedora30/test/startup/setup_container.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Here we can add local setup steps for the finishing touches to our Docker build container. -# This can be setting symbolic links, e.g. -# sudo ln -s /disk2/stuff /stuff -# or triggering further scripts. - -# We start a separate xterm/terminal, such that the container doesn't exit right away... -/usr/bin/xterm - diff --git a/docker/fedora30/test/stop_test_shell.sh b/docker/fedora30/test/stop_test_shell.sh deleted file mode 100755 index c0a9707..0000000 --- a/docker/fedora30/test/stop_test_shell.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose down - -cd $OLD_WD - diff --git a/docker/ubuntu19.10/build/Dockerfile b/docker/ubuntu19.10/build/Dockerfile deleted file mode 100644 index 38f4dd7..0000000 --- a/docker/ubuntu19.10/build/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Building an SCons Release Build image under Ubuntu 19.10 -FROM ubuntu:19.10 - -LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on an Ubuntu 19.10" - -# Install additional packages -RUN apt-get update && apt-get -y install git python3-lxml fop libfontbox-java python3-dev rpm tar curl lynx xterm vim vim-common nano sudo - -# Install hyphenation patterns for FOP -RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ - -# Epydoc can be installed via pip3, but it doesn't seem to work properly. -# For the moment we don't install it and might replace it with Sphinx later... -# RUN apt-get -y install python3-pip && pip3 install epydoc - -CMD ["/bin/bash"] - diff --git a/docker/ubuntu19.10/build/build_image.sh b/docker/ubuntu19.10/build/build_image.sh deleted file mode 100755 index 29e0f7e..0000000 --- a/docker/ubuntu19.10/build/build_image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker build passing any other build options (command line options may override!) -docker build --network=host --file Dockerfile \ - -t scons-build-ubuntu19.10:latest -t scons-build-ubuntu19.10:0.0.1 "$@" . - -cd $OLD_WD - diff --git a/docker/ubuntu19.10/build/docker-compose.yml b/docker/ubuntu19.10/build/docker-compose.yml deleted file mode 100644 index aa34bac..0000000 --- a/docker/ubuntu19.10/build/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' - -services: - build: - image: scons-build-ubuntu19.10:latest - restart: always - environment: - - DISPLAY - - HOME - volumes: - - /home:/home - - /tmp:/tmp - - /etc/sudoers:/etc/sudoers:ro - - /etc/passwd:/etc/passwd:ro - - /etc/shadow:/etc/shadow:ro - - /etc/group:/etc/group:ro - - ./startup:/startup - container_name: SCons_Build_Ubuntu19.10 - entrypoint: /startup/setup_container.sh - user: $DOCKERUID:$DOCKERGID - working_dir: $HOME - diff --git a/docker/ubuntu19.10/build/readme.rst b/docker/ubuntu19.10/build/readme.rst deleted file mode 100644 index b21d52c..0000000 --- a/docker/ubuntu19.10/build/readme.rst +++ /dev/null @@ -1,43 +0,0 @@ -================================== -Image for building/releasing SCons -================================== - -This folder contains the files and scripts that can be used to -build and release SCons, based on an Ubuntu 19.10. - -Building the image -================== - -Build the local docker image by calling:: - - ./build_image.sh - -This will download the base image and install the required additional packages. - -Starting the image -================== - -Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: - - ./start_build_shell.sh - -which will open a new ``xterm`` with your current user on the host system as default. - -If you need additional setup steps or want to *mount* different folders to the build image, change the -files:: - - docker-compose.yml - ./startup/setup_container.sh - -locally. - - -Stopping the image -================== - -Simply call:: - - ./stop_build_shell.sh - -. - diff --git a/docker/ubuntu19.10/build/start_build_shell.sh b/docker/ubuntu19.10/build/start_build_shell.sh deleted file mode 100755 index 6905634..0000000 --- a/docker/ubuntu19.10/build/start_build_shell.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -xhost +local:docker -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose up -d - -cd $OLD_WD - diff --git a/docker/ubuntu19.10/build/startup/setup_container.sh b/docker/ubuntu19.10/build/startup/setup_container.sh deleted file mode 100755 index f655441..0000000 --- a/docker/ubuntu19.10/build/startup/setup_container.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Here we can add local setup steps for the finishing touches to our Docker build container. -# This can be setting symbolic links, e.g. -# sudo ln -s /disk2/stuff /stuff -# or triggering further scripts. - -# We start a separate xterm/terminal, such that the container doesn't exit right away... -/usr/bin/xterm - diff --git a/docker/ubuntu19.10/build/stop_build_shell.sh b/docker/ubuntu19.10/build/stop_build_shell.sh deleted file mode 100755 index c0a9707..0000000 --- a/docker/ubuntu19.10/build/stop_build_shell.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose down - -cd $OLD_WD - diff --git a/docker/ubuntu19.10/test/Dockerfile b/docker/ubuntu19.10/test/Dockerfile deleted file mode 100644 index a86947e..0000000 --- a/docker/ubuntu19.10/test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Building an SCons Test image under Ubuntu 19.10 -FROM ubuntu:19.10 - -LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on an Ubuntu 19.10" - -# Install additional packages -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install git bison cssc cvs flex g++ gcc ghostscript m4 openssh-client openssh-server python3-profiler python3-all-dev pypy-dev rcs rpm openjdk-8-jdk swig texlive-base-bin texlive-extra-utils texlive-latex-base texlive-latex-extra zip xterm vim vim-common nano sudo - -CMD ["/bin/bash"] - diff --git a/docker/ubuntu19.10/test/build_image.sh b/docker/ubuntu19.10/test/build_image.sh deleted file mode 100755 index 92649a0..0000000 --- a/docker/ubuntu19.10/test/build_image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker build passing any other build options (command line options may override!) -docker build --network=host --file Dockerfile \ - -t scons-test-ubuntu19.10:latest -t scons-test-ubuntu19.10:0.0.1 "$@" . - -cd $OLD_WD - diff --git a/docker/ubuntu19.10/test/docker-compose.yml b/docker/ubuntu19.10/test/docker-compose.yml deleted file mode 100644 index 1f3777f..0000000 --- a/docker/ubuntu19.10/test/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' - -services: - build: - image: scons-test-ubuntu19.10:latest - restart: always - environment: - - DISPLAY - - HOME - volumes: - - /home:/home - - /tmp:/tmp - - /etc/sudoers:/etc/sudoers:ro - - /etc/passwd:/etc/passwd:ro - - /etc/shadow:/etc/shadow:ro - - /etc/group:/etc/group:ro - - ./startup:/startup - container_name: SCons_Test_Ubuntu19.10 - entrypoint: /startup/setup_container.sh - user: $DOCKERUID:$DOCKERGID - working_dir: $HOME - diff --git a/docker/ubuntu19.10/test/readme.rst b/docker/ubuntu19.10/test/readme.rst deleted file mode 100644 index d7247d2..0000000 --- a/docker/ubuntu19.10/test/readme.rst +++ /dev/null @@ -1,43 +0,0 @@ -======================= -Image for testing SCons -======================= - -This folder contains the files and scripts that can be used to -test SCons, based on an Ubuntu 19.10. - -Building the image -================== - -Build the local docker image by calling:: - - ./build_image.sh - -This will download the base image and install the required additional packages. - -Starting the image -================== - -Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: - - ./start_test_shell.sh - -which will open a new ``xterm`` with your current user on the host system as default. - -If you need additional setup steps or want to *mount* different folders to the test image, change the -files:: - - docker-compose.yml - ./startup/setup_container.sh - -locally. - - -Stopping the image -================== - -Simply call:: - - ./stop_test_shell.sh - -. - diff --git a/docker/ubuntu19.10/test/start_test_shell.sh b/docker/ubuntu19.10/test/start_test_shell.sh deleted file mode 100755 index 6905634..0000000 --- a/docker/ubuntu19.10/test/start_test_shell.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -xhost +local:docker -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose up -d - -cd $OLD_WD - diff --git a/docker/ubuntu19.10/test/startup/setup_container.sh b/docker/ubuntu19.10/test/startup/setup_container.sh deleted file mode 100755 index f655441..0000000 --- a/docker/ubuntu19.10/test/startup/setup_container.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Here we can add local setup steps for the finishing touches to our Docker build container. -# This can be setting symbolic links, e.g. -# sudo ln -s /disk2/stuff /stuff -# or triggering further scripts. - -# We start a separate xterm/terminal, such that the container doesn't exit right away... -/usr/bin/xterm - diff --git a/docker/ubuntu19.10/test/stop_test_shell.sh b/docker/ubuntu19.10/test/stop_test_shell.sh deleted file mode 100755 index c0a9707..0000000 --- a/docker/ubuntu19.10/test/stop_test_shell.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose down - -cd $OLD_WD - diff --git a/testing/docker/docker.rst b/testing/docker/docker.rst new file mode 100644 index 0000000..5845486 --- /dev/null +++ b/testing/docker/docker.rst @@ -0,0 +1,101 @@ +================================== +Basic working with docker registry +================================== + +Install required packages +========================= + +Ensure that the following packages are installed on your local machine:: + + docker.io >= v18.09 + docker-compose >= v1.17 + +User and group +============== + +Add your local user to the `docker` group, e.g. by:: + + sudo usermod -aG docker ${USER} + +. After this step logout and login again, so that the change has been applied and the new group +is in effect. + + +Configuring docker daemon +========================= + +Reconfigure by editing `/etc/docker/daemon.json` as *root*:: + + { + "debug": false + } + +. + +Then reboot the machine or simply restart the daemon as *root* with:: + + sudo systemctl restart docker.service + +To check that the docker daemon was configured correctly, do a:: + + docker info + +which should result in an output similar to:: + + Client: + Debug Mode: false + + Server: + Containers: 0 + Running: 0 + Paused: 0 + Stopped: 0 + Images: 0 + Server Version: 19.03.6 + Storage Driver: overlay2 + Backing Filesystem: extfs + Supports d_type: true + Native Overlay Diff: true + Logging Driver: json-file + Cgroup Driver: cgroupfs + Plugins: + Volume: local + Network: bridge host ipvlan macvlan null overlay + Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog + Swarm: inactive + Runtimes: runc + Default Runtime: runc + Init Binary: docker-init + containerd version: + runc version: + init version: + Security Options: + apparmor + seccomp + Profile: default + Kernel Version: 4.15.0-88-generic + Operating System: Ubuntu 18.04.4 LTS + OSType: linux + Architecture: x86_64 + CPUs: 4 + Total Memory: 6.997GiB + Name: ubuntu + ID: H2N5:VOZ6:UO6V:B36O:MD6Q:7GXR:M4QY:7EBB:NC6R:HQCQ:7ARF:CZBH + Docker Root Dir: /var/lib/docker + Debug Mode: false + Registry: https://index.docker.io/v1/ + Labels: + Experimental: false + Insecure Registries: + 127.0.0.0/8 + Live Restore Enabled: false + + WARNING: No swap limit support + +Setup resolv.conf if necessary +=============================== + +Docker uses `etc/resolv.conf` DNS information and passes that automatically to containers. If the file is not configured +properly or if entries are not valid, the server adds automatically public Google DNS nameservers +(8.8.8.8 and 8.8.4.4) to the container's DNS configuration. + diff --git a/testing/docker/fedora30/build/Dockerfile b/testing/docker/fedora30/build/Dockerfile new file mode 100644 index 0000000..c62037b --- /dev/null +++ b/testing/docker/fedora30/build/Dockerfile @@ -0,0 +1,17 @@ +# Building an SCons Release Build image under Fedora 30 +FROM fedora:30 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on a Fedora 30" + +# Install additional packages +RUN dnf -y install git python3-lxml fop fontbox python3-devel lynx xterm vim vim-common nano + +# Install hyphenation patterns for FOP +RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ + +# Epydoc can be installed via pip3, but it doesn't seem to work properly. +# For the moment we don't install it and might replace it with Sphinx later... +# RUN dnf -y install python3-pip && pip3 install epydoc + +CMD ["/bin/bash"] + diff --git a/testing/docker/fedora30/build/build_image.sh b/testing/docker/fedora30/build/build_image.sh new file mode 100755 index 0000000..afd04b8 --- /dev/null +++ b/testing/docker/fedora30/build/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-build-fedora30:latest -t scons-build-fedora30:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/testing/docker/fedora30/build/docker-compose.yml b/testing/docker/fedora30/build/docker-compose.yml new file mode 100644 index 0000000..86f3031 --- /dev/null +++ b/testing/docker/fedora30/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-build-fedora30:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Build_Fedora30 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/testing/docker/fedora30/build/readme.rst b/testing/docker/fedora30/build/readme.rst new file mode 100644 index 0000000..18ac401 --- /dev/null +++ b/testing/docker/fedora30/build/readme.rst @@ -0,0 +1,43 @@ +================================== +Image for building/releasing SCons +================================== + +This folder contains the files and scripts that can be used to +build and release SCons, based on a Fedora 30. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_build_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the build image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_build_shell.sh + +. + diff --git a/testing/docker/fedora30/build/start_build_shell.sh b/testing/docker/fedora30/build/start_build_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/testing/docker/fedora30/build/start_build_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/testing/docker/fedora30/build/startup/setup_container.sh b/testing/docker/fedora30/build/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/testing/docker/fedora30/build/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/testing/docker/fedora30/build/stop_build_shell.sh b/testing/docker/fedora30/build/stop_build_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/testing/docker/fedora30/build/stop_build_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + diff --git a/testing/docker/fedora30/test/Dockerfile b/testing/docker/fedora30/test/Dockerfile new file mode 100644 index 0000000..20a0749 --- /dev/null +++ b/testing/docker/fedora30/test/Dockerfile @@ -0,0 +1,10 @@ +# Building an SCons Test image under Fedora 30 +FROM fedora:30 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on a Fedora 30" + +# Install additional packages +RUN dnf -y install git bison cvs flex g++ gcc ghostscript m4 openssh-clients openssh-server python3-line_profiler python3-devel pypy3-devel rpm-build rcs java-1.8.0-openjdk swig texlive-scheme-basic texlive-base texlive-latex zip xterm vim vim-common nano + +CMD ["/bin/bash"] + diff --git a/testing/docker/fedora30/test/build_image.sh b/testing/docker/fedora30/test/build_image.sh new file mode 100755 index 0000000..5e1eaba --- /dev/null +++ b/testing/docker/fedora30/test/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-test-fedora30:latest -t scons-test-fedora30:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/testing/docker/fedora30/test/docker-compose.yml b/testing/docker/fedora30/test/docker-compose.yml new file mode 100644 index 0000000..25daa18 --- /dev/null +++ b/testing/docker/fedora30/test/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-test-fedora30:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Test_Fedora30 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/testing/docker/fedora30/test/readme.rst b/testing/docker/fedora30/test/readme.rst new file mode 100644 index 0000000..8cba2e9 --- /dev/null +++ b/testing/docker/fedora30/test/readme.rst @@ -0,0 +1,43 @@ +======================= +Image for testing SCons +======================= + +This folder contains the files and scripts that can be used to +test SCons, based on a Fedora 30. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_test_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the test image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_test_shell.sh + +. + diff --git a/testing/docker/fedora30/test/start_test_shell.sh b/testing/docker/fedora30/test/start_test_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/testing/docker/fedora30/test/start_test_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/testing/docker/fedora30/test/startup/setup_container.sh b/testing/docker/fedora30/test/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/testing/docker/fedora30/test/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/testing/docker/fedora30/test/stop_test_shell.sh b/testing/docker/fedora30/test/stop_test_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/testing/docker/fedora30/test/stop_test_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + diff --git a/testing/docker/ubuntu19.10/build/Dockerfile b/testing/docker/ubuntu19.10/build/Dockerfile new file mode 100644 index 0000000..38f4dd7 --- /dev/null +++ b/testing/docker/ubuntu19.10/build/Dockerfile @@ -0,0 +1,17 @@ +# Building an SCons Release Build image under Ubuntu 19.10 +FROM ubuntu:19.10 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on an Ubuntu 19.10" + +# Install additional packages +RUN apt-get update && apt-get -y install git python3-lxml fop libfontbox-java python3-dev rpm tar curl lynx xterm vim vim-common nano sudo + +# Install hyphenation patterns for FOP +RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ + +# Epydoc can be installed via pip3, but it doesn't seem to work properly. +# For the moment we don't install it and might replace it with Sphinx later... +# RUN apt-get -y install python3-pip && pip3 install epydoc + +CMD ["/bin/bash"] + diff --git a/testing/docker/ubuntu19.10/build/build_image.sh b/testing/docker/ubuntu19.10/build/build_image.sh new file mode 100755 index 0000000..29e0f7e --- /dev/null +++ b/testing/docker/ubuntu19.10/build/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-build-ubuntu19.10:latest -t scons-build-ubuntu19.10:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/testing/docker/ubuntu19.10/build/docker-compose.yml b/testing/docker/ubuntu19.10/build/docker-compose.yml new file mode 100644 index 0000000..aa34bac --- /dev/null +++ b/testing/docker/ubuntu19.10/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-build-ubuntu19.10:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Build_Ubuntu19.10 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/testing/docker/ubuntu19.10/build/readme.rst b/testing/docker/ubuntu19.10/build/readme.rst new file mode 100644 index 0000000..b21d52c --- /dev/null +++ b/testing/docker/ubuntu19.10/build/readme.rst @@ -0,0 +1,43 @@ +================================== +Image for building/releasing SCons +================================== + +This folder contains the files and scripts that can be used to +build and release SCons, based on an Ubuntu 19.10. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_build_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the build image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_build_shell.sh + +. + diff --git a/testing/docker/ubuntu19.10/build/start_build_shell.sh b/testing/docker/ubuntu19.10/build/start_build_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/testing/docker/ubuntu19.10/build/start_build_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/testing/docker/ubuntu19.10/build/startup/setup_container.sh b/testing/docker/ubuntu19.10/build/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/testing/docker/ubuntu19.10/build/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/testing/docker/ubuntu19.10/build/stop_build_shell.sh b/testing/docker/ubuntu19.10/build/stop_build_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/testing/docker/ubuntu19.10/build/stop_build_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + diff --git a/testing/docker/ubuntu19.10/test/Dockerfile b/testing/docker/ubuntu19.10/test/Dockerfile new file mode 100644 index 0000000..a86947e --- /dev/null +++ b/testing/docker/ubuntu19.10/test/Dockerfile @@ -0,0 +1,10 @@ +# Building an SCons Test image under Ubuntu 19.10 +FROM ubuntu:19.10 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on an Ubuntu 19.10" + +# Install additional packages +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install git bison cssc cvs flex g++ gcc ghostscript m4 openssh-client openssh-server python3-profiler python3-all-dev pypy-dev rcs rpm openjdk-8-jdk swig texlive-base-bin texlive-extra-utils texlive-latex-base texlive-latex-extra zip xterm vim vim-common nano sudo + +CMD ["/bin/bash"] + diff --git a/testing/docker/ubuntu19.10/test/build_image.sh b/testing/docker/ubuntu19.10/test/build_image.sh new file mode 100755 index 0000000..92649a0 --- /dev/null +++ b/testing/docker/ubuntu19.10/test/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-test-ubuntu19.10:latest -t scons-test-ubuntu19.10:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/testing/docker/ubuntu19.10/test/docker-compose.yml b/testing/docker/ubuntu19.10/test/docker-compose.yml new file mode 100644 index 0000000..1f3777f --- /dev/null +++ b/testing/docker/ubuntu19.10/test/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-test-ubuntu19.10:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Test_Ubuntu19.10 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/testing/docker/ubuntu19.10/test/readme.rst b/testing/docker/ubuntu19.10/test/readme.rst new file mode 100644 index 0000000..d7247d2 --- /dev/null +++ b/testing/docker/ubuntu19.10/test/readme.rst @@ -0,0 +1,43 @@ +======================= +Image for testing SCons +======================= + +This folder contains the files and scripts that can be used to +test SCons, based on an Ubuntu 19.10. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_test_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the test image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_test_shell.sh + +. + diff --git a/testing/docker/ubuntu19.10/test/start_test_shell.sh b/testing/docker/ubuntu19.10/test/start_test_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/testing/docker/ubuntu19.10/test/start_test_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/testing/docker/ubuntu19.10/test/startup/setup_container.sh b/testing/docker/ubuntu19.10/test/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/testing/docker/ubuntu19.10/test/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/testing/docker/ubuntu19.10/test/stop_test_shell.sh b/testing/docker/ubuntu19.10/test/stop_test_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/testing/docker/ubuntu19.10/test/stop_test_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + -- cgit v0.12 From 2f5841806011b1ca123e58ddaa55e4319b5468da Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 10 Jun 2020 11:09:09 -0600 Subject: Documentation updates in perparation for 4.0 [ci skip] * Switch API docs to readthedocs theme * Add links in manpage SEE ALSO to external websites. These are not just live, but also listed out (Linux manpages won't have the hyperlinks) * Links use docbook5 xlink:href instead of deprecated (claimed to be removed, but apparently not) ulink syntax * Comment out manpage Examples section, and leave a pointer to scons-cookbook.readthedocs.io instead * Regenerate everything, mainly to pick up compilation_db stuff. Signed-off-by: Mats Wichmann --- CHANGES.txt | 7 ++- SCons/Tool/compilation_db.xml | 2 +- bin/scons_dev_master.py | 4 +- doc/generated/builders.gen | 33 +++++++++++++ doc/generated/builders.mod | 4 ++ doc/generated/examples/EnumVariable_map_1.xml | 2 +- doc/generated/examples/addmethod_ex1_1.xml | 2 +- doc/generated/examples/addmethod_ex2_1.xml | 2 +- doc/generated/examples/addmethod_ex2_2.xml | 2 +- doc/generated/examples/alias_ex1_1.xml | 2 +- doc/generated/examples/alias_ex2_1.xml | 2 +- doc/generated/examples/buildersbuiltin_ex1_1.xml | 2 +- doc/generated/examples/buildersbuiltin_ex2_1.xml | 2 +- doc/generated/examples/buildersbuiltin_ex3_1.xml | 2 +- doc/generated/examples/buildersbuiltin_ex4_1.xml | 2 +- doc/generated/examples/buildersbuiltin_libs_1.xml | 2 +- doc/generated/examples/buildersbuiltin_libs_2.xml | 2 +- doc/generated/examples/builderscommands_ex1_1.xml | 2 +- doc/generated/examples/builderscommands_ex2_1.xml | 2 +- .../examples/builderswriting_MY_EMITTER_1.xml | 2 +- doc/generated/examples/builderswriting_ex1_1.xml | 2 +- doc/generated/examples/builderswriting_ex2_1.xml | 2 +- doc/generated/examples/builderswriting_ex3_1.xml | 2 +- doc/generated/examples/builderswriting_ex4_1.xml | 2 +- doc/generated/examples/builderswriting_ex5_1.xml | 2 +- doc/generated/examples/builderswriting_ex6_1.xml | 2 +- doc/generated/examples/builderswriting_ex7_1.xml | 2 +- doc/generated/examples/caching_ex-random_1.xml | 8 ++-- doc/generated/examples/caching_ex1_1.xml | 2 +- doc/generated/examples/caching_ex1_2.xml | 2 +- doc/generated/examples/caching_ex1_4.xml | 2 +- doc/generated/examples/caching_ex1_5.xml | 2 +- doc/generated/examples/commandline_ARGLIST_1.xml | 2 +- doc/generated/examples/commandline_ARGUMENTS_1.xml | 2 +- doc/generated/examples/commandline_AddOption_1.xml | 2 +- doc/generated/examples/commandline_AddOption_2.xml | 2 +- .../examples/commandline_BUILD_TARGETS_1_1.xml | 2 +- .../examples/commandline_BoolVariable_1.xml | 2 +- .../examples/commandline_BoolVariable_2.xml | 2 +- .../examples/commandline_BoolVariable_3.xml | 2 +- .../examples/commandline_BoolVariable_4.xml | 2 +- .../examples/commandline_BoolVariable_5.xml | 2 +- .../commandline_COMMAND_LINE_TARGETS_1.xml | 2 +- .../examples/commandline_DEFAULT_TARGETS_1_1.xml | 2 +- .../examples/commandline_DEFAULT_TARGETS_2_1.xml | 2 +- doc/generated/examples/commandline_Default1_1.xml | 2 +- doc/generated/examples/commandline_Default1_2.xml | 2 +- doc/generated/examples/commandline_Default2_1.xml | 2 +- doc/generated/examples/commandline_Default3_1.xml | 2 +- doc/generated/examples/commandline_Default4_1.xml | 2 +- .../examples/commandline_EnumVariable_1.xml | 2 +- .../examples/commandline_EnumVariable_2.xml | 2 +- .../examples/commandline_EnumVariable_3.xml | 2 +- .../examples/commandline_EnumVariable_4.xml | 2 +- .../examples/commandline_EnumVariable_ic1_1.xml | 2 +- .../examples/commandline_EnumVariable_ic2_1.xml | 2 +- .../examples/commandline_ListVariable_1.xml | 2 +- .../examples/commandline_ListVariable_2.xml | 2 +- .../examples/commandline_ListVariable_3.xml | 2 +- .../examples/commandline_PackageVariable_1.xml | 2 +- .../examples/commandline_PathVariable_1.xml | 2 +- .../examples/commandline_PathVariable_2.xml | 2 +- .../examples/commandline_SCONSFLAGS_1.xml | 2 +- doc/generated/examples/commandline_SetOption_1.xml | 2 +- doc/generated/examples/commandline_SetOption_2.xml | 2 +- doc/generated/examples/commandline_SetOption_3.xml | 2 +- .../examples/commandline_UnknownVariables_1.xml | 2 +- .../examples/commandline_Variables1_1.xml | 2 +- .../examples/commandline_Variables_Help_1.xml | 2 +- .../commandline_Variables_custom_py_1_1.xml | 2 +- .../commandline_Variables_custom_py_2_1.xml | 2 +- doc/generated/examples/depends_AlwaysBuild_1.xml | 2 +- doc/generated/examples/depends_AlwaysBuild_2.xml | 2 +- doc/generated/examples/depends_Requires_1.xml | 2 +- doc/generated/examples/depends_ex1_1.xml | 2 +- doc/generated/examples/depends_ex1_2.xml | 2 +- doc/generated/examples/depends_ex1_3.xml | 2 +- doc/generated/examples/depends_ex1_4.xml | 2 +- doc/generated/examples/depends_ex1_5.xml | 2 +- doc/generated/examples/depends_ex1_6.xml | 2 +- doc/generated/examples/depends_ex1_7.xml | 2 +- doc/generated/examples/depends_ex1_8.xml | 2 +- doc/generated/examples/depends_ex5_1.xml | 2 +- doc/generated/examples/depends_ex5_2.xml | 2 +- .../examples/depends_ignore_explicit_1.xml | 2 +- doc/generated/examples/depends_include_1.xml | 2 +- doc/generated/examples/depends_macroinc_1.xml | 2 +- doc/generated/examples/depends_match_1.xml | 2 +- doc/generated/examples/depends_mixing_1.xml | 2 +- doc/generated/examples/depends_newer_1.xml | 2 +- doc/generated/examples/depends_no-Requires_1.xml | 2 +- doc/generated/examples/depends_parsedep_1.xml | 2 +- .../examples/environments_Append-nonexistent_1.xml | 2 +- .../environments_Prepend-nonexistent_1.xml | 2 +- .../environments_Replace-nonexistent_1.xml | 2 +- doc/generated/examples/environments_Replace1_1.xml | 2 +- doc/generated/examples/environments_Replace2_1.xml | 2 +- doc/generated/examples/environments_ex1_1.xml | 2 +- doc/generated/examples/environments_ex2_1.xml | 2 +- doc/generated/examples/environments_ex3_1.xml | 2 +- doc/generated/examples/environments_ex4_1.xml | 2 +- doc/generated/examples/environments_ex5_1.xml | 2 +- doc/generated/examples/environments_ex6_1.xml | 2 +- doc/generated/examples/environments_ex6b_1.xml | 2 +- doc/generated/examples/environments_ex6b_2.xml | 2 +- doc/generated/examples/environments_ex8_1.xml | 2 +- doc/generated/examples/environments_ex9_1.xml | 2 +- doc/generated/examples/environments_missing1_1.xml | 2 +- doc/generated/examples/environments_missing2_1.xml | 2 +- doc/generated/examples/environments_missing3_1.xml | 2 +- doc/generated/examples/factories_Chmod_1.xml | 2 +- doc/generated/examples/factories_Copy1_1.xml | 2 +- doc/generated/examples/factories_Copy2_1.xml | 2 +- doc/generated/examples/factories_Copy3_1.xml | 2 +- doc/generated/examples/factories_Delete1_1.xml | 2 +- doc/generated/examples/factories_Delete2_1.xml | 2 +- doc/generated/examples/factories_Execute_1.xml | 2 +- doc/generated/examples/factories_Mkdir_1.xml | 2 +- doc/generated/examples/factories_Move_1.xml | 2 +- doc/generated/examples/factories_Touch_1.xml | 2 +- doc/generated/examples/fileremoval_clean-ex1_1.xml | 2 +- .../examples/fileremoval_noclean-ex1_1.xml | 2 +- .../examples/fileremoval_precious-ex1_1.xml | 2 +- doc/generated/examples/hierarchy_Return_1.xml | 2 +- doc/generated/examples/hierarchy_ex1_1.xml | 2 +- doc/generated/examples/hierarchy_ex2_1.xml | 2 +- doc/generated/examples/hierarchy_ex3_1.xml | 2 +- doc/generated/examples/install_ex1_1.xml | 2 +- doc/generated/examples/install_ex2_1.xml | 2 +- doc/generated/examples/install_ex3_1.xml | 2 +- doc/generated/examples/install_ex4_1.xml | 2 +- doc/generated/examples/install_ex5_1.xml | 2 +- doc/generated/examples/java_JAVACLASSDIR_1.xml | 2 +- doc/generated/examples/java_RMIC_1.xml | 2 +- doc/generated/examples/java_jar1_1.xml | 2 +- doc/generated/examples/java_jar2_1.xml | 2 +- doc/generated/examples/java_java-classes_1.xml | 2 +- doc/generated/examples/java_java-classes_2.xml | 2 +- doc/generated/examples/java_java_1.xml | 2 +- doc/generated/examples/java_javah_1.xml | 2 +- doc/generated/examples/java_javah_file_1.xml | 2 +- doc/generated/examples/lesssimple_ex2_1.xml | 2 +- doc/generated/examples/lesssimple_ex3_1.xml | 2 +- doc/generated/examples/lesssimple_ex3_2.xml | 2 +- doc/generated/examples/lesssimple_ex4_1.xml | 2 +- doc/generated/examples/lesssimple_ex5_1.xml | 2 +- doc/generated/examples/lesssimple_target_1.xml | 2 +- doc/generated/examples/lesssimple_target_2.xml | 2 +- .../examples/libraries_SharedLibrary_1.xml | 2 +- .../examples/libraries_SharedLibrary_2.xml | 2 +- doc/generated/examples/libraries_ex1_1.xml | 2 +- doc/generated/examples/libraries_ex1_2.xml | 2 +- doc/generated/examples/libraries_ex2_1.xml | 2 +- doc/generated/examples/libraries_ex2_2.xml | 2 +- doc/generated/examples/libraries_ex3_1.xml | 2 +- doc/generated/examples/libraries_ex3_2.xml | 2 +- doc/generated/examples/libraries_objects_1.xml | 2 +- .../examples/mergeflags_MergeFlags1_1.xml | 2 +- .../examples/mergeflags_MergeFlags2_1.xml | 2 +- .../examples/mergeflags_MergeFlags3_1.xml | 2 +- doc/generated/examples/misc_Exit_1.xml | 2 +- doc/generated/examples/misc_FindFile1a_1.xml | 2 +- doc/generated/examples/misc_FindFile1b_1.xml | 2 +- doc/generated/examples/misc_FindFile1d_1.xml | 2 +- doc/generated/examples/misc_FindFile2_1.xml | 2 +- doc/generated/examples/misc_FindFile2_2.xml | 2 +- doc/generated/examples/misc_FindFile3_1.xml | 2 +- doc/generated/examples/misc_Flatten1_1.xml | 2 +- doc/generated/examples/misc_Flatten2_1.xml | 2 +- doc/generated/examples/nodes_GetBuildPath_1.xml | 2 +- doc/generated/examples/nodes_ex1_1.xml | 2 +- doc/generated/examples/nodes_ex1_2.xml | 2 +- doc/generated/examples/nodes_exists_1.xml | 2 +- doc/generated/examples/nodes_print_1.xml | 2 +- doc/generated/examples/nodes_print_2.xml | 2 +- .../examples/output_Progress-TARGET_1.xml | 2 +- doc/generated/examples/output_ex1_1.xml | 2 +- doc/generated/examples/output_ex2_1.xml | 2 +- doc/generated/examples/output_ex2_2.xml | 2 +- doc/generated/examples/output_gbf2_1.xml | 2 +- doc/generated/examples/parseflags_ex1_1.xml | 2 +- doc/generated/examples/parseflags_ex1_2.xml | 2 +- doc/generated/examples/parseflags_ex2_1.xml | 2 +- doc/generated/examples/parseflags_ex3_1.xml | 2 +- doc/generated/examples/parseflags_ex4_1.xml | 2 +- doc/generated/examples/repositories_CPPPATH3_1.xml | 2 +- doc/generated/examples/repositories_CPPPATH_1.xml | 2 +- doc/generated/examples/repositories_ex1_1.xml | 2 +- doc/generated/examples/repositories_ex2_1.xml | 2 +- doc/generated/examples/repositories_ex3_1.xml | 2 +- doc/generated/examples/repositories_ex4_1.xml | 2 +- doc/generated/examples/repositories_quote1_1.xml | 2 +- doc/generated/examples/separate_builddir_1.xml | 2 +- .../examples/separate_builddir_sconscript_1.xml | 2 +- doc/generated/examples/separate_duplicate0_1.xml | 2 +- doc/generated/examples/separate_ex1_1.xml | 2 +- .../separate_glob_builddir_sconscript_1.xml | 2 +- doc/generated/examples/sideeffect_parallel_1.xml | 2 +- doc/generated/examples/sideeffect_shared_1.xml | 2 +- doc/generated/examples/sideeffect_simple_1.xml | 4 +- doc/generated/examples/simple_Object_1.xml | 2 +- doc/generated/examples/simple_Object_2.xml | 2 +- doc/generated/examples/simple_clean_1.xml | 2 +- doc/generated/examples/simple_clean_2.xml | 2 +- doc/generated/examples/simple_declarative_1.xml | 2 +- doc/generated/examples/simple_ex1_1.xml | 2 +- doc/generated/examples/simple_ex1_2.xml | 2 +- doc/generated/examples/simple_ex1_3.xml | 2 +- doc/generated/examples/simple_ex1_4.xml | 2 +- doc/generated/examples/simple_java_1.xml | 2 +- doc/generated/examples/tasks_ex1_1.xml | 2 +- doc/generated/examples/troubleshoot_Dump_1.xml | 2 +- doc/generated/examples/troubleshoot_Dump_2.xml | 4 +- doc/generated/examples/troubleshoot_Dump_ENV_1.xml | 2 +- doc/generated/examples/troubleshoot_Dump_ENV_2.xml | 2 +- doc/generated/examples/troubleshoot_explain1_1.xml | 2 +- doc/generated/examples/troubleshoot_explain1_2.xml | 2 +- doc/generated/examples/troubleshoot_explain1_3.xml | 2 +- doc/generated/examples/troubleshoot_explain2_1.xml | 2 +- doc/generated/examples/troubleshoot_explain3_1.xml | 2 +- doc/generated/examples/troubleshoot_findlibs_1.xml | 2 +- .../examples/troubleshoot_stacktrace_1.xml | 2 +- .../examples/troubleshoot_stacktrace_2.xml | 6 +-- .../examples/troubleshoot_taskmastertrace_1.xml | 2 +- doc/generated/examples/troubleshoot_tree1_1.xml | 2 +- doc/generated/examples/troubleshoot_tree1_2.xml | 2 +- doc/generated/examples/troubleshoot_tree1_3.xml | 2 +- doc/generated/examples/troubleshoot_tree1_4.xml | 2 +- doc/generated/examples/troubleshoot_tree1_5.xml | 2 +- doc/generated/examples/troubleshoot_tree1_6.xml | 2 +- doc/generated/examples/troubleshoot_tree1_7.xml | 2 +- doc/generated/examples/troubleshoot_tree2_1.xml | 2 +- doc/generated/examples/troubleshoot_tree2_2.xml | 2 +- doc/generated/examples/variants_ex_1.xml | 2 +- doc/generated/examples/variants_ex_2.xml | 2 +- doc/generated/tools.gen | 7 +++ doc/generated/tools.mod | 2 + doc/generated/variables.gen | 55 +++++++++++++++------- doc/generated/variables.mod | 4 ++ doc/man/scons.xml | 33 +++++++++++-- doc/sphinx/conf.py | 14 ++++-- doc/user/main.xml | 5 +- doc/user/misc.xml | 6 +-- 243 files changed, 377 insertions(+), 273 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ea288f5..fa44b73 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -172,7 +172,12 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Close various logfiles (trace, cache, taskmastertrace, configure) when done using atexit calls. - Rebase forked copy of shutil.copytree to Python 3.7 stlib version. - + - Significant rework of documentation: API docs are now generated + using Sphinx; manpage and user guide now use more "standard" + markup elements (which could facilitate later conversion to a + different doc format, should that choice be made); significant + rewordings in manpage. Manpage Examples moved to an external + repository / website (scons-cookbook.readthedocs.io). RELEASE 3.1.2 - Mon, 17 Dec 2019 02:06:27 +0000 diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index 038e9cb..e5102ce 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -67,7 +67,7 @@ env.CompilationDatabase('my_output.json') files will not show up in your output file. - New in &SCons; 4.0.0 + Available since &scons; 4.0. diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py index 26beb62..ab102f3 100755 --- a/bin/scons_dev_master.py +++ b/bin/scons_dev_master.py @@ -47,10 +47,8 @@ BUILDING_PACKAGES = [ #'tetex-bin', #'tetex-latex', - # for ubuntu 9.10 - # 'texlive-lang-french' 'python3-sphinx', - 'sphinx-rtd-theme-common', + 'python3-sphinx-rtd-theme', ] diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index 0e85eeb..7a66bd4 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -50,6 +50,39 @@ for the calling syntax and details. + + CompilationDatabase() + env.CompilationDatabase() + + The CompilationDatabase builder writes a JSON formatted compilation + database according to the + LLVM specification + which is consumed by a number of clang tools, editors, and other tools. + + + If you don't specify any files, the builder will default to compile_commands.json. + + + If you specify a single file as below + +env.CompilationDatabase('my_output.json') + + SCons will automatically use that as the target file. + If you specify more than one source, the source list will be ignored. + + + You should not specify source files. The CompilationDatabase builder instruments SCons to collect them from all + the C, C++, assembly source/target pairs. + + + NOTE: You must load the compilation_db tool prior to specifying any part of your build or some source/target + files will not show up in your output file. + + + Available since scons 4.0. + + + CXXFile() env.CXXFile() diff --git a/doc/generated/builders.mod b/doc/generated/builders.mod index c4265d1..4835118 100644 --- a/doc/generated/builders.mod +++ b/doc/generated/builders.mod @@ -10,6 +10,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. CFile"> Command"> +CompilationDatabase"> CXXFile"> DocbookEpub"> DocbookHtml"> @@ -66,6 +67,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.CFile"> env.Command"> +env.CompilationDatabase"> env.CXXFile"> env.DocbookEpub"> env.DocbookHtml"> @@ -128,6 +130,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. CFile"> Command"> +CompilationDatabase"> CXXFile"> DocbookEpub"> DocbookHtml"> @@ -184,6 +187,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.CFile"> env.Command"> +env.CompilationDatabase"> env.CXXFile"> env.DocbookEpub"> env.DocbookHtml"> diff --git a/doc/generated/examples/EnumVariable_map_1.xml b/doc/generated/examples/EnumVariable_map_1.xml index 856731e..4f4ea06 100644 --- a/doc/generated/examples/EnumVariable_map_1.xml +++ b/doc/generated/examples/EnumVariable_map_1.xml @@ -1,3 +1,3 @@ -% scons -Q COLOR=navy foo.o +% scons -Q COLOR=navy foo.o cc -o foo.o -c -DCOLOR="blue" foo.c diff --git a/doc/generated/examples/addmethod_ex1_1.xml b/doc/generated/examples/addmethod_ex1_1.xml index 5cacf9d..bca073c 100644 --- a/doc/generated/examples/addmethod_ex1_1.xml +++ b/doc/generated/examples/addmethod_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q / +% scons -Q / cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello" diff --git a/doc/generated/examples/addmethod_ex2_1.xml b/doc/generated/examples/addmethod_ex2_1.xml index 4d0cb44..58054c5 100644 --- a/doc/generated/examples/addmethod_ex2_1.xml +++ b/doc/generated/examples/addmethod_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o test_stuff.o -c test_stuff.c cc -o tests/test_stuff test_stuff.o diff --git a/doc/generated/examples/addmethod_ex2_2.xml b/doc/generated/examples/addmethod_ex2_2.xml index 7ad282f..c9097cf 100644 --- a/doc/generated/examples/addmethod_ex2_2.xml +++ b/doc/generated/examples/addmethod_ex2_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q rc /nologo /fores.res res.rc cl /Fotest_stuff.obj /c test_stuff.c /nologo link /nologo /OUT:tests\test_stuff.exe test_stuff.obj res.res diff --git a/doc/generated/examples/alias_ex1_1.xml b/doc/generated/examples/alias_ex1_1.xml index d0db114..24bea2e 100644 --- a/doc/generated/examples/alias_ex1_1.xml +++ b/doc/generated/examples/alias_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q install +% scons -Q install cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello" diff --git a/doc/generated/examples/alias_ex2_1.xml b/doc/generated/examples/alias_ex2_1.xml index 56cc365..df1885a 100644 --- a/doc/generated/examples/alias_ex2_1.xml +++ b/doc/generated/examples/alias_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q install-bin +% scons -Q install-bin cc -o foo.o -c foo.c cc -o foo foo.o Install file: "foo" as "/usr/bin/foo" diff --git a/doc/generated/examples/buildersbuiltin_ex1_1.xml b/doc/generated/examples/buildersbuiltin_ex1_1.xml index 75b365d..da343b7 100644 --- a/doc/generated/examples/buildersbuiltin_ex1_1.xml +++ b/doc/generated/examples/buildersbuiltin_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q . +% scons -Q . tar -c -f out1.tar file1 file2 tar -c -f out2.tar directory diff --git a/doc/generated/examples/buildersbuiltin_ex2_1.xml b/doc/generated/examples/buildersbuiltin_ex2_1.xml index 88abed4..4166193 100644 --- a/doc/generated/examples/buildersbuiltin_ex2_1.xml +++ b/doc/generated/examples/buildersbuiltin_ex2_1.xml @@ -1,3 +1,3 @@ -% scons -Q . +% scons -Q . tar -c -z -f out.tar.gz directory diff --git a/doc/generated/examples/buildersbuiltin_ex3_1.xml b/doc/generated/examples/buildersbuiltin_ex3_1.xml index 5cb16d1..a96530b 100644 --- a/doc/generated/examples/buildersbuiltin_ex3_1.xml +++ b/doc/generated/examples/buildersbuiltin_ex3_1.xml @@ -1,3 +1,3 @@ -% scons -Q . +% scons -Q . tar -c -z -f out.tgz directory diff --git a/doc/generated/examples/buildersbuiltin_ex4_1.xml b/doc/generated/examples/buildersbuiltin_ex4_1.xml index e907422..0c09df1 100644 --- a/doc/generated/examples/buildersbuiltin_ex4_1.xml +++ b/doc/generated/examples/buildersbuiltin_ex4_1.xml @@ -1,3 +1,3 @@ -% scons -Q . +% scons -Q . zip(["out.zip"], ["file1", "file2"]) diff --git a/doc/generated/examples/buildersbuiltin_libs_1.xml b/doc/generated/examples/buildersbuiltin_libs_1.xml index 5b7abd9..e0f11f0 100644 --- a/doc/generated/examples/buildersbuiltin_libs_1.xml +++ b/doc/generated/examples/buildersbuiltin_libs_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o goodbye.o -c goodbye.c cc -o hello.o -c hello.c cc -o hello hello.o goodbye.o -L/usr/dir1 -Ldir2 -lfoo1 -lfoo2 diff --git a/doc/generated/examples/buildersbuiltin_libs_2.xml b/doc/generated/examples/buildersbuiltin_libs_2.xml index 31f3a46..36f8797 100644 --- a/doc/generated/examples/buildersbuiltin_libs_2.xml +++ b/doc/generated/examples/buildersbuiltin_libs_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fogoodbye.obj /c goodbye.c /nologo cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe /LIBPATH:\usr\dir1 /LIBPATH:dir2 foo1.lib foo2.lib hello.obj goodbye.obj diff --git a/doc/generated/examples/builderscommands_ex1_1.xml b/doc/generated/examples/builderscommands_ex1_1.xml index 470b5a4..6c75b57 100644 --- a/doc/generated/examples/builderscommands_ex1_1.xml +++ b/doc/generated/examples/builderscommands_ex1_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q sed 's/x/y/' < foo.in > foo.out diff --git a/doc/generated/examples/builderscommands_ex2_1.xml b/doc/generated/examples/builderscommands_ex2_1.xml index 1593352..ae5095f 100644 --- a/doc/generated/examples/builderscommands_ex2_1.xml +++ b/doc/generated/examples/builderscommands_ex2_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q build(["foo.out"], ["foo.in"]) diff --git a/doc/generated/examples/builderswriting_MY_EMITTER_1.xml b/doc/generated/examples/builderswriting_MY_EMITTER_1.xml index ef831e5..fd53158 100644 --- a/doc/generated/examples/builderswriting_MY_EMITTER_1.xml +++ b/doc/generated/examples/builderswriting_MY_EMITTER_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q ./my_command file1.input modify1.in > file1.foo ./my_command file2.input modify2.in > file2.foo diff --git a/doc/generated/examples/builderswriting_ex1_1.xml b/doc/generated/examples/builderswriting_ex1_1.xml index 1c6379a..0cc47f0 100644 --- a/doc/generated/examples/builderswriting_ex1_1.xml +++ b/doc/generated/examples/builderswriting_ex1_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q foobuild < file.input > file.foo diff --git a/doc/generated/examples/builderswriting_ex2_1.xml b/doc/generated/examples/builderswriting_ex2_1.xml index e86ee7b..3391653 100644 --- a/doc/generated/examples/builderswriting_ex2_1.xml +++ b/doc/generated/examples/builderswriting_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q AttributeError: 'SConsEnvironment' object has no attribute 'Program': File "/home/my/project/SConstruct", line 4: env.Program('hello.c') diff --git a/doc/generated/examples/builderswriting_ex3_1.xml b/doc/generated/examples/builderswriting_ex3_1.xml index 8e107c8..99991ef 100644 --- a/doc/generated/examples/builderswriting_ex3_1.xml +++ b/doc/generated/examples/builderswriting_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q foobuild < file.input > file.foo cc -o hello.o -c hello.c cc -o hello hello.o diff --git a/doc/generated/examples/builderswriting_ex4_1.xml b/doc/generated/examples/builderswriting_ex4_1.xml index f3ecd43..b2f1706 100644 --- a/doc/generated/examples/builderswriting_ex4_1.xml +++ b/doc/generated/examples/builderswriting_ex4_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q foobuild < file1.input > file1.foo foobuild < file2.input > file2.foo diff --git a/doc/generated/examples/builderswriting_ex5_1.xml b/doc/generated/examples/builderswriting_ex5_1.xml index e7e9097..3c58227 100644 --- a/doc/generated/examples/builderswriting_ex5_1.xml +++ b/doc/generated/examples/builderswriting_ex5_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q build_function(["file.foo"], ["file.input"]) diff --git a/doc/generated/examples/builderswriting_ex6_1.xml b/doc/generated/examples/builderswriting_ex6_1.xml index 1c6379a..0cc47f0 100644 --- a/doc/generated/examples/builderswriting_ex6_1.xml +++ b/doc/generated/examples/builderswriting_ex6_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q foobuild < file.input > file.foo diff --git a/doc/generated/examples/builderswriting_ex7_1.xml b/doc/generated/examples/builderswriting_ex7_1.xml index 88284fe..ef387eb 100644 --- a/doc/generated/examples/builderswriting_ex7_1.xml +++ b/doc/generated/examples/builderswriting_ex7_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q foobuild file.foo new_target - file.input new_source diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index 16a90be..5db6459 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,8 +1,8 @@ -% scons -Q -cc -o f1.o -c f1.c -cc -o f5.o -c f5.c -cc -o f3.o -c f3.c +% scons -Q cc -o f2.o -c f2.c +cc -o f3.o -c f3.c cc -o f4.o -c f4.c +cc -o f5.o -c f5.c +cc -o f1.o -c f1.c cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/generated/examples/caching_ex1_1.xml b/doc/generated/examples/caching_ex1_1.xml index 2d65d46..0c8d16a 100644 --- a/doc/generated/examples/caching_ex1_1.xml +++ b/doc/generated/examples/caching_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c diff --git a/doc/generated/examples/caching_ex1_2.xml b/doc/generated/examples/caching_ex1_2.xml index 1b27272..2678502 100644 --- a/doc/generated/examples/caching_ex1_2.xml +++ b/doc/generated/examples/caching_ex1_2.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c diff --git a/doc/generated/examples/caching_ex1_4.xml b/doc/generated/examples/caching_ex1_4.xml index c33dd9b..6b43a9f 100644 --- a/doc/generated/examples/caching_ex1_4.xml +++ b/doc/generated/examples/caching_ex1_4.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c diff --git a/doc/generated/examples/caching_ex1_5.xml b/doc/generated/examples/caching_ex1_5.xml index b784319..193d134 100644 --- a/doc/generated/examples/caching_ex1_5.xml +++ b/doc/generated/examples/caching_ex1_5.xml @@ -1,4 +1,4 @@ -% scons -Q --cache-disable +% scons -Q --cache-disable cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q -c diff --git a/doc/generated/examples/commandline_ARGLIST_1.xml b/doc/generated/examples/commandline_ARGLIST_1.xml index af2d032..7d60576 100644 --- a/doc/generated/examples/commandline_ARGLIST_1.xml +++ b/doc/generated/examples/commandline_ARGLIST_1.xml @@ -1,4 +1,4 @@ -% scons -Q define=FOO +% scons -Q define=FOO cc -o prog.o -c -DFOO prog.c % scons -Q define=FOO define=BAR cc -o prog.o -c -DFOO -DBAR prog.c diff --git a/doc/generated/examples/commandline_ARGUMENTS_1.xml b/doc/generated/examples/commandline_ARGUMENTS_1.xml index cd76cfb..7fcbf02 100644 --- a/doc/generated/examples/commandline_ARGUMENTS_1.xml +++ b/doc/generated/examples/commandline_ARGUMENTS_1.xml @@ -1,4 +1,4 @@ -% scons -Q debug=0 +% scons -Q debug=0 cc -o prog.o -c prog.c cc -o prog prog.o % scons -Q debug=0 diff --git a/doc/generated/examples/commandline_AddOption_1.xml b/doc/generated/examples/commandline_AddOption_1.xml index 5877f6d..d9d3cbc 100644 --- a/doc/generated/examples/commandline_AddOption_1.xml +++ b/doc/generated/examples/commandline_AddOption_1.xml @@ -1,3 +1,3 @@ -% scons -Q -n +% scons -Q -n Install file: "foo.in" as "/usr/bin/foo.in" diff --git a/doc/generated/examples/commandline_AddOption_2.xml b/doc/generated/examples/commandline_AddOption_2.xml index 3000a43..c7ceb6c 100644 --- a/doc/generated/examples/commandline_AddOption_2.xml +++ b/doc/generated/examples/commandline_AddOption_2.xml @@ -1,3 +1,3 @@ -% scons -Q -n --prefix=/tmp/install +% scons -Q -n --prefix=/tmp/install Install file: "foo.in" as "/tmp/install/usr/bin/foo.in" diff --git a/doc/generated/examples/commandline_BUILD_TARGETS_1_1.xml b/doc/generated/examples/commandline_BUILD_TARGETS_1_1.xml index be22abf..ebd81e5 100644 --- a/doc/generated/examples/commandline_BUILD_TARGETS_1_1.xml +++ b/doc/generated/examples/commandline_BUILD_TARGETS_1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q BUILD_TARGETS is ['prog1'] cc -o prog1.o -c prog1.c cc -o prog1 prog1.o diff --git a/doc/generated/examples/commandline_BoolVariable_1.xml b/doc/generated/examples/commandline_BoolVariable_1.xml index 481c0a3..bcaf8ca 100644 --- a/doc/generated/examples/commandline_BoolVariable_1.xml +++ b/doc/generated/examples/commandline_BoolVariable_1.xml @@ -1,3 +1,3 @@ -% scons -Q RELEASE=yes foo.o +% scons -Q RELEASE=yes foo.o cc -o foo.o -c -DRELEASE_BUILD=True foo.c diff --git a/doc/generated/examples/commandline_BoolVariable_2.xml b/doc/generated/examples/commandline_BoolVariable_2.xml index 69f8155..1313c8f 100644 --- a/doc/generated/examples/commandline_BoolVariable_2.xml +++ b/doc/generated/examples/commandline_BoolVariable_2.xml @@ -1,3 +1,3 @@ -% scons -Q RELEASE=t foo.o +% scons -Q RELEASE=t foo.o cc -o foo.o -c -DRELEASE_BUILD=True foo.c diff --git a/doc/generated/examples/commandline_BoolVariable_3.xml b/doc/generated/examples/commandline_BoolVariable_3.xml index 8d635f7..844cb6e 100644 --- a/doc/generated/examples/commandline_BoolVariable_3.xml +++ b/doc/generated/examples/commandline_BoolVariable_3.xml @@ -1,3 +1,3 @@ -% scons -Q RELEASE=no foo.o +% scons -Q RELEASE=no foo.o cc -o foo.o -c -DRELEASE_BUILD=False foo.c diff --git a/doc/generated/examples/commandline_BoolVariable_4.xml b/doc/generated/examples/commandline_BoolVariable_4.xml index c576eee..8f19ca0 100644 --- a/doc/generated/examples/commandline_BoolVariable_4.xml +++ b/doc/generated/examples/commandline_BoolVariable_4.xml @@ -1,3 +1,3 @@ -% scons -Q RELEASE=f foo.o +% scons -Q RELEASE=f foo.o cc -o foo.o -c -DRELEASE_BUILD=False foo.c diff --git a/doc/generated/examples/commandline_BoolVariable_5.xml b/doc/generated/examples/commandline_BoolVariable_5.xml index 2a31296..e232588 100644 --- a/doc/generated/examples/commandline_BoolVariable_5.xml +++ b/doc/generated/examples/commandline_BoolVariable_5.xml @@ -1,4 +1,4 @@ -% scons -Q RELEASE=bad_value foo.o +% scons -Q RELEASE=bad_value foo.o scons: *** Error converting option: RELEASE Invalid value for boolean option: bad_value diff --git a/doc/generated/examples/commandline_COMMAND_LINE_TARGETS_1.xml b/doc/generated/examples/commandline_COMMAND_LINE_TARGETS_1.xml index ba270b8..29fccc8 100644 --- a/doc/generated/examples/commandline_COMMAND_LINE_TARGETS_1.xml +++ b/doc/generated/examples/commandline_COMMAND_LINE_TARGETS_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o foo.o -c foo.c cc -o foo foo.o % scons -Q bar diff --git a/doc/generated/examples/commandline_DEFAULT_TARGETS_1_1.xml b/doc/generated/examples/commandline_DEFAULT_TARGETS_1_1.xml index 3f9e0fe..026ec41 100644 --- a/doc/generated/examples/commandline_DEFAULT_TARGETS_1_1.xml +++ b/doc/generated/examples/commandline_DEFAULT_TARGETS_1_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... DEFAULT_TARGETS is ['prog1'] scons: done reading SConscript files. diff --git a/doc/generated/examples/commandline_DEFAULT_TARGETS_2_1.xml b/doc/generated/examples/commandline_DEFAULT_TARGETS_2_1.xml index c51626d..d9fc38e 100644 --- a/doc/generated/examples/commandline_DEFAULT_TARGETS_2_1.xml +++ b/doc/generated/examples/commandline_DEFAULT_TARGETS_2_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... DEFAULT_TARGETS is now ['prog1'] DEFAULT_TARGETS is now ['prog1', 'prog2'] diff --git a/doc/generated/examples/commandline_Default1_1.xml b/doc/generated/examples/commandline_Default1_1.xml index 8679e25..1668e8a 100644 --- a/doc/generated/examples/commandline_Default1_1.xml +++ b/doc/generated/examples/commandline_Default1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q diff --git a/doc/generated/examples/commandline_Default1_2.xml b/doc/generated/examples/commandline_Default1_2.xml index e40c298..56b48f2 100644 --- a/doc/generated/examples/commandline_Default1_2.xml +++ b/doc/generated/examples/commandline_Default1_2.xml @@ -1,4 +1,4 @@ -% scons -Q . +% scons -Q . cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o cc -o hello.o -c hello.c diff --git a/doc/generated/examples/commandline_Default2_1.xml b/doc/generated/examples/commandline_Default2_1.xml index bb4cd0c..7ab982a 100644 --- a/doc/generated/examples/commandline_Default2_1.xml +++ b/doc/generated/examples/commandline_Default2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o prog1.o -c prog1.c cc -o prog1 prog1.o cc -o prog3.o -c prog3.c diff --git a/doc/generated/examples/commandline_Default3_1.xml b/doc/generated/examples/commandline_Default3_1.xml index de93fb6..10abdde 100644 --- a/doc/generated/examples/commandline_Default3_1.xml +++ b/doc/generated/examples/commandline_Default3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o prog1/foo.o -c prog1/foo.c cc -o prog1/main.o -c prog1/main.c cc -o prog1/main prog1/main.o prog1/foo.o diff --git a/doc/generated/examples/commandline_Default4_1.xml b/doc/generated/examples/commandline_Default4_1.xml index 3c16091..bfc82c3 100644 --- a/doc/generated/examples/commandline_Default4_1.xml +++ b/doc/generated/examples/commandline_Default4_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q scons: *** No targets specified and no Default() targets found. Stop. Found nothing to build % scons -Q . diff --git a/doc/generated/examples/commandline_EnumVariable_1.xml b/doc/generated/examples/commandline_EnumVariable_1.xml index 2178dba..d47afd4 100644 --- a/doc/generated/examples/commandline_EnumVariable_1.xml +++ b/doc/generated/examples/commandline_EnumVariable_1.xml @@ -1,4 +1,4 @@ -% scons -Q COLOR=red foo.o +% scons -Q COLOR=red foo.o cc -o foo.o -c -DCOLOR="red" foo.c % scons -Q COLOR=blue foo.o cc -o foo.o -c -DCOLOR="blue" foo.c diff --git a/doc/generated/examples/commandline_EnumVariable_2.xml b/doc/generated/examples/commandline_EnumVariable_2.xml index 65b255b..51a5462 100644 --- a/doc/generated/examples/commandline_EnumVariable_2.xml +++ b/doc/generated/examples/commandline_EnumVariable_2.xml @@ -1,4 +1,4 @@ -% scons -Q COLOR=magenta foo.o +% scons -Q COLOR=magenta foo.o scons: *** Invalid value for option COLOR: magenta. Valid values are: ('red', 'green', 'blue') File "/home/my/project/SConstruct", line 6, in <module> diff --git a/doc/generated/examples/commandline_EnumVariable_3.xml b/doc/generated/examples/commandline_EnumVariable_3.xml index eb5d3c1..154c041 100644 --- a/doc/generated/examples/commandline_EnumVariable_3.xml +++ b/doc/generated/examples/commandline_EnumVariable_3.xml @@ -1,4 +1,4 @@ -% scons -Q -h +% scons -Q -h COLOR: Set background color (red|green|blue) default: red diff --git a/doc/generated/examples/commandline_EnumVariable_4.xml b/doc/generated/examples/commandline_EnumVariable_4.xml index 7c37f72..d1aca84 100644 --- a/doc/generated/examples/commandline_EnumVariable_4.xml +++ b/doc/generated/examples/commandline_EnumVariable_4.xml @@ -1,4 +1,4 @@ -% scons -Q COLOR=Red foo.o +% scons -Q COLOR=Red foo.o scons: *** Invalid value for option COLOR: Red. Valid values are: ('red', 'green', 'blue') File "/home/my/project/SConstruct", line 6, in <module> diff --git a/doc/generated/examples/commandline_EnumVariable_ic1_1.xml b/doc/generated/examples/commandline_EnumVariable_ic1_1.xml index 33f668d..78a59b2 100644 --- a/doc/generated/examples/commandline_EnumVariable_ic1_1.xml +++ b/doc/generated/examples/commandline_EnumVariable_ic1_1.xml @@ -1,4 +1,4 @@ -% scons -Q COLOR=Red foo.o +% scons -Q COLOR=Red foo.o cc -o foo.o -c -DCOLOR="Red" foo.c % scons -Q COLOR=BLUE foo.o cc -o foo.o -c -DCOLOR="BLUE" foo.c diff --git a/doc/generated/examples/commandline_EnumVariable_ic2_1.xml b/doc/generated/examples/commandline_EnumVariable_ic2_1.xml index ef24936..0e3f165 100644 --- a/doc/generated/examples/commandline_EnumVariable_ic2_1.xml +++ b/doc/generated/examples/commandline_EnumVariable_ic2_1.xml @@ -1,4 +1,4 @@ -% scons -Q COLOR=Red foo.o +% scons -Q COLOR=Red foo.o cc -o foo.o -c -DCOLOR="red" foo.c % scons -Q COLOR=nAvY foo.o cc -o foo.o -c -DCOLOR="blue" foo.c diff --git a/doc/generated/examples/commandline_ListVariable_1.xml b/doc/generated/examples/commandline_ListVariable_1.xml index f04d1f3..1e68e02 100644 --- a/doc/generated/examples/commandline_ListVariable_1.xml +++ b/doc/generated/examples/commandline_ListVariable_1.xml @@ -1,4 +1,4 @@ -% scons -Q COLORS=red,blue foo.o +% scons -Q COLORS=red,blue foo.o cc -o foo.o -c -DCOLORS="red blue" foo.c % scons -Q COLORS=blue,green,red foo.o cc -o foo.o -c -DCOLORS="blue green red" foo.c diff --git a/doc/generated/examples/commandline_ListVariable_2.xml b/doc/generated/examples/commandline_ListVariable_2.xml index 50bc815..c31d16b 100644 --- a/doc/generated/examples/commandline_ListVariable_2.xml +++ b/doc/generated/examples/commandline_ListVariable_2.xml @@ -1,4 +1,4 @@ -% scons -Q COLORS=all foo.o +% scons -Q COLORS=all foo.o cc -o foo.o -c -DCOLORS="red green blue" foo.c % scons -Q COLORS=none foo.o cc -o foo.o -c -DCOLORS="" foo.c diff --git a/doc/generated/examples/commandline_ListVariable_3.xml b/doc/generated/examples/commandline_ListVariable_3.xml index a5e4b89..7a8c857 100644 --- a/doc/generated/examples/commandline_ListVariable_3.xml +++ b/doc/generated/examples/commandline_ListVariable_3.xml @@ -1,4 +1,4 @@ -% scons -Q COLORS=magenta foo.o +% scons -Q COLORS=magenta foo.o scons: *** Error converting option: COLORS Invalid value(s) for option: magenta diff --git a/doc/generated/examples/commandline_PackageVariable_1.xml b/doc/generated/examples/commandline_PackageVariable_1.xml index daaa696..367638f 100644 --- a/doc/generated/examples/commandline_PackageVariable_1.xml +++ b/doc/generated/examples/commandline_PackageVariable_1.xml @@ -1,4 +1,4 @@ -% scons -Q foo.o +% scons -Q foo.o cc -o foo.o -c -DPACKAGE="/opt/location" foo.c % scons -Q PACKAGE=/usr/local/location foo.o cc -o foo.o -c -DPACKAGE="/usr/local/location" foo.c diff --git a/doc/generated/examples/commandline_PathVariable_1.xml b/doc/generated/examples/commandline_PathVariable_1.xml index e995a69..474a78c 100644 --- a/doc/generated/examples/commandline_PathVariable_1.xml +++ b/doc/generated/examples/commandline_PathVariable_1.xml @@ -1,4 +1,4 @@ -% scons -Q foo.o +% scons -Q foo.o cc -o foo.o -c -DCONFIG_FILE="/etc/my_config" foo.c % scons -Q CONFIG=/usr/local/etc/other_config foo.o scons: `foo.o' is up to date. diff --git a/doc/generated/examples/commandline_PathVariable_2.xml b/doc/generated/examples/commandline_PathVariable_2.xml index 68a40cb..d2ce952 100644 --- a/doc/generated/examples/commandline_PathVariable_2.xml +++ b/doc/generated/examples/commandline_PathVariable_2.xml @@ -1,4 +1,4 @@ -% scons -Q CONFIG=/does/not/exist foo.o +% scons -Q CONFIG=/does/not/exist foo.o scons: *** Path for option CONFIG does not exist: /does/not/exist File "/home/my/project/SConstruct", line 5, in <module> diff --git a/doc/generated/examples/commandline_SCONSFLAGS_1.xml b/doc/generated/examples/commandline_SCONSFLAGS_1.xml index fc54357..733e745 100644 --- a/doc/generated/examples/commandline_SCONSFLAGS_1.xml +++ b/doc/generated/examples/commandline_SCONSFLAGS_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/commandline_SetOption_1.xml b/doc/generated/examples/commandline_SetOption_1.xml index 4aedc2e..fd56c94 100644 --- a/doc/generated/examples/commandline_SetOption_1.xml +++ b/doc/generated/examples/commandline_SetOption_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q running with -j 2 scons: `.' is up to date. diff --git a/doc/generated/examples/commandline_SetOption_2.xml b/doc/generated/examples/commandline_SetOption_2.xml index 54e214f..169fee4 100644 --- a/doc/generated/examples/commandline_SetOption_2.xml +++ b/doc/generated/examples/commandline_SetOption_2.xml @@ -1,4 +1,4 @@ -% export NUM_CPU="4" +% export NUM_CPU="4" % scons -Q running with -j 4 scons: `.' is up to date. diff --git a/doc/generated/examples/commandline_SetOption_3.xml b/doc/generated/examples/commandline_SetOption_3.xml index 2db0d62..0cb0425 100644 --- a/doc/generated/examples/commandline_SetOption_3.xml +++ b/doc/generated/examples/commandline_SetOption_3.xml @@ -1,4 +1,4 @@ -% scons -Q -j 7 +% scons -Q -j 7 running with -j 7 scons: `.' is up to date. % export NUM_CPU="4" diff --git a/doc/generated/examples/commandline_UnknownVariables_1.xml b/doc/generated/examples/commandline_UnknownVariables_1.xml index ecca75f..08c566c 100644 --- a/doc/generated/examples/commandline_UnknownVariables_1.xml +++ b/doc/generated/examples/commandline_UnknownVariables_1.xml @@ -1,3 +1,3 @@ -% scons -Q NOT_KNOWN=foo +% scons -Q NOT_KNOWN=foo Unknown variables: dict_keys(['NOT_KNOWN']) diff --git a/doc/generated/examples/commandline_Variables1_1.xml b/doc/generated/examples/commandline_Variables1_1.xml index 2b6ecf8..8deb514 100644 --- a/doc/generated/examples/commandline_Variables1_1.xml +++ b/doc/generated/examples/commandline_Variables1_1.xml @@ -1,4 +1,4 @@ -% scons -Q RELEASE=1 +% scons -Q RELEASE=1 cc -o bar.o -c -DRELEASE_BUILD=1 bar.c cc -o foo.o -c -DRELEASE_BUILD=1 foo.c cc -o foo foo.o bar.o diff --git a/doc/generated/examples/commandline_Variables_Help_1.xml b/doc/generated/examples/commandline_Variables_Help_1.xml index 9fe588e..1bbf2fb 100644 --- a/doc/generated/examples/commandline_Variables_Help_1.xml +++ b/doc/generated/examples/commandline_Variables_Help_1.xml @@ -1,4 +1,4 @@ -% scons -Q -h +% scons -Q -h RELEASE: Set to 1 to build for release default: 0 diff --git a/doc/generated/examples/commandline_Variables_custom_py_1_1.xml b/doc/generated/examples/commandline_Variables_custom_py_1_1.xml index bf31267..08a6d5f 100644 --- a/doc/generated/examples/commandline_Variables_custom_py_1_1.xml +++ b/doc/generated/examples/commandline_Variables_custom_py_1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o bar.o -c -DRELEASE_BUILD=1 bar.c cc -o foo.o -c -DRELEASE_BUILD=1 foo.c cc -o foo foo.o bar.o diff --git a/doc/generated/examples/commandline_Variables_custom_py_2_1.xml b/doc/generated/examples/commandline_Variables_custom_py_2_1.xml index fc07260..4ea99cd 100644 --- a/doc/generated/examples/commandline_Variables_custom_py_2_1.xml +++ b/doc/generated/examples/commandline_Variables_custom_py_2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o bar.o -c -DRELEASE_BUILD=0 bar.c cc -o foo.o -c -DRELEASE_BUILD=0 foo.c cc -o foo foo.o bar.o diff --git a/doc/generated/examples/depends_AlwaysBuild_1.xml b/doc/generated/examples/depends_AlwaysBuild_1.xml index e8bafae..8b24188 100644 --- a/doc/generated/examples/depends_AlwaysBuild_1.xml +++ b/doc/generated/examples/depends_AlwaysBuild_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q diff --git a/doc/generated/examples/depends_AlwaysBuild_2.xml b/doc/generated/examples/depends_AlwaysBuild_2.xml index 501ffa1..704b497 100644 --- a/doc/generated/examples/depends_AlwaysBuild_2.xml +++ b/doc/generated/examples/depends_AlwaysBuild_2.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello.o diff --git a/doc/generated/examples/depends_Requires_1.xml b/doc/generated/examples/depends_Requires_1.xml index 0a07c01..e5a7b99 100644 --- a/doc/generated/examples/depends_Requires_1.xml +++ b/doc/generated/examples/depends_Requires_1.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o version.o -c version.c cc -o hello.o -c hello.c cc -o hello version.o hello.o diff --git a/doc/generated/examples/depends_ex1_1.xml b/doc/generated/examples/depends_ex1_1.xml index 1a94afc..6af2e3f 100644 --- a/doc/generated/examples/depends_ex1_1.xml +++ b/doc/generated/examples/depends_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q diff --git a/doc/generated/examples/depends_ex1_2.xml b/doc/generated/examples/depends_ex1_2.xml index 0fd2024..1080c5a 100644 --- a/doc/generated/examples/depends_ex1_2.xml +++ b/doc/generated/examples/depends_ex1_2.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello diff --git a/doc/generated/examples/depends_ex1_3.xml b/doc/generated/examples/depends_ex1_3.xml index 6bfba52..b17a545 100644 --- a/doc/generated/examples/depends_ex1_3.xml +++ b/doc/generated/examples/depends_ex1_3.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % touch hello.c diff --git a/doc/generated/examples/depends_ex1_4.xml b/doc/generated/examples/depends_ex1_4.xml index bae5bd7..0d2a5a9 100644 --- a/doc/generated/examples/depends_ex1_4.xml +++ b/doc/generated/examples/depends_ex1_4.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % [CHANGE THE CONTENTS OF hello.c] diff --git a/doc/generated/examples/depends_ex1_5.xml b/doc/generated/examples/depends_ex1_5.xml index 358bf5b..a45178d 100644 --- a/doc/generated/examples/depends_ex1_5.xml +++ b/doc/generated/examples/depends_ex1_5.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o hello.o -c hello.c cc -o hello hello.o % [CHANGE A COMMENT IN hello.c] diff --git a/doc/generated/examples/depends_ex1_6.xml b/doc/generated/examples/depends_ex1_6.xml index 8461234..a588f13 100644 --- a/doc/generated/examples/depends_ex1_6.xml +++ b/doc/generated/examples/depends_ex1_6.xml @@ -1,4 +1,4 @@ -% scons -Q --implicit-cache hello +% scons -Q --implicit-cache hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello diff --git a/doc/generated/examples/depends_ex1_7.xml b/doc/generated/examples/depends_ex1_7.xml index ea9088a..b44c8a4 100644 --- a/doc/generated/examples/depends_ex1_7.xml +++ b/doc/generated/examples/depends_ex1_7.xml @@ -1,4 +1,4 @@ -% scons -Q --implicit-deps-changed hello +% scons -Q --implicit-deps-changed hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello diff --git a/doc/generated/examples/depends_ex1_8.xml b/doc/generated/examples/depends_ex1_8.xml index cc4ee6c..10088a6 100644 --- a/doc/generated/examples/depends_ex1_8.xml +++ b/doc/generated/examples/depends_ex1_8.xml @@ -1,4 +1,4 @@ -% scons -Q --implicit-deps-unchanged hello +% scons -Q --implicit-deps-unchanged hello cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello diff --git a/doc/generated/examples/depends_ex5_1.xml b/doc/generated/examples/depends_ex5_1.xml index 37985df..e8d4fa7 100644 --- a/doc/generated/examples/depends_ex5_1.xml +++ b/doc/generated/examples/depends_ex5_1.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o hello.o -c -Iinclude -I/home/project/inc hello.c cc -o hello hello.o diff --git a/doc/generated/examples/depends_ex5_2.xml b/doc/generated/examples/depends_ex5_2.xml index 460d135..629e437 100644 --- a/doc/generated/examples/depends_ex5_2.xml +++ b/doc/generated/examples/depends_ex5_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q hello.exe +C:\>scons -Q hello.exe cl /Fohello.obj /c hello.c /nologo /Iinclude /I\home\project\inc link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) diff --git a/doc/generated/examples/depends_ignore_explicit_1.xml b/doc/generated/examples/depends_ignore_explicit_1.xml index 79ebca2..374520f 100644 --- a/doc/generated/examples/depends_ignore_explicit_1.xml +++ b/doc/generated/examples/depends_ignore_explicit_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q scons: `.' is up to date. % scons -Q hello cc -o hello.o -c hello.c diff --git a/doc/generated/examples/depends_include_1.xml b/doc/generated/examples/depends_include_1.xml index 987fead..7aa0295 100644 --- a/doc/generated/examples/depends_include_1.xml +++ b/doc/generated/examples/depends_include_1.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o hello.o -c -I. hello.c cc -o hello hello.o % scons -Q hello diff --git a/doc/generated/examples/depends_macroinc_1.xml b/doc/generated/examples/depends_macroinc_1.xml index d15f4ef..0fa157a 100644 --- a/doc/generated/examples/depends_macroinc_1.xml +++ b/doc/generated/examples/depends_macroinc_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c -I. hello.c cc -o hello hello.o % [CHANGE CONTENTS OF foo.h] diff --git a/doc/generated/examples/depends_match_1.xml b/doc/generated/examples/depends_match_1.xml index cde65ca..2433793 100644 --- a/doc/generated/examples/depends_match_1.xml +++ b/doc/generated/examples/depends_match_1.xml @@ -1,4 +1,4 @@ -% scons -Q hello.o +% scons -Q hello.o cc -o hello.o -c hello.c % touch -t 198901010000 hello.c % scons -Q hello.o diff --git a/doc/generated/examples/depends_mixing_1.xml b/doc/generated/examples/depends_mixing_1.xml index 30d2527..64511e0 100644 --- a/doc/generated/examples/depends_mixing_1.xml +++ b/doc/generated/examples/depends_mixing_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o program1.o -c -I. program1.c cc -o prog-MD5 program1.o cc -o program2.o -c -I. program2.c diff --git a/doc/generated/examples/depends_newer_1.xml b/doc/generated/examples/depends_newer_1.xml index b09d0d6..d156d8d 100644 --- a/doc/generated/examples/depends_newer_1.xml +++ b/doc/generated/examples/depends_newer_1.xml @@ -1,4 +1,4 @@ -% scons -Q hello.o +% scons -Q hello.o cc -o hello.o -c hello.c % touch hello.c % scons -Q hello.o diff --git a/doc/generated/examples/depends_no-Requires_1.xml b/doc/generated/examples/depends_no-Requires_1.xml index 8be3285..6be9314 100644 --- a/doc/generated/examples/depends_no-Requires_1.xml +++ b/doc/generated/examples/depends_no-Requires_1.xml @@ -1,4 +1,4 @@ -% scons -Q hello +% scons -Q hello cc -o hello.o -c hello.c cc -o version.o -c version.c cc -o hello hello.o version.o diff --git a/doc/generated/examples/depends_parsedep_1.xml b/doc/generated/examples/depends_parsedep_1.xml index e83eccf..a4a8860 100644 --- a/doc/generated/examples/depends_parsedep_1.xml +++ b/doc/generated/examples/depends_parsedep_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c -MD -MF hello.d -I. hello.c cc -o hello hello.o % [CHANGE CONTENTS OF foo.h] diff --git a/doc/generated/examples/environments_Append-nonexistent_1.xml b/doc/generated/examples/environments_Append-nonexistent_1.xml index 43b6834..7a2e52e 100644 --- a/doc/generated/examples/environments_Append-nonexistent_1.xml +++ b/doc/generated/examples/environments_Append-nonexistent_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q NEW_VARIABLE = added scons: `.' is up to date. diff --git a/doc/generated/examples/environments_Prepend-nonexistent_1.xml b/doc/generated/examples/environments_Prepend-nonexistent_1.xml index 43b6834..7a2e52e 100644 --- a/doc/generated/examples/environments_Prepend-nonexistent_1.xml +++ b/doc/generated/examples/environments_Prepend-nonexistent_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q NEW_VARIABLE = added scons: `.' is up to date. diff --git a/doc/generated/examples/environments_Replace-nonexistent_1.xml b/doc/generated/examples/environments_Replace-nonexistent_1.xml index 2aba4c8..ba79d3a 100644 --- a/doc/generated/examples/environments_Replace-nonexistent_1.xml +++ b/doc/generated/examples/environments_Replace-nonexistent_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q NEW_VARIABLE = xyzzy scons: `.' is up to date. diff --git a/doc/generated/examples/environments_Replace1_1.xml b/doc/generated/examples/environments_Replace1_1.xml index 6fedc45..eb3803f 100644 --- a/doc/generated/examples/environments_Replace1_1.xml +++ b/doc/generated/examples/environments_Replace1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o foo.o -c -DDEFINE2 foo.c cc -o foo foo.o diff --git a/doc/generated/examples/environments_Replace2_1.xml b/doc/generated/examples/environments_Replace2_1.xml index 61027c8..ebd7dea 100644 --- a/doc/generated/examples/environments_Replace2_1.xml +++ b/doc/generated/examples/environments_Replace2_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... CCFLAGS = -DDEFINE1 CCFLAGS = -DDEFINE2 diff --git a/doc/generated/examples/environments_ex1_1.xml b/doc/generated/examples/environments_ex1_1.xml index 1c4da07..cff55c0 100644 --- a/doc/generated/examples/environments_ex1_1.xml +++ b/doc/generated/examples/environments_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q gcc -o foo.o -c -O2 foo.c gcc -o foo foo.o diff --git a/doc/generated/examples/environments_ex2_1.xml b/doc/generated/examples/environments_ex2_1.xml index acab07b..2b94ca7 100644 --- a/doc/generated/examples/environments_ex2_1.xml +++ b/doc/generated/examples/environments_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o bar.o -c -g bar.c cc -o bar bar.o cc -o foo.o -c -O2 foo.c diff --git a/doc/generated/examples/environments_ex3_1.xml b/doc/generated/examples/environments_ex3_1.xml index 1c7bce9..9df0b28 100644 --- a/doc/generated/examples/environments_ex3_1.xml +++ b/doc/generated/examples/environments_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q scons: *** Two environments with different actions were specified for the same target: foo.o File "/home/my/project/SConstruct", line 6, in <module> diff --git a/doc/generated/examples/environments_ex4_1.xml b/doc/generated/examples/environments_ex4_1.xml index 4eda402..78e2782 100644 --- a/doc/generated/examples/environments_ex4_1.xml +++ b/doc/generated/examples/environments_ex4_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o foo-dbg.o -c -g foo.c cc -o foo-dbg foo-dbg.o cc -o foo-opt.o -c -O2 foo.c diff --git a/doc/generated/examples/environments_ex5_1.xml b/doc/generated/examples/environments_ex5_1.xml index 7316a6c..a45a009 100644 --- a/doc/generated/examples/environments_ex5_1.xml +++ b/doc/generated/examples/environments_ex5_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q gcc -o foo.o -c foo.c gcc -o foo foo.o gcc -o foo-dbg.o -c -g foo.c diff --git a/doc/generated/examples/environments_ex6_1.xml b/doc/generated/examples/environments_ex6_1.xml index f6aa4b6..03a5e7c 100644 --- a/doc/generated/examples/environments_ex6_1.xml +++ b/doc/generated/examples/environments_ex6_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q CC is: cc scons: `.' is up to date. diff --git a/doc/generated/examples/environments_ex6b_1.xml b/doc/generated/examples/environments_ex6b_1.xml index 0da8d90..5542a51 100644 --- a/doc/generated/examples/environments_ex6b_1.xml +++ b/doc/generated/examples/environments_ex6b_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q key = OBJSUFFIX, value = .o key = LIBSUFFIX, value = .a key = PROGSUFFIX, value = diff --git a/doc/generated/examples/environments_ex6b_2.xml b/doc/generated/examples/environments_ex6b_2.xml index d0f20e9..6264e8a 100644 --- a/doc/generated/examples/environments_ex6b_2.xml +++ b/doc/generated/examples/environments_ex6b_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q key = OBJSUFFIX, value = .obj key = LIBSUFFIX, value = .lib key = PROGSUFFIX, value = .exe diff --git a/doc/generated/examples/environments_ex8_1.xml b/doc/generated/examples/environments_ex8_1.xml index fe3b464..e496088 100644 --- a/doc/generated/examples/environments_ex8_1.xml +++ b/doc/generated/examples/environments_ex8_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o foo.o -c -DMY_VALUE -DLAST foo.c cc -o foo foo.o diff --git a/doc/generated/examples/environments_ex9_1.xml b/doc/generated/examples/environments_ex9_1.xml index 4d7bfd8..e83a2a6 100644 --- a/doc/generated/examples/environments_ex9_1.xml +++ b/doc/generated/examples/environments_ex9_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o foo.o -c -DFIRST -DMY_VALUE foo.c cc -o foo foo.o diff --git a/doc/generated/examples/environments_missing1_1.xml b/doc/generated/examples/environments_missing1_1.xml index 56b0ff5..73252e3 100644 --- a/doc/generated/examples/environments_missing1_1.xml +++ b/doc/generated/examples/environments_missing1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q value is: -><- scons: `.' is up to date. diff --git a/doc/generated/examples/environments_missing2_1.xml b/doc/generated/examples/environments_missing2_1.xml index 5a11ede..ad0339d 100644 --- a/doc/generated/examples/environments_missing2_1.xml +++ b/doc/generated/examples/environments_missing2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q scons: *** NameError `name 'MISSING' is not defined' trying to evaluate `$MISSING' File "/home/my/project/SConstruct", line 3, in <module> diff --git a/doc/generated/examples/environments_missing3_1.xml b/doc/generated/examples/environments_missing3_1.xml index 56b0ff5..73252e3 100644 --- a/doc/generated/examples/environments_missing3_1.xml +++ b/doc/generated/examples/environments_missing3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q value is: -><- scons: `.' is up to date. diff --git a/doc/generated/examples/factories_Chmod_1.xml b/doc/generated/examples/factories_Chmod_1.xml index 04e543c..652fa38 100644 --- a/doc/generated/examples/factories_Chmod_1.xml +++ b/doc/generated/examples/factories_Chmod_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Copy("file.out", "file.in") Chmod("file.out", 0755) diff --git a/doc/generated/examples/factories_Copy1_1.xml b/doc/generated/examples/factories_Copy1_1.xml index 02941a2..db7839d 100644 --- a/doc/generated/examples/factories_Copy1_1.xml +++ b/doc/generated/examples/factories_Copy1_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q Copy("file.out", "file.in") diff --git a/doc/generated/examples/factories_Copy2_1.xml b/doc/generated/examples/factories_Copy2_1.xml index 02941a2..db7839d 100644 --- a/doc/generated/examples/factories_Copy2_1.xml +++ b/doc/generated/examples/factories_Copy2_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q Copy("file.out", "file.in") diff --git a/doc/generated/examples/factories_Copy3_1.xml b/doc/generated/examples/factories_Copy3_1.xml index 224ec79..a673942 100644 --- a/doc/generated/examples/factories_Copy3_1.xml +++ b/doc/generated/examples/factories_Copy3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Copy("tempfile", "file.in") modify tempfile Copy("file.out", "tempfile") diff --git a/doc/generated/examples/factories_Delete1_1.xml b/doc/generated/examples/factories_Delete1_1.xml index 22b5070..da9f17d 100644 --- a/doc/generated/examples/factories_Delete1_1.xml +++ b/doc/generated/examples/factories_Delete1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Delete("tempfile") Copy("tempfile", "file.in") modify tempfile diff --git a/doc/generated/examples/factories_Delete2_1.xml b/doc/generated/examples/factories_Delete2_1.xml index 109ed2c..0689efd 100644 --- a/doc/generated/examples/factories_Delete2_1.xml +++ b/doc/generated/examples/factories_Delete2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Delete("file.out") Copy("file.out", "file.in") diff --git a/doc/generated/examples/factories_Execute_1.xml b/doc/generated/examples/factories_Execute_1.xml index 0481396..091f3ef 100644 --- a/doc/generated/examples/factories_Execute_1.xml +++ b/doc/generated/examples/factories_Execute_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... Mkdir("/tmp/my_temp_directory") scons: done reading SConscript files. diff --git a/doc/generated/examples/factories_Mkdir_1.xml b/doc/generated/examples/factories_Mkdir_1.xml index 37c601d..5059cca 100644 --- a/doc/generated/examples/factories_Mkdir_1.xml +++ b/doc/generated/examples/factories_Mkdir_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Delete("tempdir") Mkdir("tempdir") Copy("tempdir/file.in", "file.in") diff --git a/doc/generated/examples/factories_Move_1.xml b/doc/generated/examples/factories_Move_1.xml index a49ecef..7dce99d 100644 --- a/doc/generated/examples/factories_Move_1.xml +++ b/doc/generated/examples/factories_Move_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Copy("tempfile", "file.in") modify tempfile Move("file.out", "tempfile") diff --git a/doc/generated/examples/factories_Touch_1.xml b/doc/generated/examples/factories_Touch_1.xml index dbc256a..5505bb8 100644 --- a/doc/generated/examples/factories_Touch_1.xml +++ b/doc/generated/examples/factories_Touch_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Copy("file.out", "file.in") Touch("file.out") diff --git a/doc/generated/examples/fileremoval_clean-ex1_1.xml b/doc/generated/examples/fileremoval_clean-ex1_1.xml index 0d79060..278adc5 100644 --- a/doc/generated/examples/fileremoval_clean-ex1_1.xml +++ b/doc/generated/examples/fileremoval_clean-ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q build -o foo.out foo.in % scons -Q -c Removed foo.out diff --git a/doc/generated/examples/fileremoval_noclean-ex1_1.xml b/doc/generated/examples/fileremoval_noclean-ex1_1.xml index bf5e42f..b0ab6d6 100644 --- a/doc/generated/examples/fileremoval_noclean-ex1_1.xml +++ b/doc/generated/examples/fileremoval_noclean-ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c diff --git a/doc/generated/examples/fileremoval_precious-ex1_1.xml b/doc/generated/examples/fileremoval_precious-ex1_1.xml index 232703f..fdab0f7 100644 --- a/doc/generated/examples/fileremoval_precious-ex1_1.xml +++ b/doc/generated/examples/fileremoval_precious-ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c diff --git a/doc/generated/examples/hierarchy_Return_1.xml b/doc/generated/examples/hierarchy_Return_1.xml index 417780f..97f1df0 100644 --- a/doc/generated/examples/hierarchy_Return_1.xml +++ b/doc/generated/examples/hierarchy_Return_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o bar/bar.o -c bar/bar.c cc -o foo/foo.o -c foo/foo.c ar rc libprog.a foo/foo.o bar/bar.o diff --git a/doc/generated/examples/hierarchy_ex1_1.xml b/doc/generated/examples/hierarchy_ex1_1.xml index c043c4b..aef88ab 100644 --- a/doc/generated/examples/hierarchy_ex1_1.xml +++ b/doc/generated/examples/hierarchy_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o prog1/foo1.o -c prog1/foo1.c cc -o prog1/foo2.o -c prog1/foo2.c cc -o prog1/main.o -c prog1/main.c diff --git a/doc/generated/examples/hierarchy_ex2_1.xml b/doc/generated/examples/hierarchy_ex2_1.xml index c6c7401..3d0c04a 100644 --- a/doc/generated/examples/hierarchy_ex2_1.xml +++ b/doc/generated/examples/hierarchy_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o lib/foo1.o -c lib/foo1.c cc -o src/prog/foo2.o -c src/prog/foo2.c cc -o src/prog/main.o -c src/prog/main.c diff --git a/doc/generated/examples/hierarchy_ex3_1.xml b/doc/generated/examples/hierarchy_ex3_1.xml index 8c13ee3..3b207b1 100644 --- a/doc/generated/examples/hierarchy_ex3_1.xml +++ b/doc/generated/examples/hierarchy_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o src/prog/foo2.o -c src/prog/foo2.c cc -o src/prog/main.o -c src/prog/main.c cc -o /usr/joe/lib/foo1.o -c /usr/joe/lib/foo1.c diff --git a/doc/generated/examples/install_ex1_1.xml b/doc/generated/examples/install_ex1_1.xml index 30613e2..190ec14 100644 --- a/doc/generated/examples/install_ex1_1.xml +++ b/doc/generated/examples/install_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q /usr/bin diff --git a/doc/generated/examples/install_ex2_1.xml b/doc/generated/examples/install_ex2_1.xml index 2354878..04e3b81 100644 --- a/doc/generated/examples/install_ex2_1.xml +++ b/doc/generated/examples/install_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q install diff --git a/doc/generated/examples/install_ex3_1.xml b/doc/generated/examples/install_ex3_1.xml index 0396853..36c1def 100644 --- a/doc/generated/examples/install_ex3_1.xml +++ b/doc/generated/examples/install_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q install +% scons -Q install cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o Install file: "goodbye" as "/usr/bin/goodbye" diff --git a/doc/generated/examples/install_ex4_1.xml b/doc/generated/examples/install_ex4_1.xml index 1bbbf65..cbd9af6 100644 --- a/doc/generated/examples/install_ex4_1.xml +++ b/doc/generated/examples/install_ex4_1.xml @@ -1,4 +1,4 @@ -% scons -Q install +% scons -Q install cc -o hello.o -c hello.c cc -o hello hello.o Install file: "hello" as "/usr/bin/hello-new" diff --git a/doc/generated/examples/install_ex5_1.xml b/doc/generated/examples/install_ex5_1.xml index 22c6b01..9d01fb5 100644 --- a/doc/generated/examples/install_ex5_1.xml +++ b/doc/generated/examples/install_ex5_1.xml @@ -1,4 +1,4 @@ -% scons -Q install +% scons -Q install cc -o goodbye.o -c goodbye.c cc -o goodbye goodbye.o Install file: "goodbye" as "/usr/bin/goodbye-new" diff --git a/doc/generated/examples/java_JAVACLASSDIR_1.xml b/doc/generated/examples/java_JAVACLASSDIR_1.xml index 75e5f95..f8dac59 100644 --- a/doc/generated/examples/java_JAVACLASSDIR_1.xml +++ b/doc/generated/examples/java_JAVACLASSDIR_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 diff --git a/doc/generated/examples/java_RMIC_1.xml b/doc/generated/examples/java_RMIC_1.xml index 16297dc..6e9b604 100644 --- a/doc/generated/examples/java_RMIC_1.xml +++ b/doc/generated/examples/java_RMIC_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java rmic -d outdir -classpath classes pkg.sub.Example1 pkg.sub.Example2 diff --git a/doc/generated/examples/java_jar1_1.xml b/doc/generated/examples/java_jar1_1.xml index a88c00a..9d16cb6 100644 --- a/doc/generated/examples/java_jar1_1.xml +++ b/doc/generated/examples/java_jar1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java jar cf test.jar classes diff --git a/doc/generated/examples/java_jar2_1.xml b/doc/generated/examples/java_jar2_1.xml index c696fbd..5b708aa 100644 --- a/doc/generated/examples/java_jar2_1.xml +++ b/doc/generated/examples/java_jar2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath prog1 prog1/Example1.java prog1/Example2.java javac -d classes -sourcepath prog2 prog2/Example3.java prog2/Example4.java jar cf prog1.jar -C classes Example1.class -C classes Example2.class diff --git a/doc/generated/examples/java_java-classes_1.xml b/doc/generated/examples/java_java-classes_1.xml index ce3c9ef..da17990 100644 --- a/doc/generated/examples/java_java-classes_1.xml +++ b/doc/generated/examples/java_java-classes_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java % scons -Q classes scons: `classes' is up to date. diff --git a/doc/generated/examples/java_java-classes_2.xml b/doc/generated/examples/java_java-classes_2.xml index b773402..704fb0c 100644 --- a/doc/generated/examples/java_java-classes_2.xml +++ b/doc/generated/examples/java_java-classes_2.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java % scons -Q -c classes Removed classes/Example1.class diff --git a/doc/generated/examples/java_java_1.xml b/doc/generated/examples/java_java_1.xml index 13078eb..12ce5cb 100644 --- a/doc/generated/examples/java_java_1.xml +++ b/doc/generated/examples/java_java_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java diff --git a/doc/generated/examples/java_javah_1.xml b/doc/generated/examples/java_javah_1.xml index 75e5f95..f8dac59 100644 --- a/doc/generated/examples/java_javah_1.xml +++ b/doc/generated/examples/java_javah_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 diff --git a/doc/generated/examples/java_javah_file_1.xml b/doc/generated/examples/java_javah_file_1.xml index 018a964..da1c130 100644 --- a/doc/generated/examples/java_javah_file_1.xml +++ b/doc/generated/examples/java_javah_file_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java javah -o native.h -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 diff --git a/doc/generated/examples/lesssimple_ex2_1.xml b/doc/generated/examples/lesssimple_ex2_1.xml index d643101..896fb9f 100644 --- a/doc/generated/examples/lesssimple_ex2_1.xml +++ b/doc/generated/examples/lesssimple_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c cc -o prog.o -c prog.c diff --git a/doc/generated/examples/lesssimple_ex3_1.xml b/doc/generated/examples/lesssimple_ex3_1.xml index 5ff2046..c332d88 100644 --- a/doc/generated/examples/lesssimple_ex3_1.xml +++ b/doc/generated/examples/lesssimple_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c cc -o prog.o -c prog.c diff --git a/doc/generated/examples/lesssimple_ex3_2.xml b/doc/generated/examples/lesssimple_ex3_2.xml index 753bf7f..41cf06c 100644 --- a/doc/generated/examples/lesssimple_ex3_2.xml +++ b/doc/generated/examples/lesssimple_ex3_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fofile1.obj /c file1.c /nologo cl /Fofile2.obj /c file2.c /nologo cl /Foprog.obj /c prog.c /nologo diff --git a/doc/generated/examples/lesssimple_ex4_1.xml b/doc/generated/examples/lesssimple_ex4_1.xml index 26d6167..d373f8d 100644 --- a/doc/generated/examples/lesssimple_ex4_1.xml +++ b/doc/generated/examples/lesssimple_ex4_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o bar1.o -c bar1.c cc -o bar2.o -c bar2.c cc -o bar bar1.o bar2.o diff --git a/doc/generated/examples/lesssimple_ex5_1.xml b/doc/generated/examples/lesssimple_ex5_1.xml index ea9e0e5..57bfbf3 100644 --- a/doc/generated/examples/lesssimple_ex5_1.xml +++ b/doc/generated/examples/lesssimple_ex5_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o bar1.o -c bar1.c cc -o bar2.o -c bar2.c cc -o common1.o -c common1.c diff --git a/doc/generated/examples/lesssimple_target_1.xml b/doc/generated/examples/lesssimple_target_1.xml index 6280522..a6d5179 100644 --- a/doc/generated/examples/lesssimple_target_1.xml +++ b/doc/generated/examples/lesssimple_target_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o new_hello hello.o diff --git a/doc/generated/examples/lesssimple_target_2.xml b/doc/generated/examples/lesssimple_target_2.xml index a438d35..f9f8747 100644 --- a/doc/generated/examples/lesssimple_target_2.xml +++ b/doc/generated/examples/lesssimple_target_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:new_hello.exe hello.obj embedManifestExeCheck(target, source, env) diff --git a/doc/generated/examples/libraries_SharedLibrary_1.xml b/doc/generated/examples/libraries_SharedLibrary_1.xml index ed11d19..dfbcf96 100644 --- a/doc/generated/examples/libraries_SharedLibrary_1.xml +++ b/doc/generated/examples/libraries_SharedLibrary_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o f1.os -c f1.c cc -o f2.os -c f2.c cc -o f3.os -c f3.c diff --git a/doc/generated/examples/libraries_SharedLibrary_2.xml b/doc/generated/examples/libraries_SharedLibrary_2.xml index 7b752d7..eaac4c5 100644 --- a/doc/generated/examples/libraries_SharedLibrary_2.xml +++ b/doc/generated/examples/libraries_SharedLibrary_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fof1.obj /c f1.c /nologo cl /Fof2.obj /c f2.c /nologo cl /Fof3.obj /c f3.c /nologo diff --git a/doc/generated/examples/libraries_ex1_1.xml b/doc/generated/examples/libraries_ex1_1.xml index 4a14b5b..e0e5eb1 100644 --- a/doc/generated/examples/libraries_ex1_1.xml +++ b/doc/generated/examples/libraries_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c diff --git a/doc/generated/examples/libraries_ex1_2.xml b/doc/generated/examples/libraries_ex1_2.xml index 75c4186..90f7847 100644 --- a/doc/generated/examples/libraries_ex1_2.xml +++ b/doc/generated/examples/libraries_ex1_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fof1.obj /c f1.c /nologo cl /Fof2.obj /c f2.c /nologo cl /Fof3.obj /c f3.c /nologo diff --git a/doc/generated/examples/libraries_ex2_1.xml b/doc/generated/examples/libraries_ex2_1.xml index c59edf4..81b5a67 100644 --- a/doc/generated/examples/libraries_ex2_1.xml +++ b/doc/generated/examples/libraries_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o f1.o -c f1.c cc -o f2.o -c f2.c cc -o f3.o -c f3.c diff --git a/doc/generated/examples/libraries_ex2_2.xml b/doc/generated/examples/libraries_ex2_2.xml index f590dc8..1748672 100644 --- a/doc/generated/examples/libraries_ex2_2.xml +++ b/doc/generated/examples/libraries_ex2_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fof1.obj /c f1.c /nologo cl /Fof2.obj /c f2.c /nologo cl /Fof3.obj /c f3.c /nologo diff --git a/doc/generated/examples/libraries_ex3_1.xml b/doc/generated/examples/libraries_ex3_1.xml index f5fd4c8..0a82d50 100644 --- a/doc/generated/examples/libraries_ex3_1.xml +++ b/doc/generated/examples/libraries_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o prog.o -c prog.c cc -o prog prog.o -L/usr/lib -L/usr/local/lib -lm diff --git a/doc/generated/examples/libraries_ex3_2.xml b/doc/generated/examples/libraries_ex3_2.xml index 433f7fb..bc17453 100644 --- a/doc/generated/examples/libraries_ex3_2.xml +++ b/doc/generated/examples/libraries_ex3_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Foprog.obj /c prog.c /nologo link /nologo /OUT:prog.exe /LIBPATH:\usr\lib /LIBPATH:\usr\local\lib m.lib prog.obj embedManifestExeCheck(target, source, env) diff --git a/doc/generated/examples/libraries_objects_1.xml b/doc/generated/examples/libraries_objects_1.xml index db5d88c..717bfd2 100644 --- a/doc/generated/examples/libraries_objects_1.xml +++ b/doc/generated/examples/libraries_objects_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o f1.o -c f1.c cc -o f3.o -c f3.c ar rc libfoo.a f1.o f2.o f3.o f4.o diff --git a/doc/generated/examples/mergeflags_MergeFlags1_1.xml b/doc/generated/examples/mergeflags_MergeFlags1_1.xml index fafefd4..5985ec2 100644 --- a/doc/generated/examples/mergeflags_MergeFlags1_1.xml +++ b/doc/generated/examples/mergeflags_MergeFlags1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q ['-option', '-O1', '-whatever', '-O3'] scons: `.' is up to date. diff --git a/doc/generated/examples/mergeflags_MergeFlags2_1.xml b/doc/generated/examples/mergeflags_MergeFlags2_1.xml index 017158a..3ff1e5d 100644 --- a/doc/generated/examples/mergeflags_MergeFlags2_1.xml +++ b/doc/generated/examples/mergeflags_MergeFlags2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q ['/include', '/usr/local/include', '/usr/include', '/usr/opt/include'] scons: `.' is up to date. diff --git a/doc/generated/examples/mergeflags_MergeFlags3_1.xml b/doc/generated/examples/mergeflags_MergeFlags3_1.xml index 2173cf3..d0af8e2 100644 --- a/doc/generated/examples/mergeflags_MergeFlags3_1.xml +++ b/doc/generated/examples/mergeflags_MergeFlags3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q ['-option', '-O1', '-whatever', '-O3'] ['/include', '/usr/local/include', '/usr/include', '/usr/opt/include'] scons: `.' is up to date. diff --git a/doc/generated/examples/misc_Exit_1.xml b/doc/generated/examples/misc_Exit_1.xml index 5a5e411..f0f31b0 100644 --- a/doc/generated/examples/misc_Exit_1.xml +++ b/doc/generated/examples/misc_Exit_1.xml @@ -1,4 +1,4 @@ -% scons -Q FUTURE=1 +% scons -Q FUTURE=1 The FUTURE option is not supported yet! % scons -Q cc -o hello.o -c hello.c diff --git a/doc/generated/examples/misc_FindFile1a_1.xml b/doc/generated/examples/misc_FindFile1a_1.xml index efa6b7c..800cbc6 100644 --- a/doc/generated/examples/misc_FindFile1a_1.xml +++ b/doc/generated/examples/misc_FindFile1a_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q None <class 'SCons.Node.FS.File'> exists scons: `.' is up to date. diff --git a/doc/generated/examples/misc_FindFile1b_1.xml b/doc/generated/examples/misc_FindFile1b_1.xml index 2ab6acb..6d568cd 100644 --- a/doc/generated/examples/misc_FindFile1b_1.xml +++ b/doc/generated/examples/misc_FindFile1b_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q nonesuch.h : None config.h : config.h private.h : src/include/private.h diff --git a/doc/generated/examples/misc_FindFile1d_1.xml b/doc/generated/examples/misc_FindFile1d_1.xml index 3312c42..4e4f0c2 100644 --- a/doc/generated/examples/misc_FindFile1d_1.xml +++ b/doc/generated/examples/misc_FindFile1d_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q sub1/multiple sub2/multiple sub3/multiple diff --git a/doc/generated/examples/misc_FindFile2_1.xml b/doc/generated/examples/misc_FindFile2_1.xml index 7302968..318c7b7 100644 --- a/doc/generated/examples/misc_FindFile2_1.xml +++ b/doc/generated/examples/misc_FindFile2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q leaf derived cat > derived leaf diff --git a/doc/generated/examples/misc_FindFile2_2.xml b/doc/generated/examples/misc_FindFile2_2.xml index 7302968..318c7b7 100644 --- a/doc/generated/examples/misc_FindFile2_2.xml +++ b/doc/generated/examples/misc_FindFile2_2.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q leaf derived cat > derived leaf diff --git a/doc/generated/examples/misc_FindFile3_1.xml b/doc/generated/examples/misc_FindFile3_1.xml index 69cfacf..e27b288 100644 --- a/doc/generated/examples/misc_FindFile3_1.xml +++ b/doc/generated/examples/misc_FindFile3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q build/leaf scons: `.' is up to date. diff --git a/doc/generated/examples/misc_Flatten1_1.xml b/doc/generated/examples/misc_Flatten1_1.xml index db574ed..c7c8412 100644 --- a/doc/generated/examples/misc_Flatten1_1.xml +++ b/doc/generated/examples/misc_Flatten1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o prog1.o -c prog1.c cc -o prog2.o -c -DFOO prog2.c cc -o prog1 prog1.o prog2.o diff --git a/doc/generated/examples/misc_Flatten2_1.xml b/doc/generated/examples/misc_Flatten2_1.xml index 06b99c3..fa74445 100644 --- a/doc/generated/examples/misc_Flatten2_1.xml +++ b/doc/generated/examples/misc_Flatten2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q AttributeError: 'NodeList' object has no attribute 'abspath': File "/home/my/project/SConstruct", line 8: print(object_file.abspath) diff --git a/doc/generated/examples/nodes_GetBuildPath_1.xml b/doc/generated/examples/nodes_GetBuildPath_1.xml index 50543ab..24f8184 100644 --- a/doc/generated/examples/nodes_GetBuildPath_1.xml +++ b/doc/generated/examples/nodes_GetBuildPath_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q ['foo.c', 'sub/dir/value'] scons: `.' is up to date. diff --git a/doc/generated/examples/nodes_ex1_1.xml b/doc/generated/examples/nodes_ex1_1.xml index f05281f..4235447 100644 --- a/doc/generated/examples/nodes_ex1_1.xml +++ b/doc/generated/examples/nodes_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o goodbye.o -c -DGOODBYE goodbye.c cc -o hello.o -c -DHELLO hello.c cc -o hello hello.o goodbye.o diff --git a/doc/generated/examples/nodes_ex1_2.xml b/doc/generated/examples/nodes_ex1_2.xml index 3648775..3c6a185 100644 --- a/doc/generated/examples/nodes_ex1_2.xml +++ b/doc/generated/examples/nodes_ex1_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fogoodbye.obj /c goodbye.c -DGOODBYE cl /Fohello.obj /c hello.c -DHELLO link /nologo /OUT:hello.exe hello.obj goodbye.obj diff --git a/doc/generated/examples/nodes_exists_1.xml b/doc/generated/examples/nodes_exists_1.xml index f9abc43..8fc7dd5 100644 --- a/doc/generated/examples/nodes_exists_1.xml +++ b/doc/generated/examples/nodes_exists_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q hello does not exist! cc -o hello.o -c hello.c cc -o hello hello.o diff --git a/doc/generated/examples/nodes_print_1.xml b/doc/generated/examples/nodes_print_1.xml index 0d07e97..b6adbe5 100644 --- a/doc/generated/examples/nodes_print_1.xml +++ b/doc/generated/examples/nodes_print_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q The object file is: hello.o The program file is: hello cc -o hello.o -c hello.c diff --git a/doc/generated/examples/nodes_print_2.xml b/doc/generated/examples/nodes_print_2.xml index 3c66573..5c272a8 100644 --- a/doc/generated/examples/nodes_print_2.xml +++ b/doc/generated/examples/nodes_print_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q The object file is: hello.obj The program file is: hello.exe cl /Fohello.obj /c hello.c /nologo diff --git a/doc/generated/examples/output_Progress-TARGET_1.xml b/doc/generated/examples/output_Progress-TARGET_1.xml index 3408cdc..72fa5bd 100644 --- a/doc/generated/examples/output_Progress-TARGET_1.xml +++ b/doc/generated/examples/output_Progress-TARGET_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q Evaluating SConstruct Evaluating f1.c Evaluating f1.o diff --git a/doc/generated/examples/output_ex1_1.xml b/doc/generated/examples/output_ex1_1.xml index bff25da..1558b01 100644 --- a/doc/generated/examples/output_ex1_1.xml +++ b/doc/generated/examples/output_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -h +% scons -h scons: Reading SConscript files ... scons: done reading SConscript files. diff --git a/doc/generated/examples/output_ex2_1.xml b/doc/generated/examples/output_ex2_1.xml index 5d02707..d832a52 100644 --- a/doc/generated/examples/output_ex2_1.xml +++ b/doc/generated/examples/output_ex2_1.xml @@ -1,4 +1,4 @@ -C:\>scons -h +C:\>scons -h scons: Reading SConscript files ... scons: done reading SConscript files. diff --git a/doc/generated/examples/output_ex2_2.xml b/doc/generated/examples/output_ex2_2.xml index 5a25472..4cbccc1 100644 --- a/doc/generated/examples/output_ex2_2.xml +++ b/doc/generated/examples/output_ex2_2.xml @@ -1,4 +1,4 @@ -% scons -h +% scons -h scons: Reading SConscript files ... scons: done reading SConscript files. diff --git a/doc/generated/examples/output_gbf2_1.xml b/doc/generated/examples/output_gbf2_1.xml index 267035e..17f5d1d 100644 --- a/doc/generated/examples/output_gbf2_1.xml +++ b/doc/generated/examples/output_gbf2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q scons: `.' is up to date. Build succeeded. % scons -Q fail=1 diff --git a/doc/generated/examples/parseflags_ex1_1.xml b/doc/generated/examples/parseflags_ex1_1.xml index bfa731f..4477631 100644 --- a/doc/generated/examples/parseflags_ex1_1.xml +++ b/doc/generated/examples/parseflags_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q CPPPATH ['/opt/include'] LIBPATH ['/opt/lib'] LIBS ['foo'] diff --git a/doc/generated/examples/parseflags_ex1_2.xml b/doc/generated/examples/parseflags_ex1_2.xml index d9f00a5..9a2d0e3 100644 --- a/doc/generated/examples/parseflags_ex1_2.xml +++ b/doc/generated/examples/parseflags_ex1_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q CPPPATH ['/opt/include'] LIBPATH ['/opt/lib'] LIBS ['foo'] diff --git a/doc/generated/examples/parseflags_ex2_1.xml b/doc/generated/examples/parseflags_ex2_1.xml index 0a35925..9626ae8 100644 --- a/doc/generated/examples/parseflags_ex2_1.xml +++ b/doc/generated/examples/parseflags_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q CCFLAGS -whatever cc -o f1.o -c -whatever f1.c cc -o f1 f1.o diff --git a/doc/generated/examples/parseflags_ex3_1.xml b/doc/generated/examples/parseflags_ex3_1.xml index bfa731f..4477631 100644 --- a/doc/generated/examples/parseflags_ex3_1.xml +++ b/doc/generated/examples/parseflags_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q CPPPATH ['/opt/include'] LIBPATH ['/opt/lib'] LIBS ['foo'] diff --git a/doc/generated/examples/parseflags_ex4_1.xml b/doc/generated/examples/parseflags_ex4_1.xml index bfa731f..4477631 100644 --- a/doc/generated/examples/parseflags_ex4_1.xml +++ b/doc/generated/examples/parseflags_ex4_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q CPPPATH ['/opt/include'] LIBPATH ['/opt/lib'] LIBS ['foo'] diff --git a/doc/generated/examples/repositories_CPPPATH3_1.xml b/doc/generated/examples/repositories_CPPPATH3_1.xml index f983d96..395699b 100644 --- a/doc/generated/examples/repositories_CPPPATH3_1.xml +++ b/doc/generated/examples/repositories_CPPPATH3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c -Idir1 -I/r1/dir1 -I/r2/dir1 -Idir2 -I/r1/dir2 -I/r2/dir2 -Idir3 -I/r1/dir3 -I/r2/dir3 hello.c cc -o hello hello.o diff --git a/doc/generated/examples/repositories_CPPPATH_1.xml b/doc/generated/examples/repositories_CPPPATH_1.xml index 30b5d75..fcb37b3 100644 --- a/doc/generated/examples/repositories_CPPPATH_1.xml +++ b/doc/generated/examples/repositories_CPPPATH_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c -I. -I/usr/repository1 hello.c cc -o hello hello.o diff --git a/doc/generated/examples/repositories_ex1_1.xml b/doc/generated/examples/repositories_ex1_1.xml index efc6d5a..486b067 100644 --- a/doc/generated/examples/repositories_ex1_1.xml +++ b/doc/generated/examples/repositories_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o diff --git a/doc/generated/examples/repositories_ex2_1.xml b/doc/generated/examples/repositories_ex2_1.xml index e773a8d..21ad69b 100644 --- a/doc/generated/examples/repositories_ex2_1.xml +++ b/doc/generated/examples/repositories_ex2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c /usr/repository1/hello.c cc -o hello hello.o diff --git a/doc/generated/examples/repositories_ex3_1.xml b/doc/generated/examples/repositories_ex3_1.xml index c437bb7..5006217 100644 --- a/doc/generated/examples/repositories_ex3_1.xml +++ b/doc/generated/examples/repositories_ex3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c /usr/repository2/hello.c cc -o hello hello.o diff --git a/doc/generated/examples/repositories_ex4_1.xml b/doc/generated/examples/repositories_ex4_1.xml index 47d9923..a9bf7ca 100644 --- a/doc/generated/examples/repositories_ex4_1.xml +++ b/doc/generated/examples/repositories_ex4_1.xml @@ -1,4 +1,4 @@ -% cd /usr/repository1 +% cd /usr/repository1 % scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c diff --git a/doc/generated/examples/repositories_quote1_1.xml b/doc/generated/examples/repositories_quote1_1.xml index c503900..a6d57a3 100644 --- a/doc/generated/examples/repositories_quote1_1.xml +++ b/doc/generated/examples/repositories_quote1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o hello.o -c -I. -I/usr/repository1 /usr/repository1/hello.c cc -o hello hello.o diff --git a/doc/generated/examples/separate_builddir_1.xml b/doc/generated/examples/separate_builddir_1.xml index 36d4383..f3dca19 100644 --- a/doc/generated/examples/separate_builddir_1.xml +++ b/doc/generated/examples/separate_builddir_1.xml @@ -1,4 +1,4 @@ -% ls src +% ls src hello.c % scons -Q cc -o build/hello.o -c build/hello.c diff --git a/doc/generated/examples/separate_builddir_sconscript_1.xml b/doc/generated/examples/separate_builddir_sconscript_1.xml index d719829..6efc16f 100644 --- a/doc/generated/examples/separate_builddir_sconscript_1.xml +++ b/doc/generated/examples/separate_builddir_sconscript_1.xml @@ -1,4 +1,4 @@ -% ls src +% ls src SConscript hello.c % scons -Q cc -o build/hello.o -c build/hello.c diff --git a/doc/generated/examples/separate_duplicate0_1.xml b/doc/generated/examples/separate_duplicate0_1.xml index 3c8b642..61222b4 100644 --- a/doc/generated/examples/separate_duplicate0_1.xml +++ b/doc/generated/examples/separate_duplicate0_1.xml @@ -1,4 +1,4 @@ -% ls src +% ls src hello.c % scons -Q cc -o build/hello.o -c src/hello.c diff --git a/doc/generated/examples/separate_ex1_1.xml b/doc/generated/examples/separate_ex1_1.xml index d719829..6efc16f 100644 --- a/doc/generated/examples/separate_ex1_1.xml +++ b/doc/generated/examples/separate_ex1_1.xml @@ -1,4 +1,4 @@ -% ls src +% ls src SConscript hello.c % scons -Q cc -o build/hello.o -c build/hello.c diff --git a/doc/generated/examples/separate_glob_builddir_sconscript_1.xml b/doc/generated/examples/separate_glob_builddir_sconscript_1.xml index 4ff49d5..65eda09 100644 --- a/doc/generated/examples/separate_glob_builddir_sconscript_1.xml +++ b/doc/generated/examples/separate_glob_builddir_sconscript_1.xml @@ -1,4 +1,4 @@ -% ls src +% ls src SConscript f1.c f2.c f2.h % scons -Q cc -o build/f1.o -c build/f1.c diff --git a/doc/generated/examples/sideeffect_parallel_1.xml b/doc/generated/examples/sideeffect_parallel_1.xml index 0152803..3fcac16 100644 --- a/doc/generated/examples/sideeffect_parallel_1.xml +++ b/doc/generated/examples/sideeffect_parallel_1.xml @@ -1,4 +1,4 @@ -% scons -Q --jobs=2 +% scons -Q --jobs=2 echo > file1.out data1 echo > file2.out data2 diff --git a/doc/generated/examples/sideeffect_shared_1.xml b/doc/generated/examples/sideeffect_shared_1.xml index 355578a..8902974 100644 --- a/doc/generated/examples/sideeffect_shared_1.xml +++ b/doc/generated/examples/sideeffect_shared_1.xml @@ -1,4 +1,4 @@ -% scons -Q --jobs=2 +% scons -Q --jobs=2 ./build --log logfile.txt file1.in file1.out ./build --log logfile.txt file2.in file2.out diff --git a/doc/generated/examples/sideeffect_simple_1.xml b/doc/generated/examples/sideeffect_simple_1.xml index ed97594..5436160 100644 --- a/doc/generated/examples/sideeffect_simple_1.xml +++ b/doc/generated/examples/sideeffect_simple_1.xml @@ -1,9 +1,9 @@ -% scons -Q --jobs=2 +% scons -Q --jobs=2 File "/home/my/project/SConstruct", line 4 'echo >$TARGET data1; echo >log updated file1')) ^ -SyntaxError: invalid syntax +SyntaxError: unmatched ')' diff --git a/doc/generated/examples/simple_Object_1.xml b/doc/generated/examples/simple_Object_1.xml index 0dfb85a..1aa7815 100644 --- a/doc/generated/examples/simple_Object_1.xml +++ b/doc/generated/examples/simple_Object_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/simple_Object_2.xml b/doc/generated/examples/simple_Object_2.xml index b7dea0c..4fb09c5 100644 --- a/doc/generated/examples/simple_Object_2.xml +++ b/doc/generated/examples/simple_Object_2.xml @@ -1,4 +1,4 @@ -C:\>scons +C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/simple_clean_1.xml b/doc/generated/examples/simple_clean_1.xml index c15ec25..f299433 100644 --- a/doc/generated/examples/simple_clean_1.xml +++ b/doc/generated/examples/simple_clean_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/simple_clean_2.xml b/doc/generated/examples/simple_clean_2.xml index 7e3d564..ae61731 100644 --- a/doc/generated/examples/simple_clean_2.xml +++ b/doc/generated/examples/simple_clean_2.xml @@ -1,4 +1,4 @@ -C:\>scons +C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/simple_declarative_1.xml b/doc/generated/examples/simple_declarative_1.xml index da29097..8988213 100644 --- a/doc/generated/examples/simple_declarative_1.xml +++ b/doc/generated/examples/simple_declarative_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... Calling Program('hello.c') Calling Program('goodbye.c') diff --git a/doc/generated/examples/simple_ex1_1.xml b/doc/generated/examples/simple_ex1_1.xml index f645a2a..bfd6a4d 100644 --- a/doc/generated/examples/simple_ex1_1.xml +++ b/doc/generated/examples/simple_ex1_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/simple_ex1_2.xml b/doc/generated/examples/simple_ex1_2.xml index 518b437..6f0b5ec 100644 --- a/doc/generated/examples/simple_ex1_2.xml +++ b/doc/generated/examples/simple_ex1_2.xml @@ -1,4 +1,4 @@ -C:\>scons +C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/simple_ex1_3.xml b/doc/generated/examples/simple_ex1_3.xml index 518b437..6f0b5ec 100644 --- a/doc/generated/examples/simple_ex1_3.xml +++ b/doc/generated/examples/simple_ex1_3.xml @@ -1,4 +1,4 @@ -C:\>scons +C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/simple_ex1_4.xml b/doc/generated/examples/simple_ex1_4.xml index eb10a06..2a7664c 100644 --- a/doc/generated/examples/simple_ex1_4.xml +++ b/doc/generated/examples/simple_ex1_4.xml @@ -1,4 +1,4 @@ -C:\>scons -Q +C:\>scons -Q cl /Fohello.obj /c hello.c /nologo link /nologo /OUT:hello.exe hello.obj embedManifestExeCheck(target, source, env) diff --git a/doc/generated/examples/simple_java_1.xml b/doc/generated/examples/simple_java_1.xml index decf1b5..2a005bf 100644 --- a/doc/generated/examples/simple_java_1.xml +++ b/doc/generated/examples/simple_java_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/tasks_ex1_1.xml b/doc/generated/examples/tasks_ex1_1.xml index 0bbbae1..1e44552 100644 --- a/doc/generated/examples/tasks_ex1_1.xml +++ b/doc/generated/examples/tasks_ex1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cat < test.bar > test.h cc -o app main.cpp cat < foo.bar2 > foo.cpp diff --git a/doc/generated/examples/troubleshoot_Dump_1.xml b/doc/generated/examples/troubleshoot_Dump_1.xml index 513babe..cb0ab4a 100644 --- a/doc/generated/examples/troubleshoot_Dump_1.xml +++ b/doc/generated/examples/troubleshoot_Dump_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... { 'BUILDERS': { '_InternalInstall': <function InstallBuilderWrapper at 0x700000>, '_InternalInstallAs': <function InstallAsBuilderWrapper at 0x700000>, diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml index 357ecfd..0eb0f98 100644 --- a/doc/generated/examples/troubleshoot_Dump_2.xml +++ b/doc/generated/examples/troubleshoot_Dump_2.xml @@ -1,4 +1,4 @@ -C:\>scons +C:\>scons scons: Reading SConscript files ... { 'BUILDERS': { 'Object': <SCons.Builder.CompositeBuilder object at 0x700000>, 'PCH': <SCons.Builder.BuilderBase object at 0x700000>, @@ -91,7 +91,7 @@ scons: Reading SConscript files ... 'SHCXXCOM': '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES ' '$SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}', 'SHCXXFLAGS': ['$CXXFLAGS'], - 'SHELL': 'command', + 'SHELL': None, 'SHLIBPREFIX': '', 'SHLIBSUFFIX': '.dll', 'SHOBJPREFIX': '$OBJPREFIX', diff --git a/doc/generated/examples/troubleshoot_Dump_ENV_1.xml b/doc/generated/examples/troubleshoot_Dump_ENV_1.xml index 7ed4d86..9fb88cf 100644 --- a/doc/generated/examples/troubleshoot_Dump_ENV_1.xml +++ b/doc/generated/examples/troubleshoot_Dump_ENV_1.xml @@ -1,4 +1,4 @@ -% scons +% scons scons: Reading SConscript files ... {'PATH': '/usr/local/bin:/opt/bin:/bin:/usr/bin'} scons: done reading SConscript files. diff --git a/doc/generated/examples/troubleshoot_Dump_ENV_2.xml b/doc/generated/examples/troubleshoot_Dump_ENV_2.xml index e421f6a..0879e27 100644 --- a/doc/generated/examples/troubleshoot_Dump_ENV_2.xml +++ b/doc/generated/examples/troubleshoot_Dump_ENV_2.xml @@ -1,4 +1,4 @@ -C:\>scons +C:\>scons scons: Reading SConscript files ... { 'PATH': 'C:\\WINDOWS\\System32:/usr/bin', 'PATHEXT': '.COM;.EXE;.BAT;.CMD', diff --git a/doc/generated/examples/troubleshoot_explain1_1.xml b/doc/generated/examples/troubleshoot_explain1_1.xml index c73e5ac..e0bab24 100644 --- a/doc/generated/examples/troubleshoot_explain1_1.xml +++ b/doc/generated/examples/troubleshoot_explain1_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cp file.in file.oout % scons -Q cp file.in file.oout diff --git a/doc/generated/examples/troubleshoot_explain1_2.xml b/doc/generated/examples/troubleshoot_explain1_2.xml index 77eb88b..d2a23ec 100644 --- a/doc/generated/examples/troubleshoot_explain1_2.xml +++ b/doc/generated/examples/troubleshoot_explain1_2.xml @@ -1,4 +1,4 @@ -% scons -Q --debug=explain +% scons -Q --debug=explain scons: building `file.out' because it doesn't exist cp file.in file.oout diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml index f927648..98a2d13 100644 --- a/doc/generated/examples/troubleshoot_explain1_3.xml +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -1,4 +1,4 @@ -% scons -Q --warn=target-not-built +% scons -Q --warn=target-not-built cp file.in file.oout scons: warning: Cannot find target file.out after building diff --git a/doc/generated/examples/troubleshoot_explain2_1.xml b/doc/generated/examples/troubleshoot_explain2_1.xml index 80fefda..85be57e 100644 --- a/doc/generated/examples/troubleshoot_explain2_1.xml +++ b/doc/generated/examples/troubleshoot_explain2_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o file1.o -c file1.c cc -o file2.o -c file2.c cc -o file3.o -c file3.c diff --git a/doc/generated/examples/troubleshoot_explain3_1.xml b/doc/generated/examples/troubleshoot_explain3_1.xml index 4fde5ac..4ba3ddc 100644 --- a/doc/generated/examples/troubleshoot_explain3_1.xml +++ b/doc/generated/examples/troubleshoot_explain3_1.xml @@ -1,4 +1,4 @@ -% scons -Q +% scons -Q cc -o file1.o -c -I. file1.c cc -o file2.o -c -I. file2.c cc -o file3.o -c -I. file3.c diff --git a/doc/generated/examples/troubleshoot_findlibs_1.xml b/doc/generated/examples/troubleshoot_findlibs_1.xml index 9fddc2b..b9c4316 100644 --- a/doc/generated/examples/troubleshoot_findlibs_1.xml +++ b/doc/generated/examples/troubleshoot_findlibs_1.xml @@ -1,4 +1,4 @@ -% scons -Q --debug=findlibs +% scons -Q --debug=findlibs findlibs: looking for 'libfoo.a' in 'libs1' ... findlibs: ... FOUND 'libfoo.a' in 'libs1' findlibs: looking for 'libfoo.so' in 'libs1' ... diff --git a/doc/generated/examples/troubleshoot_stacktrace_1.xml b/doc/generated/examples/troubleshoot_stacktrace_1.xml index 464eca5..0273e6f 100644 --- a/doc/generated/examples/troubleshoot_stacktrace_1.xml +++ b/doc/generated/examples/troubleshoot_stacktrace_1.xml @@ -1,3 +1,3 @@ -% scons -Q +% scons -Q scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'. diff --git a/doc/generated/examples/troubleshoot_stacktrace_2.xml b/doc/generated/examples/troubleshoot_stacktrace_2.xml index 79cf5b5..66a7abb 100644 --- a/doc/generated/examples/troubleshoot_stacktrace_2.xml +++ b/doc/generated/examples/troubleshoot_stacktrace_2.xml @@ -1,11 +1,11 @@ -% scons -Q --debug=stacktrace +% scons -Q --debug=stacktrace scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'. scons: internal stack trace: File "SCons/Job.py", line 199, in start task.prepare() - File "SCons/Script/Main.py", line 189, in prepare + File "SCons/Script/Main.py", line 190, in prepare return SCons.Taskmaster.OutOfDateTask.prepare(self) - File "SCons/Taskmaster.py", line 196, in prepare + File "SCons/Taskmaster.py", line 195, in prepare executor.prepare() File "SCons/Executor.py", line 429, in prepare raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0])) diff --git a/doc/generated/examples/troubleshoot_taskmastertrace_1.xml b/doc/generated/examples/troubleshoot_taskmastertrace_1.xml index cfa2c8b..1a3041d 100644 --- a/doc/generated/examples/troubleshoot_taskmastertrace_1.xml +++ b/doc/generated/examples/troubleshoot_taskmastertrace_1.xml @@ -1,4 +1,4 @@ -% scons -Q --taskmastertrace=- prog +% scons -Q --taskmastertrace=- prog Taskmaster: Looking for a node to evaluate Taskmaster: Considering node <no_state 0 'prog'> and its children: diff --git a/doc/generated/examples/troubleshoot_tree1_1.xml b/doc/generated/examples/troubleshoot_tree1_1.xml index 0f3c3c8..279ebc7 100644 --- a/doc/generated/examples/troubleshoot_tree1_1.xml +++ b/doc/generated/examples/troubleshoot_tree1_1.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=all +% scons -Q --tree=all cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c diff --git a/doc/generated/examples/troubleshoot_tree1_2.xml b/doc/generated/examples/troubleshoot_tree1_2.xml index d99435d..778aaad 100644 --- a/doc/generated/examples/troubleshoot_tree1_2.xml +++ b/doc/generated/examples/troubleshoot_tree1_2.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=all,linedraw +% scons -Q --tree=all,linedraw cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c diff --git a/doc/generated/examples/troubleshoot_tree1_3.xml b/doc/generated/examples/troubleshoot_tree1_3.xml index 7f3789f..4bc4de1 100644 --- a/doc/generated/examples/troubleshoot_tree1_3.xml +++ b/doc/generated/examples/troubleshoot_tree1_3.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=all f2.o +% scons -Q --tree=all f2.o cc -o f2.o -c -I. f2.c +-f2.o +-f2.c diff --git a/doc/generated/examples/troubleshoot_tree1_4.xml b/doc/generated/examples/troubleshoot_tree1_4.xml index bc0dbac..d447278 100644 --- a/doc/generated/examples/troubleshoot_tree1_4.xml +++ b/doc/generated/examples/troubleshoot_tree1_4.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=all f1.o f3.o +% scons -Q --tree=all f1.o f3.o cc -o f1.o -c -I. f1.c +-f1.o +-f1.c diff --git a/doc/generated/examples/troubleshoot_tree1_5.xml b/doc/generated/examples/troubleshoot_tree1_5.xml index 687b1ba..ef547bc 100644 --- a/doc/generated/examples/troubleshoot_tree1_5.xml +++ b/doc/generated/examples/troubleshoot_tree1_5.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=status +% scons -Q --tree=status cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c diff --git a/doc/generated/examples/troubleshoot_tree1_6.xml b/doc/generated/examples/troubleshoot_tree1_6.xml index 00b05ac..9ffcefa 100644 --- a/doc/generated/examples/troubleshoot_tree1_6.xml +++ b/doc/generated/examples/troubleshoot_tree1_6.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=derived +% scons -Q --tree=derived cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c diff --git a/doc/generated/examples/troubleshoot_tree1_7.xml b/doc/generated/examples/troubleshoot_tree1_7.xml index 2b16556..caf961e 100644 --- a/doc/generated/examples/troubleshoot_tree1_7.xml +++ b/doc/generated/examples/troubleshoot_tree1_7.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=derived,status +% scons -Q --tree=derived,status cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c diff --git a/doc/generated/examples/troubleshoot_tree2_1.xml b/doc/generated/examples/troubleshoot_tree2_1.xml index e7e2d5d..e3a1233 100644 --- a/doc/generated/examples/troubleshoot_tree2_1.xml +++ b/doc/generated/examples/troubleshoot_tree2_1.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=all +% scons -Q --tree=all cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c diff --git a/doc/generated/examples/troubleshoot_tree2_2.xml b/doc/generated/examples/troubleshoot_tree2_2.xml index c2f0e64..eafbbc9 100644 --- a/doc/generated/examples/troubleshoot_tree2_2.xml +++ b/doc/generated/examples/troubleshoot_tree2_2.xml @@ -1,4 +1,4 @@ -% scons -Q --tree=prune +% scons -Q --tree=prune cc -o f1.o -c -I. f1.c cc -o f2.o -c -I. f2.c cc -o f3.o -c -I. f3.c diff --git a/doc/generated/examples/variants_ex_1.xml b/doc/generated/examples/variants_ex_1.xml index b51655c..1b9a0af 100644 --- a/doc/generated/examples/variants_ex_1.xml +++ b/doc/generated/examples/variants_ex_1.xml @@ -1,4 +1,4 @@ -% scons -Q OS=linux +% scons -Q OS=linux Install file: "build/linux/world/world.h" as "export/linux/include/world.h" cc -o build/linux/hello/hello.o -c -Iexport/linux/include build/linux/hello/hello.c cc -o build/linux/world/world.o -c -Iexport/linux/include build/linux/world/world.c diff --git a/doc/generated/examples/variants_ex_2.xml b/doc/generated/examples/variants_ex_2.xml index 22385e3..719accd 100644 --- a/doc/generated/examples/variants_ex_2.xml +++ b/doc/generated/examples/variants_ex_2.xml @@ -1,4 +1,4 @@ -C:\>scons -Q OS=windows +C:\>scons -Q OS=windows Install file: "build/windows/world/world.h" as "export/windows/include/world.h" cl /Fobuild\windows\hello\hello.obj /c build\windows\hello\hello.c /nologo /Iexport\windows\include cl /Fobuild\windows\world\world.obj /c build\windows\world\world.c /nologo /Iexport\windows\include diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index 00bfa7c..4c1fb81 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -98,6 +98,13 @@ Set construction variables for the Clang C++ compiler. Sets: $CXX $CXXVERSION $SHCXXFLAGS $SHOBJSUFFIX $STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME + + compilation_db + + Sets up CompilationDatabase builder which generates a clang tooling compatible compilation database. + + Sets: $COMPILATIONDB_COMSTR $COMPILATIONDB_USE_ABSPATH $__COMPILATIONDB_ENV $__COMPILATIONDB_UACTION $__COMPILATIONDB_USOURCE $__COMPILATIONDB_UTARGET + cvf diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod index 0920ce0..c32d6ff 100644 --- a/doc/generated/tools.mod +++ b/doc/generated/tools.mod @@ -20,6 +20,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. cc"> clang"> clangxx"> +compilation_db"> cvf"> cXX"> cyglink"> @@ -125,6 +126,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. cc"> clang"> clangxx"> +compilation_db"> cvf"> cXX"> cyglink"> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 8c22b79..3795aab 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -557,6 +557,29 @@ section of the RPM + + + COMPILATIONDB_COMSTR + + + The string displayed when CompilationDatabase builder's action is run. + + + + + + COMPILATIONDB_USE_ABSPATH + + + This is a boolean flag to instruct CompilationDatabase to + write the file and target members + in the compilation database with absolute or relative paths. + + + The default value is False (use relative paths) + + + _concat @@ -3015,14 +3038,6 @@ is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite HOST_ARCH - The name of the host hardware architecture used to create the Environment. - If a platform is specified when creating the Environment, then - that Platform's logic will handle setting this value. - This value is immutable, and should not be changed by the user after - the Environment is initialized. - Currently only set for Win32. - - Sets the host architecture for Visual Studio compiler. If not set, default to the detected host architecture: note that this may depend on the python you are using. @@ -3038,7 +3053,15 @@ Valid values are the same as for $TARGET_ARCH. This is currently only used on Windows, but in the future it will be used on other OSes as well. - + + The name of the host hardware architecture used to create the Environment. + If a platform is specified when creating the Environment, then + that Platform's logic will handle setting this value. + This value is immutable, and should not be changed by the user after + the Environment is initialized. + Currently only set for Win32. + + @@ -7628,12 +7651,6 @@ for more information). TARGET_ARCH - The name of the target hardware architecture for the compiled objects - created by this Environment. - This defaults to the value of HOST_ARCH, and the user can override it. - Currently only set for Win32. - - Sets the target architecture for Visual Studio compiler (i.e. the arch of the binaries generated by the compiler). If not set, default to $HOST_ARCH, or, if that is unset, to the architecture of the @@ -7664,7 +7681,13 @@ and ia64 (Itanium). For example, if you want to compile 64-bit binaries, you would set TARGET_ARCH='x86_64' in your SCons environment. - + + The name of the target hardware architecture for the compiled objects + created by this Environment. + This defaults to the value of HOST_ARCH, and the user can override it. + Currently only set for Win32. + + diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index e4a798b..d6b92ed 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -46,6 +46,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $CHANGED_SOURCES"> $CHANGED_TARGETS"> $CHANGELOG"> +$COMPILATIONDB_COMSTR"> +$COMPILATIONDB_USE_ABSPATH"> $_concat"> $CONFIGUREDIR"> $CONFIGURELOG"> @@ -686,6 +688,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $CHANGED_SOURCES"> $CHANGED_TARGETS"> $CHANGELOG"> +$COMPILATIONDB_COMSTR"> +$COMPILATIONDB_USE_ABSPATH"> $_concat"> $CONFIGUREDIR"> $CONFIGURELOG"> diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 56be82a..6b77a4c 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -38,9 +38,10 @@ %variables-mod; ]> - + @@ -6814,6 +6815,9 @@ over the MinGW tools. + ENVIRONMENT @@ -7441,9 +7445,28 @@ and will silently revert to non-cached behavior in such cases. SEE ALSO -&SCons; User Manual, -&SCons; Design Document, -&SCons; source code. + + + The SCons User Guide at + + + The SCons Design Document (old) + + The SCons Cookbook at + + for examples of how to solve various problems with &SCons;. + + + SCons source code + + on GitHub + + + The SCons API Reference + + (for internal details) + + diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 21a982f..9469e06 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -31,13 +31,14 @@ needs_sphinx = '1.3' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'autoclasstoc', + #'autoclasstoc', # TODO: figure out how to make this useful 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', #'sphinx.ext.githubpages' 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext.viewcode', + 'sphinx_rtd_theme', ] autosummary_generate = True @@ -74,10 +75,11 @@ author = 'SCons Project Team' # |version| and |release|, also used in various other places throughout the # built documents. # +# TODO: fill these in externally # The short X.Y version. version = '4.0' # The full version, including alpha/beta/rc tags. -release = '4.0.0a1' +release = '4.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -103,14 +105,16 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -#html_theme = 'alabaster' -html_theme = 'classic' +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # -# html_theme_options = {} +html_theme_options = { + "collapse_navigation": False, + "navigation_depth": 3, +} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/doc/user/main.xml b/doc/user/main.xml index 34555af..dded9cf 100644 --- a/doc/user/main.xml +++ b/doc/user/main.xml @@ -62,6 +62,7 @@ SCons &buildversion; @@ -74,10 +75,10 @@ Steven Knight and the SCons Development Team - 2004 - 2019 + 2004 - 2020 - 2004 - 2019 + 2004 - 2020 The SCons Foundation diff --git a/doc/user/misc.xml b/doc/user/misc.xml index e430897..bd20397 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -685,9 +685,9 @@ env.Command('directory_build_info', See - - JSON Compilation Database Format Specification¶ - + + JSON Compilation Database Format Specification + for complete information -- cgit v0.12 From 8fb5f22e1675d7cb330e4e56ff2a662c193bdc15 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 11 Jun 2020 09:03:33 -0600 Subject: Minor: drop engine prefix from docstrings [ci skip] A number of module docstrings start with the module name, these end up appearing in API docs. Drop the "engine/" prefix where it appears. Signed-off-by: Mats Wichmann --- SCons/Platform/aix.py | 2 +- SCons/Platform/darwin.py | 2 +- SCons/Platform/hpux.py | 2 +- SCons/Platform/sunos.py | 2 +- SCons/Tool/aixf77.py | 2 +- SCons/Tool/cvf.py | 2 +- SCons/Tool/f03.py | 2 +- SCons/Tool/f08.py | 2 +- SCons/Tool/f77.py | 2 +- SCons/Tool/f90.py | 2 +- SCons/Tool/f95.py | 2 +- SCons/Tool/g77.py | 2 +- SCons/Tool/icc.py | 2 +- SCons/Tool/icl.py | 2 +- SCons/Tool/mssdk.py | 2 +- SCons/Tool/msvc.py | 2 +- SCons/Tool/sunar.py | 2 +- SCons/Variables/BoolVariable.py | 2 +- SCons/Variables/EnumVariable.py | 2 +- SCons/Variables/ListVariable.py | 2 +- SCons/Variables/PackageVariable.py | 2 +- SCons/Variables/__init__.py | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/SCons/Platform/aix.py b/SCons/Platform/aix.py index 0266dc6..c91679f 100644 --- a/SCons/Platform/aix.py +++ b/SCons/Platform/aix.py @@ -1,4 +1,4 @@ -"""engine.SCons.Platform.aix +"""SCons.Platform.aix Platform-specific initialization for IBM AIX systems. diff --git a/SCons/Platform/darwin.py b/SCons/Platform/darwin.py index fd697f6..590e79a 100644 --- a/SCons/Platform/darwin.py +++ b/SCons/Platform/darwin.py @@ -1,4 +1,4 @@ -"""engine.SCons.Platform.darwin +"""SCons.Platform.darwin Platform-specific initialization for Mac OS X systems. diff --git a/SCons/Platform/hpux.py b/SCons/Platform/hpux.py index 0e0bbcf..701be8a 100644 --- a/SCons/Platform/hpux.py +++ b/SCons/Platform/hpux.py @@ -1,4 +1,4 @@ -"""engine.SCons.Platform.hpux +"""SCons.Platform.hpux Platform-specific initialization for HP-UX systems. diff --git a/SCons/Platform/sunos.py b/SCons/Platform/sunos.py index 057fddf..40e698e 100644 --- a/SCons/Platform/sunos.py +++ b/SCons/Platform/sunos.py @@ -1,4 +1,4 @@ -"""engine.SCons.Platform.sunos +"""SCons.Platform.sunos Platform-specific initialization for Sun systems. diff --git a/SCons/Tool/aixf77.py b/SCons/Tool/aixf77.py index 3e30cd0..4cef908 100644 --- a/SCons/Tool/aixf77.py +++ b/SCons/Tool/aixf77.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.aixf77 +"""SCons.Tool.aixf77 Tool-specific initialization for IBM Visual Age f77 Fortran compiler. diff --git a/SCons/Tool/cvf.py b/SCons/Tool/cvf.py index da2c910..47e733e 100644 --- a/SCons/Tool/cvf.py +++ b/SCons/Tool/cvf.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.cvf +"""SCons.Tool.cvf Tool-specific initialization for the Compaq Visual Fortran compiler. diff --git a/SCons/Tool/f03.py b/SCons/Tool/f03.py index 6c30971..85774ca 100644 --- a/SCons/Tool/f03.py +++ b/SCons/Tool/f03.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.f03 +"""SCons.Tool.f03 Tool-specific initialization for the generic Posix f03 Fortran compiler. diff --git a/SCons/Tool/f08.py b/SCons/Tool/f08.py index 64bac8e..2939dc5 100644 --- a/SCons/Tool/f08.py +++ b/SCons/Tool/f08.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.f08 +"""SCons.Tool.f08 Tool-specific initialization for the generic Posix f08 Fortran compiler. diff --git a/SCons/Tool/f77.py b/SCons/Tool/f77.py index af47024..0fd58e5 100644 --- a/SCons/Tool/f77.py +++ b/SCons/Tool/f77.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.f77 +"""SCons.Tool.f77 Tool-specific initialization for the generic Posix f77 Fortran compiler. diff --git a/SCons/Tool/f90.py b/SCons/Tool/f90.py index 16b8f84..2dfb6f1 100644 --- a/SCons/Tool/f90.py +++ b/SCons/Tool/f90.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.f90 +"""SCons.Tool.f90 Tool-specific initialization for the generic Posix f90 Fortran compiler. diff --git a/SCons/Tool/f95.py b/SCons/Tool/f95.py index 5baa31e..5b99e53 100644 --- a/SCons/Tool/f95.py +++ b/SCons/Tool/f95.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.f95 +"""SCons.Tool.f95 Tool-specific initialization for the generic Posix f95 Fortran compiler. diff --git a/SCons/Tool/g77.py b/SCons/Tool/g77.py index 9dc3ba5..764235e 100644 --- a/SCons/Tool/g77.py +++ b/SCons/Tool/g77.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.g77 +"""SCons.Tool.g77 Tool-specific initialization for g77. diff --git a/SCons/Tool/icc.py b/SCons/Tool/icc.py index 11ea075..adf24e9 100644 --- a/SCons/Tool/icc.py +++ b/SCons/Tool/icc.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.icc +"""SCons.Tool.icc Tool-specific initialization for the OS/2 icc compiler. diff --git a/SCons/Tool/icl.py b/SCons/Tool/icl.py index a0bad31..421a388 100644 --- a/SCons/Tool/icl.py +++ b/SCons/Tool/icl.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.icl +"""SCons.Tool.icl Tool-specific initialization for the Intel C/C++ compiler. diff --git a/SCons/Tool/mssdk.py b/SCons/Tool/mssdk.py index f373002..b94f105 100644 --- a/SCons/Tool/mssdk.py +++ b/SCons/Tool/mssdk.py @@ -23,7 +23,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -"""engine.SCons.Tool.mssdk +"""SCons.Tool.mssdk Tool-specific initialization for Microsoft SDKs, both Platform SDKs and Windows SDKs. diff --git a/SCons/Tool/msvc.py b/SCons/Tool/msvc.py index 463e372..b9eb60a 100644 --- a/SCons/Tool/msvc.py +++ b/SCons/Tool/msvc.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.msvc +"""SCons.Tool.msvc Tool-specific initialization for Microsoft Visual C/C++. diff --git a/SCons/Tool/sunar.py b/SCons/Tool/sunar.py index ec076c8..266e914 100644 --- a/SCons/Tool/sunar.py +++ b/SCons/Tool/sunar.py @@ -1,4 +1,4 @@ -"""engine.SCons.Tool.sunar +"""SCons.Tool.sunar Tool-specific initialization for Solaris (Forte) ar (library archive). If CC exists, static libraries should be built with it, so that template diff --git a/SCons/Variables/BoolVariable.py b/SCons/Variables/BoolVariable.py index ce46eda..9c66cde 100644 --- a/SCons/Variables/BoolVariable.py +++ b/SCons/Variables/BoolVariable.py @@ -1,4 +1,4 @@ -"""engine.SCons.Variables.BoolVariable +"""SCons.Variables.BoolVariable This file defines the option type for SCons implementing true/false values. diff --git a/SCons/Variables/EnumVariable.py b/SCons/Variables/EnumVariable.py index bb0a9a0..8053503 100644 --- a/SCons/Variables/EnumVariable.py +++ b/SCons/Variables/EnumVariable.py @@ -1,4 +1,4 @@ -"""engine.SCons.Variables.EnumVariable +"""SCons.Variables.EnumVariable This file defines the option type for SCons allowing only specified input-values. diff --git a/SCons/Variables/ListVariable.py b/SCons/Variables/ListVariable.py index 351ffb1..7ebbb23 100644 --- a/SCons/Variables/ListVariable.py +++ b/SCons/Variables/ListVariable.py @@ -1,4 +1,4 @@ -"""engine.SCons.Variables.ListVariable +"""SCons.Variables.ListVariable This file defines the option type for SCons implementing 'lists'. diff --git a/SCons/Variables/PackageVariable.py b/SCons/Variables/PackageVariable.py index a0ace25..6847f3d 100644 --- a/SCons/Variables/PackageVariable.py +++ b/SCons/Variables/PackageVariable.py @@ -1,4 +1,4 @@ -"""engine.SCons.Variables.PackageVariable +"""SCons.Variables.PackageVariable This file defines the option type for SCons implementing 'package activation'. diff --git a/SCons/Variables/__init__.py b/SCons/Variables/__init__.py index ce9335b..f7531b4 100644 --- a/SCons/Variables/__init__.py +++ b/SCons/Variables/__init__.py @@ -1,4 +1,4 @@ -"""engine.SCons.Variables +"""SCons.Variables This file defines the Variables class that is used to add user-friendly customizable variables to an SCons build. -- cgit v0.12 From a22ee640760c5d248bf69ab908e9e5ac50ce186b Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 11 Jun 2020 10:28:01 -0600 Subject: Tweak MSCommon README a bit [ci skip] Formatting fiddles Signed-off-by: Mats Wichmann --- SCons/Tool/MSCommon/README | 103 ++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/SCons/Tool/MSCommon/README b/SCons/Tool/MSCommon/README index b3675cc..2268651 100644 --- a/SCons/Tool/MSCommon/README +++ b/SCons/Tool/MSCommon/README @@ -17,39 +17,37 @@ batch that starts with a call to msvc_setup_env(). Internal to MSCommon/vc.py: -+ MSCommon/vc.py:msvc_exists -| vcs = cached_get_installed_vcs(env) -| returns True if vcs > 0 -| -+-> MSCommon/vc.py:cached_get_installed_vcs ++ MSCommon/vc.py:msvc_exists: +| vcs = cached_get_installed_vcs(env) +| returns True if vcs > 0 +| ++-> MSCommon/vc.py:cached_get_installed_vcs: | checks global if we've run previously, if so return it | populate the global from -> get_installed_vcs(env) | - +-> MSCommon/vc.py:get_installed_vcs + +-> MSCommon/vc.py:get_installed_vcs: | loop through "known" versions of msvc, granularity is maj.min | check for product dir -> find_vc_pdir(env, ver) | - +-> MSCommon/vc.py:find_vc_pdir - | From the msvc-version to pdir mapping dict, get reg key base and value - | If value is none -> find_vc_pdir_vswhere(ver, env) + +-> MSCommon/vc.py:find_vc_pdir: + | From the msvc-version to pdir mapping dict, get reg key base and value + | If value is none -> find_vc_pdir_vswhere(ver, env) | - +-> MSCommon/vc.py:find_vc_pdir_vswhere - | From the vc-version to VS-version mapping table get string - | Figure out where vswhere is -> msvc_find_vswhere() - | Use subprocess to call vswhere, return first line of match + +-> MSCommon/vc.py:find_vc_pdir_vswhere: + | From the vc-version to VS-version mapping table get string + | Figure out where vswhere is -> msvc_find_vswhere() + | Use subprocess to call vswhere, return first line of match / - | Else get product directory from registry - | Note: 14.2, 14.1, 14.1Exp are the ones which will use vswhere + | else get product directory from registry (<= 14.0) / + | if we found one -> _check_cl_exists_in_vc_dir(env, pdir, ver) | - | if we found one -> _check_cl_exists_in_vc_dir(env, pdir, ver) - | - +-> MSCommon/vc.py:_check_cl_exists_in_vc_dir - | Figure out host/target pair - | If version > 14.0 get specific version by looking in - | pdir + Auxiliary/Build/Microsoft/VCToolsVersion/default.txt - | look for pdir + Tools/MSVC/{specver}/bin/host/target/cl.exe - | if 14.0 or less, "do older stuff" + +-> MSCommon/vc.py:_check_cl_exists_in_vc_dir: + | Figure out host/target pair + | if version > 14.0 get specific version by looking in + | pdir + Auxiliary/Build/Microsoft/VCToolsVersion/default.txt + | look for pdir + Tools/MSVC/{specver}/bin/host/target/cl.exe + | if 14.0 or less, "do older stuff" All of this just got us a yes-no answer on whether /some/ msvc version exists, but does populate __INSTALLED_VCS_RUN with all of the top-level @@ -64,45 +62,46 @@ Externally: Internally: -+ MSCommon/vc.py:msvc_setup_env_once -| checks for environment flag MSVC_SETUP_RUN -| if not, -> msvc_setup_env(env) and set flag ++ MSCommon/vc.py:msvc_setup_env_once: +| checks for environment flag MSVC_SETUP_RUN +| if not, -> msvc_setup_env(env) and set flag | -+-+ MSCommon/vc.py:msvc_setup_env - | set ver from -> get_default_version(env) ++-+ MSCommon/vc.py:msvc_setup_env: + | set ver from -> get_default_version(env) | - +-+ MSCommon/vc.py:get_default_version - | if no version specified in env.MSVC_VERSION: - | return first entry from -> cached_get_installed_vcs(env) - | else - | return requested version + +-+ MSCommon/vc.py:get_default_version: + | if no version specified in env.MSVC_VERSION: + | return first entry from -> cached_get_installed_vcs(env) + | else return requested version / - | get script from MSVC_USE_SCRIPT if set to a filename - | -> script_env(script) + | get script from MSVC_USE_SCRIPT if set to a filename + | -> script_env(script) | - +-+ MSCommon/vc.py:script_env - | return (possibly cached) script variables matching script arg + +-+ MSCommon/vc.py:script_env: + | return (possibly cached) script variables matching script arg / - | else - | -> msvc_find_valid_batch_script(env, version) + | else -> msvc_find_valid_batch_script(env, version) | - +-+ MSCommon/vc.py:msvc_find_valid_batch_script - | Build a list of plausible target values, and loop through - | look for host + target -> find_batch_file(env, ver, host, target) + +-+ MSCommon/vc.py:msvc_find_valid_batch_script: + | Build a list of plausible target values, and loop through + | look for host + target -> find_batch_file(env, ver, host, target) | - +-+ MSCommon/vc.py:find_batch_file - | call -> find_vc_pdir - | use the return to construct a version-biased batfile path, check + +-+ MSCommon/vc.py:find_batch_file: + | call -> find_vc_pdir (see above) + | use the return to construct a version-biased batfile path, check / - | if not found, try sdk scripts (unknown if this is still useful) + | if not found, try sdk scripts (unknown if this is still useful) Problems: -- As documented for MSVC_VERSION, compilers can only be requested - if versions are from the set in _VCVER, so 14.1 but not 14.16.27023 +- For VS >= 2017, VS and VS are not 1:1, there can be many VC for one VS +- For vswhere-ready versions, detection does not proceed beyond the + product level ("2019") into individual "features" (individual msvc) +- As documented for MSVC_VERSION, compilers can only be requested if versions + are from the set in _VCVER, so 14.1 but not 14.16 or 14.16.27023 - Information found in the first pass (msvs_exists) isn't really available anywhere except the cached version list, since we just - return true/fails -- For vswhere-ready versions, detection does not proceed beyond the - product level ("VS 2019") into individual "features" (i.e. specific - msvc install underneath it). + return true/false. +- Since msvc_exists chain of calls does not look at version, we + can proceed to compiler setup if *any* msvc was found, even if the + one requested wasn't found. -- cgit v0.12 From 36665166265b22c5852a24639aa0dd1c77cbb003 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Fri, 12 Jun 2020 12:43:32 +0200 Subject: Bumped the Fedora version up to 32. We bump up the Fedora version, since v30 has reached its EOL on 2020-05-26. --- testing/docker/fedora30/build/Dockerfile | 17 --------- testing/docker/fedora30/build/build_image.sh | 16 -------- testing/docker/fedora30/build/docker-compose.yml | 22 ----------- testing/docker/fedora30/build/readme.rst | 43 ---------------------- testing/docker/fedora30/build/start_build_shell.sh | 18 --------- .../fedora30/build/startup/setup_container.sh | 10 ----- testing/docker/fedora30/build/stop_build_shell.sh | 17 --------- testing/docker/fedora30/test/Dockerfile | 10 ----- testing/docker/fedora30/test/build_image.sh | 16 -------- testing/docker/fedora30/test/docker-compose.yml | 22 ----------- testing/docker/fedora30/test/readme.rst | 43 ---------------------- testing/docker/fedora30/test/start_test_shell.sh | 18 --------- .../fedora30/test/startup/setup_container.sh | 10 ----- testing/docker/fedora30/test/stop_test_shell.sh | 17 --------- testing/docker/fedora32/build/Dockerfile | 17 +++++++++ testing/docker/fedora32/build/build_image.sh | 16 ++++++++ testing/docker/fedora32/build/docker-compose.yml | 22 +++++++++++ testing/docker/fedora32/build/readme.rst | 43 ++++++++++++++++++++++ testing/docker/fedora32/build/start_build_shell.sh | 18 +++++++++ .../fedora32/build/startup/setup_container.sh | 10 +++++ testing/docker/fedora32/build/stop_build_shell.sh | 17 +++++++++ testing/docker/fedora32/test/Dockerfile | 10 +++++ testing/docker/fedora32/test/build_image.sh | 16 ++++++++ testing/docker/fedora32/test/docker-compose.yml | 22 +++++++++++ testing/docker/fedora32/test/readme.rst | 43 ++++++++++++++++++++++ testing/docker/fedora32/test/start_test_shell.sh | 18 +++++++++ .../fedora32/test/startup/setup_container.sh | 10 +++++ testing/docker/fedora32/test/stop_test_shell.sh | 17 +++++++++ 28 files changed, 279 insertions(+), 279 deletions(-) delete mode 100644 testing/docker/fedora30/build/Dockerfile delete mode 100755 testing/docker/fedora30/build/build_image.sh delete mode 100644 testing/docker/fedora30/build/docker-compose.yml delete mode 100644 testing/docker/fedora30/build/readme.rst delete mode 100755 testing/docker/fedora30/build/start_build_shell.sh delete mode 100755 testing/docker/fedora30/build/startup/setup_container.sh delete mode 100755 testing/docker/fedora30/build/stop_build_shell.sh delete mode 100644 testing/docker/fedora30/test/Dockerfile delete mode 100755 testing/docker/fedora30/test/build_image.sh delete mode 100644 testing/docker/fedora30/test/docker-compose.yml delete mode 100644 testing/docker/fedora30/test/readme.rst delete mode 100755 testing/docker/fedora30/test/start_test_shell.sh delete mode 100755 testing/docker/fedora30/test/startup/setup_container.sh delete mode 100755 testing/docker/fedora30/test/stop_test_shell.sh create mode 100644 testing/docker/fedora32/build/Dockerfile create mode 100755 testing/docker/fedora32/build/build_image.sh create mode 100644 testing/docker/fedora32/build/docker-compose.yml create mode 100644 testing/docker/fedora32/build/readme.rst create mode 100755 testing/docker/fedora32/build/start_build_shell.sh create mode 100755 testing/docker/fedora32/build/startup/setup_container.sh create mode 100755 testing/docker/fedora32/build/stop_build_shell.sh create mode 100644 testing/docker/fedora32/test/Dockerfile create mode 100755 testing/docker/fedora32/test/build_image.sh create mode 100644 testing/docker/fedora32/test/docker-compose.yml create mode 100644 testing/docker/fedora32/test/readme.rst create mode 100755 testing/docker/fedora32/test/start_test_shell.sh create mode 100755 testing/docker/fedora32/test/startup/setup_container.sh create mode 100755 testing/docker/fedora32/test/stop_test_shell.sh diff --git a/testing/docker/fedora30/build/Dockerfile b/testing/docker/fedora30/build/Dockerfile deleted file mode 100644 index c62037b..0000000 --- a/testing/docker/fedora30/build/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Building an SCons Release Build image under Fedora 30 -FROM fedora:30 - -LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on a Fedora 30" - -# Install additional packages -RUN dnf -y install git python3-lxml fop fontbox python3-devel lynx xterm vim vim-common nano - -# Install hyphenation patterns for FOP -RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ - -# Epydoc can be installed via pip3, but it doesn't seem to work properly. -# For the moment we don't install it and might replace it with Sphinx later... -# RUN dnf -y install python3-pip && pip3 install epydoc - -CMD ["/bin/bash"] - diff --git a/testing/docker/fedora30/build/build_image.sh b/testing/docker/fedora30/build/build_image.sh deleted file mode 100755 index afd04b8..0000000 --- a/testing/docker/fedora30/build/build_image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker build passing any other build options (command line options may override!) -docker build --network=host --file Dockerfile \ - -t scons-build-fedora30:latest -t scons-build-fedora30:0.0.1 "$@" . - -cd $OLD_WD - diff --git a/testing/docker/fedora30/build/docker-compose.yml b/testing/docker/fedora30/build/docker-compose.yml deleted file mode 100644 index 86f3031..0000000 --- a/testing/docker/fedora30/build/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' - -services: - build: - image: scons-build-fedora30:latest - restart: always - environment: - - DISPLAY - - HOME - volumes: - - /home:/home - - /tmp:/tmp - - /etc/sudoers:/etc/sudoers:ro - - /etc/passwd:/etc/passwd:ro - - /etc/shadow:/etc/shadow:ro - - /etc/group:/etc/group:ro - - ./startup:/startup - container_name: SCons_Build_Fedora30 - entrypoint: /startup/setup_container.sh - user: $DOCKERUID:$DOCKERGID - working_dir: $HOME - diff --git a/testing/docker/fedora30/build/readme.rst b/testing/docker/fedora30/build/readme.rst deleted file mode 100644 index 18ac401..0000000 --- a/testing/docker/fedora30/build/readme.rst +++ /dev/null @@ -1,43 +0,0 @@ -================================== -Image for building/releasing SCons -================================== - -This folder contains the files and scripts that can be used to -build and release SCons, based on a Fedora 30. - -Building the image -================== - -Build the local docker image by calling:: - - ./build_image.sh - -This will download the base image and install the required additional packages. - -Starting the image -================== - -Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: - - ./start_build_shell.sh - -which will open a new ``xterm`` with your current user on the host system as default. - -If you need additional setup steps or want to *mount* different folders to the build image, change the -files:: - - docker-compose.yml - ./startup/setup_container.sh - -locally. - - -Stopping the image -================== - -Simply call:: - - ./stop_build_shell.sh - -. - diff --git a/testing/docker/fedora30/build/start_build_shell.sh b/testing/docker/fedora30/build/start_build_shell.sh deleted file mode 100755 index 6905634..0000000 --- a/testing/docker/fedora30/build/start_build_shell.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -xhost +local:docker -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose up -d - -cd $OLD_WD - diff --git a/testing/docker/fedora30/build/startup/setup_container.sh b/testing/docker/fedora30/build/startup/setup_container.sh deleted file mode 100755 index f655441..0000000 --- a/testing/docker/fedora30/build/startup/setup_container.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Here we can add local setup steps for the finishing touches to our Docker build container. -# This can be setting symbolic links, e.g. -# sudo ln -s /disk2/stuff /stuff -# or triggering further scripts. - -# We start a separate xterm/terminal, such that the container doesn't exit right away... -/usr/bin/xterm - diff --git a/testing/docker/fedora30/build/stop_build_shell.sh b/testing/docker/fedora30/build/stop_build_shell.sh deleted file mode 100755 index c0a9707..0000000 --- a/testing/docker/fedora30/build/stop_build_shell.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose down - -cd $OLD_WD - diff --git a/testing/docker/fedora30/test/Dockerfile b/testing/docker/fedora30/test/Dockerfile deleted file mode 100644 index 20a0749..0000000 --- a/testing/docker/fedora30/test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Building an SCons Test image under Fedora 30 -FROM fedora:30 - -LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on a Fedora 30" - -# Install additional packages -RUN dnf -y install git bison cvs flex g++ gcc ghostscript m4 openssh-clients openssh-server python3-line_profiler python3-devel pypy3-devel rpm-build rcs java-1.8.0-openjdk swig texlive-scheme-basic texlive-base texlive-latex zip xterm vim vim-common nano - -CMD ["/bin/bash"] - diff --git a/testing/docker/fedora30/test/build_image.sh b/testing/docker/fedora30/test/build_image.sh deleted file mode 100755 index 5e1eaba..0000000 --- a/testing/docker/fedora30/test/build_image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker build passing any other build options (command line options may override!) -docker build --network=host --file Dockerfile \ - -t scons-test-fedora30:latest -t scons-test-fedora30:0.0.1 "$@" . - -cd $OLD_WD - diff --git a/testing/docker/fedora30/test/docker-compose.yml b/testing/docker/fedora30/test/docker-compose.yml deleted file mode 100644 index 25daa18..0000000 --- a/testing/docker/fedora30/test/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' - -services: - build: - image: scons-test-fedora30:latest - restart: always - environment: - - DISPLAY - - HOME - volumes: - - /home:/home - - /tmp:/tmp - - /etc/sudoers:/etc/sudoers:ro - - /etc/passwd:/etc/passwd:ro - - /etc/shadow:/etc/shadow:ro - - /etc/group:/etc/group:ro - - ./startup:/startup - container_name: SCons_Test_Fedora30 - entrypoint: /startup/setup_container.sh - user: $DOCKERUID:$DOCKERGID - working_dir: $HOME - diff --git a/testing/docker/fedora30/test/readme.rst b/testing/docker/fedora30/test/readme.rst deleted file mode 100644 index 8cba2e9..0000000 --- a/testing/docker/fedora30/test/readme.rst +++ /dev/null @@ -1,43 +0,0 @@ -======================= -Image for testing SCons -======================= - -This folder contains the files and scripts that can be used to -test SCons, based on a Fedora 30. - -Building the image -================== - -Build the local docker image by calling:: - - ./build_image.sh - -This will download the base image and install the required additional packages. - -Starting the image -================== - -Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: - - ./start_test_shell.sh - -which will open a new ``xterm`` with your current user on the host system as default. - -If you need additional setup steps or want to *mount* different folders to the test image, change the -files:: - - docker-compose.yml - ./startup/setup_container.sh - -locally. - - -Stopping the image -================== - -Simply call:: - - ./stop_test_shell.sh - -. - diff --git a/testing/docker/fedora30/test/start_test_shell.sh b/testing/docker/fedora30/test/start_test_shell.sh deleted file mode 100755 index 6905634..0000000 --- a/testing/docker/fedora30/test/start_test_shell.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -xhost +local:docker -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose up -d - -cd $OLD_WD - diff --git a/testing/docker/fedora30/test/startup/setup_container.sh b/testing/docker/fedora30/test/startup/setup_container.sh deleted file mode 100755 index f655441..0000000 --- a/testing/docker/fedora30/test/startup/setup_container.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Here we can add local setup steps for the finishing touches to our Docker build container. -# This can be setting symbolic links, e.g. -# sudo ln -s /disk2/stuff /stuff -# or triggering further scripts. - -# We start a separate xterm/terminal, such that the container doesn't exit right away... -/usr/bin/xterm - diff --git a/testing/docker/fedora30/test/stop_test_shell.sh b/testing/docker/fedora30/test/stop_test_shell.sh deleted file mode 100755 index c0a9707..0000000 --- a/testing/docker/fedora30/test/stop_test_shell.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# store starting working directory -OLD_WD=$PWD - -# determine working directory of shell script -WD=$(dirname "$(readlink -f "$0")") - -cd $WD - -# call docker container with local user -export DOCKERUID=$(id -u) -export DOCKERGID=$(id -g) -docker-compose down - -cd $OLD_WD - diff --git a/testing/docker/fedora32/build/Dockerfile b/testing/docker/fedora32/build/Dockerfile new file mode 100644 index 0000000..8d31d29 --- /dev/null +++ b/testing/docker/fedora32/build/Dockerfile @@ -0,0 +1,17 @@ +# Building an SCons Release Build image under Fedora 32 +FROM fedora:32 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on a Fedora 32" + +# Install additional packages +RUN dnf -y install git python3-lxml fop fontbox python3-devel lynx xterm vim vim-common nano unzip + +# Install hyphenation patterns for FOP +RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ + +# Epydoc can be installed via pip3, but it doesn't seem to work properly. +# For the moment we don't install it and might replace it with Sphinx later... +# RUN dnf -y install python3-pip && pip3 install epydoc + +CMD ["/bin/bash"] + diff --git a/testing/docker/fedora32/build/build_image.sh b/testing/docker/fedora32/build/build_image.sh new file mode 100755 index 0000000..cad4c84 --- /dev/null +++ b/testing/docker/fedora32/build/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-build-fedora32:latest -t scons-build-fedora32:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/testing/docker/fedora32/build/docker-compose.yml b/testing/docker/fedora32/build/docker-compose.yml new file mode 100644 index 0000000..1b0b8d0 --- /dev/null +++ b/testing/docker/fedora32/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-build-fedora32:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Build_Fedora32 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/testing/docker/fedora32/build/readme.rst b/testing/docker/fedora32/build/readme.rst new file mode 100644 index 0000000..d593fe6 --- /dev/null +++ b/testing/docker/fedora32/build/readme.rst @@ -0,0 +1,43 @@ +================================== +Image for building/releasing SCons +================================== + +This folder contains the files and scripts that can be used to +build and release SCons, based on a Fedora 32. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_build_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the build image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_build_shell.sh + +. + diff --git a/testing/docker/fedora32/build/start_build_shell.sh b/testing/docker/fedora32/build/start_build_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/testing/docker/fedora32/build/start_build_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/testing/docker/fedora32/build/startup/setup_container.sh b/testing/docker/fedora32/build/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/testing/docker/fedora32/build/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/testing/docker/fedora32/build/stop_build_shell.sh b/testing/docker/fedora32/build/stop_build_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/testing/docker/fedora32/build/stop_build_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + diff --git a/testing/docker/fedora32/test/Dockerfile b/testing/docker/fedora32/test/Dockerfile new file mode 100644 index 0000000..694810e --- /dev/null +++ b/testing/docker/fedora32/test/Dockerfile @@ -0,0 +1,10 @@ +# Building an SCons Test image under Fedora 32 +FROM fedora:32 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on a Fedora 32" + +# Install additional packages +RUN dnf -y install git bison cvs flex g++ gcc ghostscript m4 openssh-clients openssh-server python3-line_profiler python3-devel pypy3-devel rpm-build rcs java-1.8.0-openjdk swig texlive-scheme-basic texlive-base texlive-latex zip xterm vim vim-common nano + +CMD ["/bin/bash"] + diff --git a/testing/docker/fedora32/test/build_image.sh b/testing/docker/fedora32/test/build_image.sh new file mode 100755 index 0000000..9a97878 --- /dev/null +++ b/testing/docker/fedora32/test/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-test-fedora32:latest -t scons-test-fedora32:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/testing/docker/fedora32/test/docker-compose.yml b/testing/docker/fedora32/test/docker-compose.yml new file mode 100644 index 0000000..7d25992 --- /dev/null +++ b/testing/docker/fedora32/test/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-test-fedora32:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Test_Fedora32 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/testing/docker/fedora32/test/readme.rst b/testing/docker/fedora32/test/readme.rst new file mode 100644 index 0000000..da91176 --- /dev/null +++ b/testing/docker/fedora32/test/readme.rst @@ -0,0 +1,43 @@ +======================= +Image for testing SCons +======================= + +This folder contains the files and scripts that can be used to +test SCons, based on a Fedora 32. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_test_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the test image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_test_shell.sh + +. + diff --git a/testing/docker/fedora32/test/start_test_shell.sh b/testing/docker/fedora32/test/start_test_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/testing/docker/fedora32/test/start_test_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/testing/docker/fedora32/test/startup/setup_container.sh b/testing/docker/fedora32/test/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/testing/docker/fedora32/test/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/testing/docker/fedora32/test/stop_test_shell.sh b/testing/docker/fedora32/test/stop_test_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/testing/docker/fedora32/test/stop_test_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + -- cgit v0.12 From dc545b517c3d6dc0effea0343c07bd8e3ba19032 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 13 Jun 2020 21:12:04 -0700 Subject: Fix Issue #3693 - change compilation db field 'target' to 'output' per spec --- SCons/Tool/compilation_db.py | 18 +++++++++--------- SCons/Tool/compilation_db.xml | 2 +- test/CompilationDatabase/basic.py | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index 171e7f1..c5b839b 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -84,7 +84,7 @@ def make_emit_compilation_DB_entry(comstr): entry = env.__COMPILATIONDB_Entry( target=dbtarget, source=[], - __COMPILATIONDB_UTARGET=target, + __COMPILATIONDB_UOUTPUT=target, __COMPILATIONDB_USOURCE=source, __COMPILATIONDB_UACTION=user_action, __COMPILATIONDB_ENV=env, @@ -116,7 +116,7 @@ def compilation_db_entry_action(target, source, env, **kw): """ command = env["__COMPILATIONDB_UACTION"].strfunction( - target=env["__COMPILATIONDB_UTARGET"], + target=env["__COMPILATIONDB_UOUTPUT"], source=env["__COMPILATIONDB_USOURCE"], env=env["__COMPILATIONDB_ENV"], ) @@ -125,7 +125,7 @@ def compilation_db_entry_action(target, source, env, **kw): "directory": env.Dir("#").abspath, "command": command, "file": env["__COMPILATIONDB_USOURCE"][0], - "target": env['__COMPILATIONDB_UTARGET'][0] + "output": env['__COMPILATIONDB_UOUTPUT'][0] } target[0].write(entry) @@ -139,25 +139,25 @@ def write_compilation_db(target, source, env): for s in __COMPILATION_DB_ENTRIES: entry = s.read() source_file = entry['file'] - target_file = entry['target'] + output_file = entry['output'] if use_abspath: source_file = source_file.abspath - target_file = target_file.abspath + output_file = output_file.abspath else: source_file = source_file.path - target_file = target_file.path + output_file = output_file.path path_entry = {'directory': entry['directory'], 'command': entry['command'], 'file': source_file, - 'target': target_file} + 'output': output_file} entries.append(path_entry) - with open(target[0].path, "w") as target_file: + with open(target[0].path, "w") as output_file: json.dump( - entries, target_file, sort_keys=True, indent=4, separators=(",", ": ") + entries, output_file, sort_keys=True, indent=4, separators=(",", ": ") ) diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index e5102ce..2d670ae 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -101,7 +101,7 @@ env.CompilationDatabase('my_output.json') - + diff --git a/test/CompilationDatabase/basic.py b/test/CompilationDatabase/basic.py index b06098b..21c883b 100644 --- a/test/CompilationDatabase/basic.py +++ b/test/CompilationDatabase/basic.py @@ -63,7 +63,7 @@ example_rel_file = """[ "command": "%s mygcc.py cc -o test_main.o -c test_main.c", "directory": "%s", "file": "test_main.c", - "target": "test_main.o" + "output": "test_main.o" } ]""" % (sys.executable, test.workdir) @@ -77,7 +77,7 @@ example_abs_file = """[ "command": "%s mygcc.py cc -o test_main.o -c test_main.c", "directory": "%s", "file": "%s/test_main.c", - "target": "%s/test_main.o" + "output": "%s/test_main.o" } ]""" % (sys.executable, test.workdir, test.workdir, test.workdir) -- cgit v0.12 From f8a50bf20beaaea693c8e9b1add33c4ece2c7aac Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 13 Jun 2020 21:13:04 -0700 Subject: Fix Issue #3693 - doc fix --- SCons/Tool/compilation_db.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCons/Tool/compilation_db.xml b/SCons/Tool/compilation_db.xml index 2d670ae..13db65e 100644 --- a/SCons/Tool/compilation_db.xml +++ b/SCons/Tool/compilation_db.xml @@ -32,7 +32,7 @@ See its __doc__ string for a discussion of the format. COMPILATIONDB_COMSTR __COMPILATIONDB_UACTION - __COMPILATIONDB_UTARGET + __COMPILATIONDB_UOUTPUT __COMPILATIONDB_USOURCE __COMPILATIONDB_ENV COMPILATIONDB_USE_ABSPATH -- cgit v0.12 From 63d30277f2a898a57344caaba7ac96894f104fe4 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 12 Jun 2020 11:02:49 -0600 Subject: Cleanups in tests and in framework * Some Py2/Py3 compat blocks were simplified to Py3 only * some sequences of define-cleaup-function + atexit.register were changed to use the decorator (this works if func needs to take no arguments) * Lightly update a bunch of docstrings in TestCmd, and reformat a few places, towards the style we're generally using now. * call_python() in TestCmdTests was modernized to use subprocess.run Signed-off-by: Mats Wichmann --- test/SConscript/SConscript.py | 5 +- test/option/option_profile.py | 13 +- test/redirection.py | 12 +- testing/framework/TestCmd.py | 364 +++++++++++++++++++------------------- testing/framework/TestCmdTests.py | 113 +++++------- testing/framework/TestCommon.py | 8 +- testing/framework/TestSCons.py | 2 +- 7 files changed, 230 insertions(+), 287 deletions(-) diff --git a/test/SConscript/SConscript.py b/test/SConscript/SConscript.py index fd8511d..a9ede48 100644 --- a/test/SConscript/SConscript.py +++ b/test/SConscript/SConscript.py @@ -34,6 +34,7 @@ test.write('foo.py', "foo = 4\n") test.write('SConstruct', """\ import os import foo +from collections import UserList assert foo.foo == 4 @@ -71,10 +72,6 @@ assert foo == "subdir/SConscript foo" SConscript('SConscript5') -try: - from collections import UserList -except ImportError: - from UserList import UserList x7 = "SConstruct x7" x8 = "SConstruct x8" x9 = SConscript('SConscript6', UserList(["x7", "x8"])) diff --git a/test/option/option_profile.py b/test/option/option_profile.py index c252b39..8c7d80a 100644 --- a/test/option/option_profile.py +++ b/test/option/option_profile.py @@ -24,18 +24,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import sys - -# TODO: Fixup StringIO usage when Py2.7 is dropped. -# cheat a little bit: io.StringIO is "preferred" in Py2.7 -# since it forces you to be explicit about strings (it is unicode-only) -# It's easier to use the unaware version. Which also doesn't come -# with a context manager, so use contextlib.closing -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO import contextlib +import sys +from io import StringIO import TestSCons diff --git a/test/redirection.py b/test/redirection.py index 0960dfd..0512e44 100644 --- a/test/redirection.py +++ b/test/redirection.py @@ -32,7 +32,6 @@ test = TestSCons.TestSCons() test.write('cat.py', r""" import sys -PY3K = sys.version_info >= (3, 0) # write binary to stdout if sys.platform == "win32": @@ -45,17 +44,10 @@ try: with open(sys.argv[1], 'rb') as f: indata = f.read() except IndexError: - if PY3K: - source = sys.stdin.buffer - else: - source = sys.stdin + source = sys.stdin indata = source.read() -if PY3K: - sys.stdout.buffer.write(indata) -else: - sys.stdout.write(indata) - +sys.stdout.buffer.write(indata) sys.exit(0) """) diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index f980881..613f0e4 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -18,19 +18,21 @@ A TestCmd environment object is created via the usual invocation: There are a bunch of keyword arguments available at instantiation: - test = TestCmd.TestCmd(description = 'string', - program = 'program_or_script_to_test', - interpreter = 'script_interpreter', - workdir = 'prefix', - subdir = 'subdir', - verbose = Boolean, - match = default_match_function, - match_stdout = default_match_stdout_function, - match_stderr = default_match_stderr_function, - diff = default_diff_stderr_function, - diff_stdout = default_diff_stdout_function, - diff_stderr = default_diff_stderr_function, - combine = Boolean) + test = TestCmd.TestCmd( + description='string', + program='program_or_script_to_test', + interpreter='script_interpreter', + workdir='prefix', + subdir='subdir', + verbose=Boolean, + match=default_match_function, + match_stdout=default_match_stdout_function, + match_stderr=default_match_stderr_function, + diff=default_diff_stderr_function, + diff_stdout=default_diff_stdout_function, + diff_stderr=default_diff_stderr_function, + combine=Boolean, + ) There are a bunch of methods that let you do different things: @@ -68,21 +70,27 @@ There are a bunch of methods that let you do different things: test.cleanup(condition) - test.command_args(program = 'program_or_script_to_run', - interpreter = 'script_interpreter', - arguments = 'arguments to pass to program') - - test.run(program = 'program_or_script_to_run', - interpreter = 'script_interpreter', - arguments = 'arguments to pass to program', - chdir = 'directory_to_chdir_to', - stdin = 'input to feed to the program\n') - universal_newlines = True) - - p = test.start(program = 'program_or_script_to_run', - interpreter = 'script_interpreter', - arguments = 'arguments to pass to program', - universal_newlines = None) + test.command_args( + program='program_or_script_to_run', + interpreter='script_interpreter', + arguments='arguments to pass to program', + ) + + test.run( + program='program_or_script_to_run', + interpreter='script_interpreter', + arguments='arguments to pass to program', + chdir='directory_to_chdir_to', + stdin='input to feed to the program\n', + universal_newlines=True, + ) + + p = test.start( + program='program_or_script_to_run', + interpreter='script_interpreter', + arguments='arguments to pass to program', + universal_newlines=None, + ) test.finish(self, p) @@ -181,84 +189,82 @@ matching in the same way as the match_*() methods described above. import TestCmd - test = TestCmd.TestCmd(match = TestCmd.match_exact) + test = TestCmd.TestCmd(match=TestCmd.match_exact) - test = TestCmd.TestCmd(match = TestCmd.match_caseinsensitive) + test = TestCmd.TestCmd(match=TestCmd.match_caseinsensitive) - test = TestCmd.TestCmd(match = TestCmd.match_re) + test = TestCmd.TestCmd(match=TestCmd.match_re) - test = TestCmd.TestCmd(match = TestCmd.match_re_dotall) + test = TestCmd.TestCmd(match=TestCmd.match_re_dotall) These functions are also available as static methods: import TestCmd - test = TestCmd.TestCmd(match = TestCmd.TestCmd.match_exact) + test = TestCmd.TestCmd(match=TestCmd.TestCmd.match_exact) - test = TestCmd.TestCmd(match = TestCmd.TestCmd.match_caseinsensitive) + test = TestCmd.TestCmd(match=TestCmd.TestCmd.match_caseinsensitive) - test = TestCmd.TestCmd(match = TestCmd.TestCmd.match_re) + test = TestCmd.TestCmd(match=TestCmd.TestCmd.match_re) - test = TestCmd.TestCmd(match = TestCmd.TestCmd.match_re_dotall) + test = TestCmd.TestCmd(match=TestCmd.TestCmd.match_re_dotall) These static methods can be accessed by a string naming the method: import TestCmd - test = TestCmd.TestCmd(match = 'match_exact') + test = TestCmd.TestCmd(match='match_exact') - test = TestCmd.TestCmd(match = 'match_caseinsensitive') + test = TestCmd.TestCmd(match='match_caseinsensitive') - test = TestCmd.TestCmd(match = 'match_re') + test = TestCmd.TestCmd(match='match_re') - test = TestCmd.TestCmd(match = 'match_re_dotall') + test = TestCmd.TestCmd(match='match_re_dotall') The TestCmd module provides unbound global functions that can be used for the "diff" argument to TestCmd.TestCmd instantiation: import TestCmd - test = TestCmd.TestCmd(match = TestCmd.match_re, - diff = TestCmd.diff_re) + test = TestCmd.TestCmd(match=TestCmd.match_re, diff=TestCmd.diff_re) - test = TestCmd.TestCmd(diff = TestCmd.simple_diff) + test = TestCmd.TestCmd(diff=TestCmd.simple_diff) - test = TestCmd.TestCmd(diff = TestCmd.context_diff) + test = TestCmd.TestCmd(diff=TestCmd.context_diff) - test = TestCmd.TestCmd(diff = TestCmd.unified_diff) + test = TestCmd.TestCmd(diff=TestCmd.unified_diff) These functions are also available as static methods: import TestCmd - test = TestCmd.TestCmd(match = TestCmd.TestCmd.match_re, - diff = TestCmd.TestCmd.diff_re) + test = TestCmd.TestCmd(match=TestCmd.TestCmd.match_re, diff=TestCmd.TestCmd.diff_re) - test = TestCmd.TestCmd(diff = TestCmd.TestCmd.simple_diff) + test = TestCmd.TestCmd(diff=TestCmd.TestCmd.simple_diff) - test = TestCmd.TestCmd(diff = TestCmd.TestCmd.context_diff) + test = TestCmd.TestCmd(diff=TestCmd.TestCmd.context_diff) - test = TestCmd.TestCmd(diff = TestCmd.TestCmd.unified_diff) + test = TestCmd.TestCmd(diff=TestCmd.TestCmd.unified_diff) These static methods can be accessed by a string naming the method: import TestCmd - test = TestCmd.TestCmd(match = 'match_re', diff = 'diff_re') + test = TestCmd.TestCmd(match='match_re', diff='diff_re') - test = TestCmd.TestCmd(diff = 'simple_diff') + test = TestCmd.TestCmd(diff='simple_diff') - test = TestCmd.TestCmd(diff = 'context_diff') + test = TestCmd.TestCmd(diff='context_diff') - test = TestCmd.TestCmd(diff = 'unified_diff') + test = TestCmd.TestCmd(diff='unified_diff') The "diff" argument can also be used with standard difflib functions: import difflib - test = TestCmd.TestCmd(diff = difflib.context_diff) + test = TestCmd.TestCmd(diff=difflib.context_diff) - test = TestCmd.TestCmd(diff = difflib.unified_diff) + test = TestCmd.TestCmd(diff=difflib.unified_diff) Lastly, the where_is() method also exists in an unbound function version. @@ -296,7 +302,6 @@ import errno import os import re import shutil -import signal import stat import subprocess import sys @@ -305,24 +310,18 @@ import threading import time import traceback import types +from collections import UserList, UserString +from subprocess import PIPE, STDOUT IS_WINDOWS = sys.platform == 'win32' IS_64_BIT = sys.maxsize > 2**32 IS_PYPY = hasattr(sys, 'pypy_translation_info') -class null: - pass +# sentinel for cases where None won't do +_Null = object() -_Null = null() - -try: - from collections import UserList, UserString -except ImportError: - # no 'collections' module or no UserFoo in collections - exec('from UserList import UserList') - exec('from UserString import UserString') __all__ = [ 'diff_re', @@ -385,7 +384,7 @@ def _caller(tblist, skip): return string -def fail_test(self=None, condition=1, function=None, skip=0, message=None): +def fail_test(self=None, condition=True, function=None, skip=0, message=None): """Cause the test to fail. By default, the fail_test() method reports that the test FAILED @@ -394,12 +393,12 @@ def fail_test(self=None, condition=1, function=None, skip=0, message=None): """ if not condition: return - if not function is None: + if function is not None: function() of = "" desc = "" sep = " " - if not self is None: + if self is not None: if self.program: of = " of " + self.program sep = "\n\t" @@ -417,7 +416,7 @@ def fail_test(self=None, condition=1, function=None, skip=0, message=None): sys.exit(1) -def no_result(self=None, condition=1, function=None, skip=0): +def no_result(self=None, condition=True, function=None, skip=0): """Causes a test to exit with no valid result. By default, the no_result() method reports NO RESULT for the test @@ -426,12 +425,12 @@ def no_result(self=None, condition=1, function=None, skip=0): """ if not condition: return - if not function is None: + if function is not None: function() of = "" desc = "" sep = " " - if not self is None: + if self is not None: if self.program: of = " of " + self.program sep = "\n\t" @@ -445,7 +444,7 @@ def no_result(self=None, condition=1, function=None, skip=0): sys.exit(2) -def pass_test(self=None, condition=1, function=None): +def pass_test(self=None, condition=True, function=None): """Causes a test to pass. By default, the pass_test() method reports PASSED for the test @@ -454,15 +453,14 @@ def pass_test(self=None, condition=1, function=None): """ if not condition: return - if not function is None: + if function is not None: function() sys.stderr.write("PASSED\n") sys.exit(0) def match_exact(lines=None, matches=None, newline=os.sep): - """ - Match function using exact match. + """Match function using exact match. :param lines: data lines :type lines: str or list[str] @@ -470,8 +468,8 @@ def match_exact(lines=None, matches=None, newline=os.sep): :type matches: str or list[str] :param newline: line separator :returns: an object (1) on match, else None, like re.match - """ + """ if isinstance(lines, bytes) or bytes is str: newline = to_bytes(newline) @@ -488,8 +486,7 @@ def match_exact(lines=None, matches=None, newline=os.sep): def match_caseinsensitive(lines=None, matches=None): - """ - Match function using case-insensitive matching. + """Match function using case-insensitive matching. Only a simplistic comparison is done, based on casefolding the strings. This may still fail but is the suggestion of @@ -501,6 +498,7 @@ def match_caseinsensitive(lines=None, matches=None): :type matches: str or list[str] :returns: True or False :returns: an object (1) on match, else None, like re.match + """ if not is_List(lines): lines = lines.split("\n") @@ -515,14 +513,14 @@ def match_caseinsensitive(lines=None, matches=None): def match_re(lines=None, res=None): - """ - Match function using line-by-line regular expression match. + """Match function using line-by-line regular expression match. :param lines: data lines :type lines: str or list[str] :param res: regular expression(s) for matching :type res: str or list[str] :returns: an object (1) on match, else None, like re.match + """ if not is_List(lines): # CRs mess up matching (Windows) so split carefully @@ -547,8 +545,7 @@ def match_re(lines=None, res=None): def match_re_dotall(lines=None, res=None): - """ - Match function using regular expression match. + """Match function using regular expression match. Unlike match_re, the arguments are converted to strings (if necessary) and must match exactly. @@ -558,6 +555,7 @@ def match_re_dotall(lines=None, res=None): :param res: regular expression(s) for matching :type res: str or list[str] :returns: a match object, or None as for re.match + """ if not isinstance(lines, str): lines = "\n".join(lines) @@ -574,8 +572,7 @@ def match_re_dotall(lines=None, res=None): def simple_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=0, lineterm=''): - r""" - Compare two sequences of lines; generate the delta as a simple diff. + r"""Compare two sequences of lines; generate the delta as a simple diff. Similar to difflib.context_diff and difflib.unified_diff but output is like from the 'diff" command without arguments. The function @@ -627,8 +624,7 @@ def simple_diff(a, b, fromfile='', tofile='', def diff_re(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'): - """ - Compare a and b (lists of strings) where a are regexes. + """Compare a and b (lists of strings) where a are regexes. A simple "diff" of two sets of lines when the expected lines are regular expressions. This is a really dumb thing that @@ -733,8 +729,6 @@ else: # ASPN : Python Cookbook : Module to allow Asynchronous subprocess use on Windows and Posix platforms # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 -PIPE = subprocess.PIPE - if sys.platform == 'win32': # and subprocess.mswindows: try: from win32file import ReadFile, WriteFile @@ -893,7 +887,7 @@ class Popen(subprocess.Popen): # r = self._translate_newlines(r) return r finally: - if not conn.closed and not flags is None: + if not conn.closed and flags is not None: fcntl.fcntl(conn, fcntl.F_SETFL, flags) @@ -934,6 +928,7 @@ def send_all(p, data): _Cleanup = [] +@atexit.register def _clean(): global _Cleanup cleanlist = [c for c in _Cleanup if c] @@ -943,28 +938,28 @@ def _clean(): test.cleanup() -atexit.register(_clean) - - class TestCmd: """Class TestCmd """ - def __init__(self, description=None, - program=None, - interpreter=None, - workdir=None, - subdir=None, - verbose=None, - match=None, - match_stdout=None, - match_stderr=None, - diff=None, - diff_stdout=None, - diff_stderr=None, - combine=0, - universal_newlines=True, - timeout=None): + def __init__( + self, + description=None, + program=None, + interpreter=None, + workdir=None, + subdir=None, + verbose=None, + match=None, + match_stdout=None, + match_stderr=None, + diff=None, + diff_stdout=None, + diff_stderr=None, + combine=0, + universal_newlines=True, + timeout=None, + ): self.external = os.environ.get('SCONS_EXTERNAL_TEST', 0) self._cwd = os.getcwd() self.description_set(description) @@ -1039,14 +1034,14 @@ class TestCmd: return path def chmod(self, path, mode): - """Changes permissions on the specified file or directory - path name.""" + """Changes permissions on the specified file or directory.""" path = self.canonicalize(path) os.chmod(path, mode) def cleanup(self, condition=None): - """Removes any temporary working directories for the specified - TestCmd environment. If the environment variable PRESERVE was + """Removes any temporary working directories. + + Cleans the TestCmd instance. If the environment variable PRESERVE was set when the TestCmd environment was created, temporary working directories are not removed. If any of the environment variables PRESERVE_PASS, PRESERVE_FAIL, or PRESERVE_NO_RESULT were set @@ -1080,9 +1075,7 @@ class TestCmd: if self in _Cleanup: _Cleanup.remove(self) - def command_args(self, program=None, - interpreter=None, - arguments=None): + def command_args(self, program=None, interpreter=None, arguments=None): if not self.external: if program: if isinstance(program, str) and not os.path.isabs(program): @@ -1110,13 +1103,11 @@ class TestCmd: return cmd def description_set(self, description): - """Set the description of the functionality being tested. - """ + """Set the description of the functionality being tested. """ self.description = description def set_diff_function(self, diff=_Null, stdout=_Null, stderr=_Null): - """Sets the specified diff functions. - """ + """Sets the specified diff functions.""" if diff is not _Null: self._diff_function = diff if stdout is not _Null: @@ -1145,8 +1136,7 @@ class TestCmd: print(line) def diff_stderr(self, a, b, *args, **kw): - """Compare actual and expected file contents. - """ + """Compare actual and expected file contents.""" try: diff_stderr_function = getattr(self, self._diff_stderr_function) except TypeError: @@ -1154,8 +1144,7 @@ class TestCmd: return self.diff(a, b, diff_function=diff_stderr_function, *args, **kw) def diff_stdout(self, a, b, *args, **kw): - """Compare actual and expected file contents. - """ + """Compare actual and expected file contents.""" try: diff_stdout_function = getattr(self, self._diff_stdout_function) except TypeError: @@ -1170,9 +1159,8 @@ class TestCmd: unified_diff = staticmethod(difflib.unified_diff) - def fail_test(self, condition=1, function=None, skip=0, message=None): - """Cause the test to fail. - """ + def fail_test(self, condition=True, function=None, skip=0, message=None): + """Cause the test to fail.""" if not condition: return self.condition = 'fail_test' @@ -1189,8 +1177,7 @@ class TestCmd: self.interpreter = interpreter def set_match_function(self, match=_Null, stdout=_Null, stderr=_Null): - """Sets the specified match functions. - """ + """Sets the specified match functions. """ if match is not _Null: self._match_function = match if stdout is not _Null: @@ -1199,8 +1186,7 @@ class TestCmd: self._match_stderr_function = stderr def match(self, lines, matches): - """Compare actual and expected file contents. - """ + """Compare actual and expected file contents.""" try: match_function = getattr(self, self._match_function) except TypeError: @@ -1211,8 +1197,7 @@ class TestCmd: return match_function(lines, matches) def match_stderr(self, lines, matches): - """Compare actual and expected file contents. - """ + """Compare actual and expected file contents.""" try: match_stderr_function = getattr(self, self._match_stderr_function) except TypeError: @@ -1242,9 +1227,8 @@ class TestCmd: match_re_dotall = staticmethod(match_re_dotall) - def no_result(self, condition=1, function=None, skip=0): - """Report that the test could not be run. - """ + def no_result(self, condition=True, function=None, skip=0): + """Report that the test could not be run.""" if not condition: return self.condition = 'no_result' @@ -1253,7 +1237,7 @@ class TestCmd: function=function, skip=skip) - def pass_test(self, condition=1, function=None): + def pass_test(self, condition=True, function=None): """Cause the test to pass. """ if not condition: @@ -1262,7 +1246,9 @@ class TestCmd: pass_test(self=self, condition=condition, function=function) def preserve(self, *conditions): - """Arrange for the temporary working directories for the + """Preserves temporary working directories. + + Arrange for the temporary working directories for the specified TestCmd environment to be preserved for one or more conditions. If no conditions are specified, arranges for the temporary working directories to be preserved for all @@ -1274,8 +1260,7 @@ class TestCmd: self._preserve[cond] = 1 def program_set(self, program): - """Set the executable program or script to be tested. - """ + """Sets the executable program or script to be tested.""" if not self.external: if program and not os.path.isabs(program): program = os.path.join(self._cwd, program) @@ -1323,8 +1308,7 @@ class TestCmd: self.timer = None def parse_path(self, path, suppress_current=False): - """Return a list with the single path components of path. - """ + """Return a list with the single path components of path.""" head, tail = os.path.split(path) result = [] if not tail: @@ -1463,13 +1447,13 @@ class TestCmd: # So don't use a pipe for stdin if we don't need one. stdin = kw.get('stdin', None) if stdin is not None: - stdin = subprocess.PIPE + stdin = PIPE combine = kw.get('combine', self.combine) if combine: - stderr_value = subprocess.STDOUT + stderr_value = STDOUT else: - stderr_value = subprocess.PIPE + stderr_value = PIPE if timeout is _Null: timeout = self.timeout @@ -1489,7 +1473,7 @@ class TestCmd: # if encoding is set.hg c p = Popen(cmd, stdin=stdin, - stdout=subprocess.PIPE, + stdout=PIPE, stderr=stderr_value, env=os.environ, universal_newlines=False) @@ -1499,8 +1483,7 @@ class TestCmd: @staticmethod def fix_binary_stream(stream): - """ - Handle stdout/stderr from popen when we specify not universal_newlines + """Handle stream from popen when we specify not universal_newlines This will read from the pipes in binary mode, will not decode the output, and will not convert line endings to \n. @@ -1517,15 +1500,14 @@ class TestCmd: if not stream: return stream # It seems that py3.6 still sets text mode if you set encoding. - # was: if IS_PY3: # TODO and sys.version_info[1] < 6: stream = stream.decode('utf-8', errors='replace') return stream.replace('\r\n', '\n') def finish(self, popen=None, **kw): - """ - Finishes and waits for the process being run under control of - the specified popen argument, recording the exit status, - standard output and error output. + """ Finishes and waits for the process. + + Process being run under control of the specified popen argument + is waited for, recording the exit status, output and error output. """ if popen is None: popen = self.process @@ -1549,9 +1531,10 @@ class TestCmd: stdin=None, universal_newlines=None, timeout=_Null): - """Runs a test of the program or script for the test - environment. Standard output and error output are saved for - future retrieval via the stdout() and stderr() methods. + """Runs a test of the program or script for the test environment. + + Output and error output are saved for future retrieval via + the stdout() and stderr() methods. The specified program will have the original directory prepended unless it is enclosed in a [list]. @@ -1581,7 +1564,6 @@ class TestCmd: if is_List(stdin): stdin = ''.join(stdin) - # TODO: was: if stdin and IS_PY3:# and sys.version_info[1] < 6: if stdin: stdin = to_bytes(stdin) @@ -1621,8 +1603,9 @@ class TestCmd: write('============ END STDERR\n') def sleep(self, seconds=default_sleep_seconds): - """Sleeps at least the specified number of seconds. If no - number is specified, sleeps at least the minimum number of + """Sleeps at least the specified number of seconds. + + If no number is specified, sleeps at least the minimum number of seconds necessary to advance file time stamps on the current system. Sleeping more seconds is all right. """ @@ -1630,6 +1613,7 @@ class TestCmd: def stderr(self, run=None): """Returns the error output from the specified run number. + If there is no specified run number, then returns the error output of the last run. If the run number is less than zero, then returns the error output from that many runs back from the @@ -1643,8 +1627,7 @@ class TestCmd: return self._stderr[run] def stdout(self, run=None): - """ - Returns the stored standard output from a given run. + """Returns the stored standard output from a given run. Args: run: run number to select. If run number is omitted, @@ -1667,13 +1650,14 @@ class TestCmd: return None def subdir(self, *subdirs): - """Create new subdirectories under the temporary working - directory, one for each argument. An argument may be a list, + """Creates new subdirectories under the temporary working directory. + + Creates a subdir for each argument. An argument may be a list, in which case the list elements are concatenated using the os.path.join() method. Subdirectories multiple levels deep must be created using a separate argument for each level: - test.subdir('sub', ['sub', 'dir'], ['sub', 'dir', 'ectory']) + test.subdir('sub', ['sub', 'dir'], ['sub', 'dir', 'ectory']) Returns the number of subdirectories actually created. """ @@ -1695,6 +1679,7 @@ class TestCmd: def symlink(self, target, link): """Creates a symlink to the specified target. + The link name may be a list, in which case the elements are concatenated with the os.path.join() method. The link is assumed to be under the temporary working directory unless it @@ -1714,6 +1699,7 @@ class TestCmd: def tempdir(self, path=None): """Creates a temporary directory. + A unique directory name is generated if no path name is specified. The directory is created, and will be removed when the TestCmd object is destroyed. @@ -1752,8 +1738,9 @@ class TestCmd: return path def touch(self, path, mtime=None): - """Updates the modification time on the specified file or - directory path name. The default is to update to the + """Updates the modification time on the specified file or directory. + + The default is to update to the current time if no explicit modification time is specified. """ path = self.canonicalize(path) @@ -1764,6 +1751,7 @@ class TestCmd: def unlink(self, file): """Unlinks the specified file name. + The file name may be a list, in which case the elements are concatenated with the os.path.join() method. The file is assumed to be under the temporary working directory unless it @@ -1773,13 +1761,11 @@ class TestCmd: os.unlink(file) def verbose_set(self, verbose): - """Set the verbose level. - """ + """Sets the verbose level.""" self.verbose = verbose def where_is(self, file, path=None, pathext=None): - """Find an executable file. - """ + """Finds an executable file.""" if is_List(file): file = os.path.join(*file) if not os.path.isabs(file): @@ -1787,9 +1773,9 @@ class TestCmd: return file def workdir_set(self, path): - """Creates a temporary working directory with the specified - path name. If the path is a null string (''), a unique - directory name is created. + """Creates a temporary working directory with the specified path name. + + If the path is a null string (''), a unique directory name is created. """ if path is not None: if path == '': @@ -1798,16 +1784,18 @@ class TestCmd: self.workdir = path def workpath(self, *args): - """Returns the absolute path name to a subdirectory or file - within the current temporary working directory. Concatenates - the temporary working directory name with the specified + """Returns the absolute path name to a subdirectory or file within the current temporary working directory. + + Concatenates the temporary working directory name with the specified arguments using the os.path.join() method. """ return os.path.join(self.workdir, *args) - def readable(self, top, read=1): - """Make the specified directory tree readable (read == 1) - or not (read == None). + def readable(self, top, read=True): + """Makes the specified directory tree readable or unreadable. + + Tree is made readable if `read` evaluates True (the default), + else it is made not readable. This method has no effect on Windows systems, which use a completely different mechanism to control file readability. @@ -1858,9 +1846,11 @@ class TestCmd: do_chmod(os.path.join(dirpath, name)) do_chmod(top) - def writable(self, top, write=1): - """Make the specified directory tree writable (write == 1) - or not (write == None). + def writable(self, top, write=True): + """Make the specified directory tree writable or unwritable. + + Tree is made writable if `write` evaluates True (the default), + else it is made not writable. """ if sys.platform == 'win32': @@ -1906,9 +1896,11 @@ class TestCmd: for name in dirnames + filenames: do_chmod(os.path.join(dirpath, name)) - def executable(self, top, execute=1): - """Make the specified directory tree executable (execute == 1) - or not (execute == None). + def executable(self, top, execute=True): + """Make the specified directory tree executable or not executable. + + Tree is made executable if `execute` evaluates True (the default), + else it is made not executable. This method has no effect on Windows systems, which use a completely different mechanism to control file executability. @@ -1960,7 +1952,7 @@ class TestCmd: do_chmod(top) def write(self, file, content, mode='wb'): - """Write data to file + """Writes data to file. The file is created under the temporary working directory. Any subdirectories in the path must already exist. The diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py index e8c2744..730f4a1 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -26,20 +26,16 @@ import os import shutil import signal import stat -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO -from contextlib import closing +import subprocess import sys import tempfile import time import types import unittest -try: - from collections import UserList -except ImportError: - from UserList import UserList +from io import StringIO +from contextlib import closing +from collections import UserList +from subprocess import PIPE from SCons.Util import to_bytes, to_str @@ -68,20 +64,6 @@ def _clear_dict(dict, *keys): except KeyError: pass -import subprocess - -try: - subprocess.Popen.terminate -except AttributeError: - if sys.platform == 'win32': - import win32process - def terminate(self): - win32process.TerminateProcess(self._handle, 1) - else: - def terminate(self): - os.kill(self.pid, signal.SIGTERM) - method = types.MethodType(terminate, None, subprocess.Popen) - setattr(subprocess.Popen, 'terminate', method) class ExitError(Exception): pass @@ -158,35 +140,39 @@ class TestCmdTestCase(unittest.TestCase): data = data.replace("\r\n", "\n") return data - def call_python(self, input, python=None): + def call_python(self, indata, python=None): if python is None: python = sys.executable - p = subprocess.Popen(python, - stdin=subprocess.PIPE, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE) - stdout, stderr = p.communicate(to_bytes(input)) - stdout = self.translate_newlines(to_str(stdout)) - stderr = self.translate_newlines(to_str(stderr)) - return stdout, stderr, p.returncode - - def popen_python(self, input, status=0, stdout="", stderr="", python=None): + cp = subprocess.run(python, input=to_bytes(indata), stderr=PIPE, stdout=PIPE) + stdout = self.translate_newlines(to_str(cp.stdout)) + stderr = self.translate_newlines(to_str(cp.stderr)) + return stdout, stderr, cp.returncode + + def popen_python(self, indata, status=0, stdout="", stderr="", python=None): if python is None: python = sys.executable - _stdout, _stderr, _status = self.call_python(input, python) - _stdout = self.translate_newlines(_stdout) - _stderr = self.translate_newlines(_stderr) - assert _status == status, \ - "status = %s, expected %s\n" % (str(_status), str(status)) + \ - "STDOUT ===================\n" + _stdout + \ - "STDERR ===================\n" + _stderr - assert _stdout == stdout, \ - "Expected STDOUT ==========\n" + stdout + \ - "Actual STDOUT ============\n" + _stdout + \ - "STDERR ===================\n" + _stderr - assert _stderr == stderr, \ - "Expected STDERR ==========\n" + stderr + \ - "Actual STDERR ============\n" + _stderr + _stdout, _stderr, _status = self.call_python(indata, python) + assert _status == status, ( + "status = %s, expected %s\n" % (str(_status), str(status)) + + "STDOUT ===================\n" + + _stdout + + "STDERR ===================\n" + + _stderr + ) + assert _stdout == stdout, ( + "Expected STDOUT ==========\n" + + stdout + + "Actual STDOUT ============\n" + + _stdout + + "STDERR ===================\n" + + _stderr + ) + assert _stderr == stderr, ( + "Expected STDERR ==========\n" + + stderr + + "Actual STDERR ============\n" + + _stderr + ) def run_match(self, content, *args): expect = "%s: %s: %s: %s\n" % args @@ -253,32 +239,21 @@ class cleanup_TestCase(TestCmdTestCase): shutil.rmtree = save_rmtree def test_atexit(self): - """Test cleanup() when atexit is used""" + """Test cleanup when atexit is used""" self.popen_python("""\ -import sys -sys.path = ['%s'] + sys.path import atexit -def my_exitfunc(): - print("my_exitfunc()") -atexit.register(my_exitfunc) +import sys import TestCmd -result = TestCmd.TestCmd(workdir = '') -sys.exit(0) -""" % self.orig_cwd, stdout='my_exitfunc()\n') - @unittest.skipIf(TestCmd.IS_PY3, "No sys.exitfunc in Python 3") - def test_exitfunc(self): - """Test cleanup() when sys.exitfunc is set""" - self.popen_python("""\ -import sys sys.path = ['%s'] + sys.path -def my_exitfunc(): - print("my_exitfunc()") -sys.exitfunc = my_exitfunc -import TestCmd -result = TestCmd.TestCmd(workdir = '') + +@atexit.register +def cleanup(): + print("cleanup()") + +result = TestCmd.TestCmd(workdir='') sys.exit(0) -""" % self.orig_cwd, stdout='my_exitfunc()\n') +""" % self.orig_cwd, stdout='cleanup()\n') class chmod_TestCase(TestCmdTestCase): @@ -2518,7 +2493,7 @@ script_recv: STDERR: input stderr = test.stderr() assert stderr == expect_stderr, stderr - p = test.start(combine=1, stdin=1) + p = test.start(combine=True, stdin=1) p.send('input\n') test.finish(p) expect_stdout = """\ diff --git a/testing/framework/TestCommon.py b/testing/framework/TestCommon.py index 1bd9f6b..9c4d116 100644 --- a/testing/framework/TestCommon.py +++ b/testing/framework/TestCommon.py @@ -98,16 +98,12 @@ __revision__ = "TestCommon.py 1.3.D001 2010/06/03 12:58:27 knight" __version__ = "1.3" import copy +import glob import os import stat import sys -import glob -try: - from collections import UserList -except ImportError: - # no 'collections' module or no UserList in collections - exec('from UserList import UserList') +from collections import UserList from TestCmd import * from TestCmd import __all__ diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 8800c1b..00bddd2 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -319,7 +319,7 @@ class TestSCons(TestCommon): if not self.external: import SCons.Environment import SCons.Errors - if not ENV is None: + if ENV is not None: kw['ENV'] = ENV try: return SCons.Environment.Environment(*args, **kw) -- cgit v0.12 From af2e24f7e4d3cd1edc309838d17988b3752d7657 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 14 Jun 2020 12:57:31 -0600 Subject: Bugfix: to get raw data from stdin, use buffer Earlier change dropped PY3 version of code in cleanup - read sys.stdin.buffer, not sys.stdin Signed-off-by: Mats Wichmann --- test/redirection.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/redirection.py b/test/redirection.py index 0512e44..f30a2e3 100644 --- a/test/redirection.py +++ b/test/redirection.py @@ -39,13 +39,11 @@ if sys.platform == "win32": msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) - try: with open(sys.argv[1], 'rb') as f: indata = f.read() except IndexError: - source = sys.stdin - indata = source.read() + indata = sys.stdin.buffer.read() sys.stdout.buffer.write(indata) sys.exit(0) -- cgit v0.12 From f1bd5c6881fa739240d8ae8bd7a0d242b5c9500d Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jun 2020 15:47:55 -0700 Subject: Fix fake mylink.py was broken on win32. --- test/fixture/mylink.py | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/test/fixture/mylink.py b/test/fixture/mylink.py index fe4af58..6c56427 100644 --- a/test/fixture/mylink.py +++ b/test/fixture/mylink.py @@ -1,15 +1,40 @@ import getopt import sys -opts, args = getopt.getopt(sys.argv[1:], 'o:s:') -for opt, arg in opts: - if opt == '-o': - out = arg - -with open(out, 'w') as ofp: - for f in args: - with open(f, 'r') as ifp: - for line in ifp.readlines(): - if line[:5] != '#link': - ofp.write(line) -sys.exit(0) +def fake_link(): + opts, args = getopt.getopt(sys.argv[1:], 'o:s:') + for opt, arg in opts: + if opt == '-o': + out = arg + + with open(out, 'w') as ofp: + for f in args: + with open(f, 'r') as ifp: + for line in ifp.readlines(): + if line[:5] != '#link': + ofp.write(line) + sys.exit(0) + +def fake_win32_link(): + args = sys.argv[1:] + while args: + a = args[0] + if a == '-o': + out = args[1] + args = args[2:] + continue + if not a[0] in '/-': + break + args = args[1:] + if a[:5].lower() == '/out:': out = a[5:] + with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: + for l in ifp.readlines(): + if not l.startswith(b'#link'): + ofp.write(l) + sys.exit(0) + +if __name__ == '__main__': + if sys.platform == 'win32': + fake_win32_link() + else: + fake_link() -- cgit v0.12 From 87526d678662e2ce64047a370e514efe33a922e9 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jun 2020 17:00:51 -0700 Subject: [appveyor skip][travis skip] fix sider warning --- test/fixture/mylink.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fixture/mylink.py b/test/fixture/mylink.py index 6c56427..0fa47a9 100644 --- a/test/fixture/mylink.py +++ b/test/fixture/mylink.py @@ -28,9 +28,9 @@ def fake_win32_link(): args = args[1:] if a[:5].lower() == '/out:': out = a[5:] with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: - for l in ifp.readlines(): - if not l.startswith(b'#link'): - ofp.write(l) + for line in ifp.readlines(): + if not line.startswith(b'#link'): + ofp.write(line) sys.exit(0) if __name__ == '__main__': -- cgit v0.12 From 5bdc4682ed0972f8fb9d3c7bc50ce8e0004faef2 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jun 2020 17:03:57 -0700 Subject: [appveyor skip][travis skip] fix sider warning --- test/fixture/mylink.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/fixture/mylink.py b/test/fixture/mylink.py index 0fa47a9..19969f0 100644 --- a/test/fixture/mylink.py +++ b/test/fixture/mylink.py @@ -1,3 +1,6 @@ +""" +Dummy linker for use by tests" +""" import getopt import sys -- cgit v0.12 From 09925e59074a78b7b30af0be973e9abae11d2cde Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 10:33:54 -0700 Subject: Fix test for compilation_db to work on windows and linux --- test/CompilationDatabase/basic.py | 25 +++++++++++++++---------- test/CompilationDatabase/fixture/SConstruct | 1 + 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/test/CompilationDatabase/basic.py b/test/CompilationDatabase/basic.py index 21c883b..2f76752 100644 --- a/test/CompilationDatabase/basic.py +++ b/test/CompilationDatabase/basic.py @@ -27,15 +27,13 @@ and values of COMPILATIONDB_USE_ABSPATH """ import sys +import os +import os.path import TestSCons test = TestSCons.TestSCons() -if sys.platform == 'win32': - test.file_fixture('mylink_win32.py', 'mylink.py') -else: - test.file_fixture('mylink.py') - +test.file_fixture('mylink.py') test.file_fixture('mygcc.py') test.verbose_set(1) @@ -67,23 +65,30 @@ example_rel_file = """[ } ]""" % (sys.executable, test.workdir) +if sys.platform == 'win32': + example_rel_file = example_rel_file.replace('\\', '\\\\') + for f in rel_files: # print("Checking:%s" % f) test.must_exist(f) - test.must_match(f, example_rel_file) + test.must_match(f, example_rel_file, mode='r') example_abs_file = """[ { "command": "%s mygcc.py cc -o test_main.o -c test_main.c", "directory": "%s", - "file": "%s/test_main.c", - "output": "%s/test_main.o" + "file": "%s", + "output": "%s" } -]""" % (sys.executable, test.workdir, test.workdir, test.workdir) +]""" % (sys.executable, test.workdir, os.path.join(test.workdir, 'test_main.c'), os.path.join(test.workdir, 'test_main.o')) + +if sys.platform == 'win32': + example_abs_file = example_abs_file.replace('\\', '\\\\') + for f in abs_files: test.must_exist(f) - test.must_match(f, example_abs_file) + test.must_match(f, example_abs_file, mode='r') test.pass_test() diff --git a/test/CompilationDatabase/fixture/SConstruct b/test/CompilationDatabase/fixture/SConstruct index 4043b5a..ea23bc3 100644 --- a/test/CompilationDatabase/fixture/SConstruct +++ b/test/CompilationDatabase/fixture/SConstruct @@ -7,6 +7,7 @@ env = Environment( LINKFLAGS=[], CC='$PYTHON mygcc.py cc', CXX='$PYTHON mygcc.py c++', + tools=['gcc','g++','gnulink'], ) env.Tool('compilation_db') -- cgit v0.12 From 8969b8496af2fbde0fc2bb63ce3db71edd8d7475 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 10:51:55 -0700 Subject: Wrap SCons.Action._subproc() call with 'with' to prevent leaking popen object --- SCons/Tool/gcc.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/SCons/Tool/gcc.py b/SCons/Tool/gcc.py index 79b64f0..b530db2 100644 --- a/SCons/Tool/gcc.py +++ b/SCons/Tool/gcc.py @@ -77,22 +77,23 @@ def detect_version(env, cc): # GCC versions older than that, we should use --version and a # regular expression. # pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'], - pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'], + with SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'], stdin='devnull', stderr='devnull', - stdout=subprocess.PIPE) - if pipe.wait() != 0: - return version + stdout=subprocess.PIPE) as pipe: + if pipe.wait() != 0: + return version + + with pipe.stdout: + # -dumpversion variant: + # line = pipe.stdout.read().strip() + # --version variant: + line = SCons.Util.to_str(pipe.stdout.readline()) + # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer: + # So continue with reading to let the child process actually terminate. + while SCons.Util.to_str(pipe.stdout.readline()): + pass - with pipe.stdout: - # -dumpversion variant: - # line = pipe.stdout.read().strip() - # --version variant: - line = SCons.Util.to_str(pipe.stdout.readline()) - # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer: - # So continue with reading to let the child process actually terminate. - while SCons.Util.to_str(pipe.stdout.readline()): - pass # -dumpversion variant: # if line: -- cgit v0.12 From 0944be440ce687d828ff7838d5925c54ded2a48a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 12:10:36 -0700 Subject: remove context manager from Pipe() broke tests --- SCons/Tool/gcc.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/SCons/Tool/gcc.py b/SCons/Tool/gcc.py index b530db2..d56f6a0 100644 --- a/SCons/Tool/gcc.py +++ b/SCons/Tool/gcc.py @@ -77,22 +77,22 @@ def detect_version(env, cc): # GCC versions older than that, we should use --version and a # regular expression. # pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'], - with SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'], + pipe=SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'], stdin='devnull', stderr='devnull', - stdout=subprocess.PIPE) as pipe: - if pipe.wait() != 0: - return version - - with pipe.stdout: - # -dumpversion variant: - # line = pipe.stdout.read().strip() - # --version variant: - line = SCons.Util.to_str(pipe.stdout.readline()) - # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer: - # So continue with reading to let the child process actually terminate. - while SCons.Util.to_str(pipe.stdout.readline()): - pass + stdout=subprocess.PIPE) + if pipe.wait() != 0: + return version + + with pipe.stdout: + # -dumpversion variant: + # line = pipe.stdout.read().strip() + # --version variant: + line = SCons.Util.to_str(pipe.stdout.readline()) + # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer: + # So continue with reading to let the child process actually terminate. + while SCons.Util.to_str(pipe.stdout.readline()): + pass # -dumpversion variant: -- cgit v0.12 From 7204fefa17e0d7a894996801a5ae1ac820c76199 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 15:34:25 -0700 Subject: Add test for variant_dir with duplicate=True and False --- .../CompilationDatabase/fixture/SConstruct_variant | 40 +++++++ test/CompilationDatabase/variant_dir.py | 118 +++++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 test/CompilationDatabase/fixture/SConstruct_variant create mode 100644 test/CompilationDatabase/variant_dir.py diff --git a/test/CompilationDatabase/fixture/SConstruct_variant b/test/CompilationDatabase/fixture/SConstruct_variant new file mode 100644 index 0000000..f47c732 --- /dev/null +++ b/test/CompilationDatabase/fixture/SConstruct_variant @@ -0,0 +1,40 @@ +import sys + +DefaultEnvironment(tools=[]) +env = Environment( + PYTHON=sys.executable, + LINK='$PYTHON mylink.py', + LINKFLAGS=[], + CC='$PYTHON mygcc.py cc', + CXX='$PYTHON mygcc.py c++', + tools=['gcc','g++','gnulink'], +) +env.Tool('compilation_db') + +env_abs = env.Clone(COMPILATIONDB_USE_ABSPATH=True) +env_abs.CompilationDatabase('compile_commands_clone_abs.json') + +# Should be relative paths +env.CompilationDatabase('compile_commands_only_arg.json') +env.CompilationDatabase(target='compile_commands_target.json') + +# Should default name compile_commands.json +env.CompilationDatabase() + +# Should be absolute paths +env.CompilationDatabase('compile_commands_over_abs.json', COMPILATIONDB_USE_ABSPATH=True) +env.CompilationDatabase(target='compile_commands_target_over_abs.json', COMPILATIONDB_USE_ABSPATH=True) + +# Should be relative paths +env.CompilationDatabase('compile_commands_over_rel.json', COMPILATIONDB_USE_ABSPATH=False) + +# Try 1/0 for COMPILATIONDB_USE_ABSPATH +env.CompilationDatabase('compile_commands_over_abs_1.json', COMPILATIONDB_USE_ABSPATH=1) +env.CompilationDatabase('compile_commands_over_abs_0.json', COMPILATIONDB_USE_ABSPATH=0) + +env.VariantDir('build','src') +env.Program('build/main', 'build/test_main.c') + +env.VariantDir('build2','src', duplicate=0) +env.Program('build2/main', 'build2/test_main.c') + diff --git a/test/CompilationDatabase/variant_dir.py b/test/CompilationDatabase/variant_dir.py new file mode 100644 index 0000000..a36e516 --- /dev/null +++ b/test/CompilationDatabase/variant_dir.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +""" +Test CompilationDatabase and several variations of ways to call it +and values of COMPILATIONDB_USE_ABSPATH +""" + +import sys +import os +import os.path +import TestSCons + +test = TestSCons.TestSCons() + +test.file_fixture('mylink.py') +test.file_fixture('mygcc.py') + +test.verbose_set(1) +test.file_fixture('fixture/SConstruct_variant', 'SConstruct') +test.file_fixture('test_main.c', 'src/test_main.c') +test.run() + +rel_files = [ + 'compile_commands_only_arg.json', + 'compile_commands_target.json', + 'compile_commands.json', + 'compile_commands_over_rel.json', + 'compile_commands_over_abs_0.json' +] + +abs_files = [ + 'compile_commands_clone_abs.json', + 'compile_commands_over_abs.json', + 'compile_commands_target_over_abs.json', + 'compile_commands_over_abs_1.json', +] + +example_rel_file = """[ + { + "command": "%(exe)s mygcc.py cc -o %(output_file)s -c %(variant_src_file)s", + "directory": "%(workdir)s", + "file": "%(src_file)s", + "output": "%(output_file)s" + }, + { + "command": "%(exe)s mygcc.py cc -o %(output2_file)s -c %(src_file)s", + "directory": "%(workdir)s", + "file": "%(src_file)s", + "output": "%(output2_file)s" + } +]""" % {'exe': sys.executable, + 'workdir': test.workdir, + 'src_file': os.path.join('src', 'test_main.c'), + 'output_file': os.path.join('build', 'test_main.o'), + 'output2_file': os.path.join('build2', 'test_main.o'), + 'variant_src_file': os.path.join('build', 'test_main.c') + } + +if sys.platform == 'win32': + example_rel_file = example_rel_file.replace('\\', '\\\\') + +for f in rel_files: + # print("Checking:%s" % f) + test.must_exist(f) + test.must_match(f, example_rel_file, mode='r') + +example_abs_file = """[ + { + "command": "%(exe)s mygcc.py cc -o %(output_file)s -c %(variant_src_file)s", + "directory": "%(workdir)s", + "file": "%(abs_src_file)s", + "output": "%(abs_output_file)s" + }, + { + "command": "%(exe)s mygcc.py cc -o %(output2_file)s -c %(src_file)s", + "directory": "%(workdir)s", + "file": "%(abs_src_file)s", + "output": "%(abs_output2_file)s" + } +]""" % {'exe': sys.executable, + 'workdir': test.workdir, + 'src_file': os.path.join('src', 'test_main.c'), + 'abs_src_file': os.path.join(test.workdir, 'src', 'test_main.c'), + 'abs_output_file': os.path.join(test.workdir, 'build', 'test_main.o'), + 'abs_output2_file': os.path.join(test.workdir, 'build2', 'test_main.o'), + 'output_file': os.path.join('build', 'test_main.o'), + 'output2_file': os.path.join('build2', 'test_main.o'), + 'variant_src_file': os.path.join('build', 'test_main.c')} + +if sys.platform == 'win32': + example_abs_file = example_abs_file.replace('\\', '\\\\') + +for f in abs_files: + test.must_exist(f) + test.must_match(f, example_abs_file, mode='r') + +test.pass_test() -- cgit v0.12 From efc767061304a0bad93941ec6bd5d952cec4a7de Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 15:35:04 -0700 Subject: update to fix Issue #3694 properly handle source and output file names with variant dirs --- SCons/Tool/compilation_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SCons/Tool/compilation_db.py b/SCons/Tool/compilation_db.py index c5b839b..b610574 100644 --- a/SCons/Tool/compilation_db.py +++ b/SCons/Tool/compilation_db.py @@ -142,10 +142,10 @@ def write_compilation_db(target, source, env): output_file = entry['output'] if use_abspath: - source_file = source_file.abspath + source_file = source_file.srcnode().abspath output_file = output_file.abspath else: - source_file = source_file.path + source_file = source_file.srcnode().path output_file = output_file.path path_entry = {'directory': entry['directory'], -- cgit v0.12 From 3560673d7ce1706c52b81e51c79f4392aa15db3a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 15:36:13 -0700 Subject: add note about issues fixed in CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6fc1905..4921fe6 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -55,7 +55,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER tool. - Add CompilationDatabase() builder in compilation_db tool. Contributed by MongoDB. Setting COMPILATIONDB_USE_ABSPATH to True|False controls whether the files are absolute or relative - paths. + paths. Address Issue #3693 and #3694 found during development. From Andrii Doroshenko: - Extended `Environment.Dump()` to select a format to serialize construction variables (pretty, json). -- cgit v0.12 From e02a16a7d103b6af0543bba6919662f31434b4cb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 20:27:44 -0700 Subject: Fix Issue #3628 - limit pickle protocol to 4 --- CHANGES.txt | 2 ++ SCons/compat/__init__.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 4921fe6..ea6b2b3 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -56,6 +56,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Add CompilationDatabase() builder in compilation_db tool. Contributed by MongoDB. Setting COMPILATIONDB_USE_ABSPATH to True|False controls whether the files are absolute or relative paths. Address Issue #3693 and #3694 found during development. + - Fixed Github Issue 3628 - Hardcoding pickle protocol to 4 (supports python 3.4+) + and skipping Python 3.8's new pickle protocol 5 whose main advantage is for out-of-band data buffers From Andrii Doroshenko: - Extended `Environment.Dump()` to select a format to serialize construction variables (pretty, json). diff --git a/SCons/compat/__init__.py b/SCons/compat/__init__.py index abf663d..9fb4898 100644 --- a/SCons/compat/__init__.py +++ b/SCons/compat/__init__.py @@ -84,8 +84,9 @@ def rename_module(new, old): import pickle # Was pickle.HIGHEST_PROTOCOL -# Changed to 2 so py3.5+'s pickle will be compatible with py2.7. -PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL +# Changed to 4 so that python 3.8's not incompatible with previous versions +# Python 3.8 introduced protocol 5 which is mainly an improvement for for out-of-band data buffers +PICKLE_PROTOCOL = 4 import shutil try: -- cgit v0.12 From 3ad65d75728296ac2e695a067e2200b2a146183b Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 15 Jun 2020 20:33:31 -0700 Subject: [ci skip] Updated RELEASE.txt and CHANGES.txt with not about need to delete .sconsign.dblite if you ran a post 3.0.0 version with Python 3.8 --- CHANGES.txt | 4 +++- RELEASE.txt | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index ea6b2b3..d2ecca6 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -57,7 +57,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Setting COMPILATIONDB_USE_ABSPATH to True|False controls whether the files are absolute or relative paths. Address Issue #3693 and #3694 found during development. - Fixed Github Issue 3628 - Hardcoding pickle protocol to 4 (supports python 3.4+) - and skipping Python 3.8's new pickle protocol 5 whose main advantage is for out-of-band data buffers + and skipping Python 3.8's new pickle protocol 5 whose main advantage is for out-of-band data buffers. + NOTE: If you used Python 3.8 with SCons 3.0.0 or above, you may get a a pickle protocol error. Remove your + .sconsign.dblite. You will end up with a full rebuild. From Andrii Doroshenko: - Extended `Environment.Dump()` to select a format to serialize construction variables (pretty, json). diff --git a/RELEASE.txt b/RELEASE.txt index 843894b..6729ce8 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -17,6 +17,10 @@ when the value can't be converted to a string or if having a name is otherwise desirable. - Added a new flag called "linedraw" for the command line argument "--tree" that instructs scons to use single line drawing characters to draw the dependency tree. + - Add CompilationDatabase() builder in compilation_db tool. Contributed by MongoDB. + Setting COMPILATIONDB_USE_ABSPATH to True|False controls whether the files are absolute or relative + paths. Address Issue #3693 and #3694 found during development. + DEPRECATED FUNCTIONALITY @@ -43,6 +47,10 @@ required for intellisense to use the C++ standard version from cppflags. - Allow user specified location for vswhere.exe specified by VSWHERE. NOTE: This must be set at the time the 'msvc' 'msvs' and/or 'mslink' tool(s) are initialized to have any effect. + - Fixed Github Issue 3628 - Hardcoding pickle protocol to 4 (supports python 3.4+) + and skipping Python 3.8's new pickle protocol 5 whose main advantage is for out-of-band data buffers. + NOTE: If you used Python 3.8 with SCons 3.0.0 or above, you may get a a pickle protocol error. Remove your + .sconsign.dblite. You will end up with a full rebuild. FIXES -- cgit v0.12