From 900b35ab28b344b6b5597f3fdefd34de5db10d69 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Fri, 29 Dec 2017 02:39:59 -0500 Subject: fix for issue 3042, Jar method was not respecting variant dirs when using os.path to detect files or dirs --- src/engine/SCons/Tool/jar.py | 22 +++++++++++++++------- test/Java/JAR.py | 7 ++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py index b31ccb9..cb7c994 100644 --- a/src/engine/SCons/Tool/jar.py +++ b/src/engine/SCons/Tool/jar.py @@ -189,13 +189,21 @@ def Jar(env, target = None, source = [], *args, **kw): # found a dir so get the class files out of it target_nodes.extend(dir_to_class(s)) else: - if os.path.isfile(s): - # found a file that exists on the FS, make sure its a class file - target_nodes.extend(file_to_class(s)) - elif os.path.isdir(s): - # found a dir so get the class files out of it - target_nodes.extend(dir_to_class(s)) - elif s[-len(java_suffix):] == java_suffix or s[-len(java_class_suffix):] == java_class_suffix: + try: + # source is string try to convert it to file + target_nodes.extend(file_to_class(env.fs.File(s))) + continue + except: + pass + + try: + # source is string try to covnert it to dir + target_nodes.extend(dir_to_class(env.fs.Dir(s))) + continue + except: + pass + + if s[-len(java_suffix):] == java_suffix or s[-len(java_class_suffix):] == java_class_suffix: # found a file that may not exists and is only a string # so add it after converting it to a class file target_nodes.extend(file_to_class(s)) diff --git a/test/Java/JAR.py b/test/Java/JAR.py index da2e72e..d62696c 100644 --- a/test/Java/JAR.py +++ b/test/Java/JAR.py @@ -337,6 +337,7 @@ test.must_exist(['testdir2', 'barTest', 'com', 'javasource', 'JavaFile3.class']) # make some directories to test in test.subdir('listOfLists', + ['manifest_dir'], ['listOfLists', 'src'], ['listOfLists', 'src', 'com'], ['listOfLists', 'src', 'com', 'javasource'], @@ -346,14 +347,14 @@ test.subdir('listOfLists', test.write(['listOfLists', 'SConstruct'], """ foo = Environment() foo.VariantDir('build', 'src', duplicate=0) +foo.VariantDir('test', '../manifest_dir', duplicate=0) sourceFiles = ["src/com/javasource/JavaFile1.java", "src/com/javasource/JavaFile2.java", "src/com/javasource/JavaFile3.java",] list_of_class_files = foo.Java('build', source=sourceFiles) resources = ['build/com/resource/resource1.txt', 'build/com/resource/resource2.txt'] for resource in resources: foo.Command(resource, list_of_class_files, Copy(resource, resource.replace('build','src'))) -foo.Command('build/MANIFEST.mf', list_of_class_files, Copy('build/MANIFEST.mf', 'MANIFEST.mf')) contents = [list_of_class_files, resources] -foo.Jar(target = 'lists', source = contents + ['build/MANIFEST.mf'], JARCHDIR='build') +foo.Jar(target = 'lists', source = contents + ['test/MANIFEST.mf'], JARCHDIR='build') foo.Command("listsTest", [], Mkdir("listsTest") ) foo.Command('listsTest/src/com/javasource/JavaFile3.java', 'lists.jar', foo['JAR'] + ' xvf ../lists.jar', chdir='listsTest') """) @@ -394,7 +395,7 @@ public class JavaFile3 } """) -test.write(['listOfLists', 'MANIFEST.mf'], +test.write(['manifest_dir','MANIFEST.mf'], """Manifest-Version: 1.0 MyManifestTest: Test """) -- cgit v0.12 From b7dda62fbfface49432fd05d9c7ff507a3b381b3 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sun, 11 Feb 2018 13:39:19 -0500 Subject: removed code that is not used and added warning for unusual case --- src/engine/SCons/Tool/jar.py | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py index cb7c994..5e3711a 100644 --- a/src/engine/SCons/Tool/jar.py +++ b/src/engine/SCons/Tool/jar.py @@ -163,19 +163,6 @@ def Jar(env, target = None, source = [], *args, **kw): else: return dir_targets - # In the case that we are passed just string to a node which is directory - # but does not exist, we need to check all the current targets to see if - # that directory is going to exist so we can add it as a source to Jar builder - def get_all_targets(env, node='.'): - def get_all_targets_iter(env, node): - if node.has_builder(): - yield node - for kid in node.all_children(): - for kid in get_all_targets(env, kid): - yield kid - node = env.arg2nodes(node, env.fs.Entry)[0] - return list(get_all_targets_iter(env, node)) - # loop through the sources and handle each accordingly # the goal here is to get all the source files into a class # file or a directory that contains class files @@ -203,21 +190,8 @@ def Jar(env, target = None, source = [], *args, **kw): except: pass - if s[-len(java_suffix):] == java_suffix or s[-len(java_class_suffix):] == java_class_suffix: - # found a file that may not exists and is only a string - # so add it after converting it to a class file - target_nodes.extend(file_to_class(s)) - else: - # found a swig file so add it after converting it to class files - if(os.path.splitext(str(s))[1] == ".i"): - target_nodes.extend(env.JavaClassFile(source = s, *args, **kw)) - else: - # The final else case handles anything not caught above and makes - # sure other nodes that are sources for this jar get add as - # a source to the JarFile builder - for node in get_all_targets(env): - if(s == str(node)): - target_nodes.append(node) + SCons.Warnings.Warning("File: " + str(s) + " could not be identified as File or Directory, skipping.") + # at this point all our sources have been converted to classes or directories of class # so pass it to the Jar builder return env.JarFile(target = target, source = target_nodes, *args, **kw) -- cgit v0.12 From 1bdaf47dc61efefe469885a67876fdee46586f4a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 19 Feb 2018 10:47:25 -0500 Subject: Remove duplicate example. Likely caused by bad merge Fixes #2983 --- .../examples/builderswriting_MY_EMITTER_1.xml | 3 +- doc/generated/examples/caching_ex-random_1.xml | 6 +-- doc/generated/examples/troubleshoot_explain1_3.xml | 2 +- doc/generated/variables.gen | 59 ++++++++++++---------- doc/user/builders-writing.xml | 20 -------- 5 files changed, 38 insertions(+), 52 deletions(-) diff --git a/doc/generated/examples/builderswriting_MY_EMITTER_1.xml b/doc/generated/examples/builderswriting_MY_EMITTER_1.xml index 440b105..881fee7 100644 --- a/doc/generated/examples/builderswriting_MY_EMITTER_1.xml +++ b/doc/generated/examples/builderswriting_MY_EMITTER_1.xml @@ -1,5 +1,6 @@ % scons -Q my_command file1.input modify1.in > file1.foo -my_command file2.input modify2.in > file2.foo +sh: my_command: command not found +scons: *** [file1.foo] Error 127 diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index 81cbc5d..6a0337b 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,9 +1,9 @@ % scons -Q -cc -o f5.o -c f5.c -cc -o f4.o -c f4.c +cc -o f2.o -c f2.c cc -o f1.o -c f1.c +cc -o f5.o -c f5.c cc -o f3.o -c f3.c -cc -o f2.o -c f2.c +cc -o f4.o -c f4.c cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml index 32adb2f..e481f76 100644 --- a/doc/generated/examples/troubleshoot_explain1_3.xml +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -3,5 +3,5 @@ cp file.in file.oout scons: warning: Cannot find target file.out after building -File "/Users/bdbaddog/devel/scons/git/as_scons/bootstrap/src/script/scons.py", line 201, in <module> +File "/Users/bdbaddog/devel/scons/git/scons-bugfixes/bootstrap/src/script/scons.py", line 201, in <module> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index b86690a..2961b91 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -480,7 +480,8 @@ An automatically-generated construction variable containing the C preprocessor command-line options to define values. The value of $_CPPDEFFLAGS is created -by appending $CPPDEFPREFIX and $CPPDEFSUFFIX +by respectively prepending and appending +$CPPDEFPREFIX and $CPPDEFSUFFIX to the beginning and end of each definition in $CPPDEFINES. @@ -503,7 +504,8 @@ If $CPPDEFINES is a strin the values of the $CPPDEFPREFIX and $CPPDEFSUFFIX construction variables -will be added to the beginning and end. +will be respectively prepended and appended to the beginning and end +of each definition in $CPPDEFINES. @@ -517,7 +519,7 @@ If $CPPDEFINES is a list, the values of the $CPPDEFPREFIX and $CPPDEFSUFFIX construction variables -will be appended to the beginning and end +will be respectively prepended and appended to the beginning and end of each element in the list. If any element is a list or tuple, then the first item is the name being @@ -535,7 +537,7 @@ If $CPPDEFINES is a dicti the values of the $CPPDEFPREFIX and $CPPDEFSUFFIX construction variables -will be appended to the beginning and end +will be respectively prepended and appended to the beginning and end of each item from the dictionary. The key of each dictionary item is a name being defined @@ -563,7 +565,7 @@ env = Environment(CPPDEFINES={'B':2, 'A':None}) The prefix used to specify preprocessor definitions on the C compiler command line. -This will be appended to the beginning of each definition +This will be prepended to the beginning of each definition in the $CPPDEFINES construction variable when the $_CPPDEFFLAGS variable is automatically generated. @@ -619,7 +621,7 @@ An automatically-generated construction variable containing the C preprocessor command-line options for specifying directories to be searched for include files. The value of $_CPPINCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +by respectively prepending and appending $INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $CPPPATH. @@ -661,7 +663,7 @@ through the automatically-generated $_CPPINCFLAGS construction variable, which is constructed by -appending the values of the +respectively prepending and appending the value of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end @@ -2602,7 +2604,8 @@ containing the Fortran compiler command-line options for specifying directories to be searched for include files and module files. The value of $_FORTRANINCFLAGS is created -by prepending/appending $INCPREFIX and $INCSUFFIX +by respectively prepending and appending +$INCPREFIX and $INCSUFFIX to the beginning and end of each directory in $FORTRANPATH. @@ -2625,7 +2628,7 @@ for module files, as well. The prefix used to specify a module directory on the Fortran compiler command line. -This will be appended to the beginning of the directory +This will be prepended to the beginning of the directory in the $FORTRANMODDIR construction variables when the $_FORTRANMODFLAG variables is automatically generated. @@ -2637,7 +2640,7 @@ when the The suffix used to specify a module directory on the Fortran compiler command line. -This will be appended to the beginning of the directory +This will be appended to the end of the directory in the $FORTRANMODDIR construction variables when the $_FORTRANMODFLAG variables is automatically generated. @@ -2653,8 +2656,8 @@ for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation. The value of $_FORTRANMODFLAG is created -by prepending/appending $FORTRANMODDIRPREFIX and -$FORTRANMODDIRSUFFIX +by respectively prepending and appending +$FORTRANMODDIRPREFIX and $FORTRANMODDIRSUFFIX to the beginning and end of the directory in $FORTRANMODDIR. @@ -2727,7 +2730,7 @@ through the automatically-generated $_FORTRANINCFLAGS construction variable, which is constructed by -appending the values of the +respectively prepending and appending the values of the $INCPREFIX and $INCSUFFIX construction variables to the beginning and end @@ -3087,7 +3090,7 @@ env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) The prefix used to specify an include directory on the C compiler command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the $CPPPATH and $FORTRANPATH construction variables when the $_CPPINCFLAGS and $_FORTRANINCFLAGS variables are automatically generated. @@ -3698,7 +3701,7 @@ An automatically-generated construction variable containing the linker command-line options for specifying directories to be searched for library. The value of $_LIBDIRFLAGS is created -by appending $LIBDIRPREFIX and $LIBDIRSUFFIX +by respectively prepending and appending $LIBDIRPREFIX and $LIBDIRSUFFIX to the beginning and end of each directory in $LIBPATH. @@ -3709,7 +3712,7 @@ of each directory in $LIBPATH The prefix used to specify a library directory on the linker command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the $LIBPATH construction variable when the $_LIBDIRFLAGS variable is automatically generated. @@ -3742,7 +3745,7 @@ An automatically-generated construction variable containing the linker command-line options for specifying libraries to be linked with the resulting target. The value of $_LIBFLAGS is created -by appending $LIBLINKPREFIX and $LIBLINKSUFFIX +by respectively prepending and appending $LIBLINKPREFIX and $LIBLINKSUFFIX to the beginning and end of each filename in $LIBS. @@ -3753,7 +3756,7 @@ of each filename in $LIBS The prefix used to specify a library to link on the linker command line. -This will be appended to the beginning of each library +This will be prepended to the beginning of each library in the $LIBS construction variable when the $_LIBFLAGS variable is automatically generated. @@ -3807,7 +3810,7 @@ through the automatically-generated $_LIBDIRFLAGS construction variable, which is constructed by -appending the values of the +respectively prepending and appending the values of the $LIBDIRPREFIX and $LIBDIRSUFFIX construction variables to the beginning and end @@ -3863,7 +3866,7 @@ through the automatically-generated $_LIBFLAGS construction variable, which is constructed by -appending the values of the +respectively prepending and appending the values of the $LIBLINKPREFIX and $LIBLINKSUFFIX construction variables to the beginning and end @@ -5601,7 +5604,8 @@ containing the command-line options for specifying directories to be searched by the resource compiler. The value of $RCINCFLAGS is created -by appending $RCINCPREFIX and $RCINCSUFFIX +by respectively prepending and appending +$RCINCPREFIX and $RCINCSUFFIX to the beginning and end of each directory in $CPPPATH. @@ -5613,7 +5617,7 @@ of each directory in $CPPPATH The prefix (flag) used to specify an include directory on the resource compiler command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the $CPPPATH construction variable when the $RCINCFLAGS variable is expanded. @@ -5735,7 +5739,7 @@ An automatically-generated construction variable containing the rpath flags to be used when linking a program with shared libraries. The value of $_RPATH is created -by appending $RPATHPREFIX and $RPATHSUFFIX +by respectively prepending $RPATHPREFIX and appending $RPATHSUFFIX to the beginning and end of each directory in $RPATH. @@ -5763,7 +5767,7 @@ path, you must make it absolute yourself. The prefix used to specify a directory to be searched for shared libraries when running programs. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the $RPATH construction variable when the $_RPATH variable is automatically generated. @@ -6935,7 +6939,8 @@ An automatically-generated construction variable containing the SWIG command-line options for specifying directories to be searched for included files. The value of $_SWIGINCFLAGS is created -by appending $SWIGINCPREFIX and $SWIGINCSUFFIX +by respectively prepending and appending +$SWIGINCPREFIX and $SWIGINCSUFFIX to the beginning and end of each directory in $SWIGPATH. @@ -6946,7 +6951,7 @@ of each directory in $SWIGPATH The prefix used to specify an include directory on the SWIG command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the $SWIGPATH construction variable when the $_SWIGINCFLAGS variable is automatically generated. @@ -7020,7 +7025,7 @@ through the automatically-generated $_SWIGINCFLAGS construction variable, which is constructed by -appending the values of the +respectively prepending and appending the values of the $SWIGINCPREFIX and $SWIGINCSUFFIX construction variables to the beginning and end diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index 07f2dec..f740a79 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -826,9 +826,6 @@ env2 = Environment(BUILDERS = {'Foo' : bld}, MY_EMITTER = modify2) env1.Foo('file1') env2.Foo('file2') -import os -env1['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd() -env2['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd() file1.input @@ -848,23 +845,6 @@ cat - -bld = Builder(action = 'my_command $SOURCES > $TARGET', - suffix = '.foo', - src_suffix = '.input', - emitter = '$MY_EMITTER') -def modify1(target, source, env): - return target, source + ['modify1.in'] -def modify2(target, source, env): - return target, source + ['modify2.in'] -env1 = Environment(BUILDERS = {'Foo' : bld}, - MY_EMITTER = modify1) -env2 = Environment(BUILDERS = {'Foo' : bld}, - MY_EMITTER = modify2) -env1.Foo('file1') -env2.Foo('file2') - - In this example, the modify1.in -- cgit v0.12 From ad01d6c0c6d6171163d2d8129e097357ebecf5da Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 19 Feb 2018 09:25:27 -0800 Subject: Fix running my_command example script in example --- .../examples/builderswriting_MY_EMITTER_1.xml | 5 ++--- doc/generated/examples/caching_ex-random_1.xml | 6 +++--- doc/generated/examples/environments_ex3_1.xml | 22 +++++++++++++++++--- doc/generated/examples/java_jar1_1.xml | 2 +- doc/generated/examples/troubleshoot_Dump_2.xml | 2 +- doc/generated/examples/troubleshoot_explain1_3.xml | 2 +- doc/generated/tools.gen | 12 +++++------ doc/generated/tools.mod | 4 ++-- doc/generated/variables.gen | 24 +++++++++++----------- doc/generated/variables.mod | 4 ++-- doc/user/builders-writing.xml | 2 +- 11 files changed, 50 insertions(+), 35 deletions(-) diff --git a/doc/generated/examples/builderswriting_MY_EMITTER_1.xml b/doc/generated/examples/builderswriting_MY_EMITTER_1.xml index 881fee7..0c17d0e 100644 --- a/doc/generated/examples/builderswriting_MY_EMITTER_1.xml +++ b/doc/generated/examples/builderswriting_MY_EMITTER_1.xml @@ -1,6 +1,5 @@ % scons -Q -my_command file1.input modify1.in > file1.foo -sh: my_command: command not found -scons: *** [file1.foo] Error 127 +./my_command file1.input modify1.in > file1.foo +./my_command file2.input modify2.in > file2.foo diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index 6a0337b..19b02f5 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,9 +1,9 @@ % scons -Q -cc -o f2.o -c f2.c -cc -o f1.o -c f1.c -cc -o f5.o -c f5.c cc -o f3.o -c f3.c +cc -o f5.o -c f5.c +cc -o f2.o -c f2.c cc -o f4.o -c f4.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/environments_ex3_1.xml b/doc/generated/examples/environments_ex3_1.xml index 3262302..12b6ae0 100644 --- a/doc/generated/examples/environments_ex3_1.xml +++ b/doc/generated/examples/environments_ex3_1.xml @@ -1,6 +1,22 @@ % 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> +UnicodeDecodeError: 'utf8' codec can't decode byte 0xc2 in position 547: invalid continuation byte: + File "/home/my/project/SConstruct", line 6: + dbg.Program('foo', 'foo.c') + File "bootstrap/src/engine/SCons/Environment.py", line 260: + return MethodWrapper.__call__(self, target, source, *args, **kw) + File "bootstrap/src/engine/SCons/Environment.py", line 224: + return self.method(*nargs, **kwargs) + File "bootstrap/src/engine/SCons/Builder.py", line 635: + return self._execute(env, target, source, OverrideWarner(kw), ekw) + File "bootstrap/src/engine/SCons/Builder.py", line 541: + source = self.src_builder_sources(env, source, overwarn) + File "bootstrap/src/engine/SCons/Builder.py", line 748: + tlist = bld._execute(env, None, [s], overwarn) + File "bootstrap/src/engine/SCons/Builder.py", line 557: + _node_errors(self, env, tlist, slist) + File "bootstrap/src/engine/SCons/Builder.py", line 303: + msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8')) + File "/home/bdbaddog/tools/python-2.7.13/lib/python2.7/encodings/utf_8.py", line 16: + return codecs.utf_8_decode(input, errors, True) diff --git a/doc/generated/examples/java_jar1_1.xml b/doc/generated/examples/java_jar1_1.xml index de93227..daa3d1a 100644 --- a/doc/generated/examples/java_jar1_1.xml +++ b/doc/generated/examples/java_jar1_1.xml @@ -1,5 +1,5 @@ % scons -Q javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java -jar cf test.jar classes +scons: *** [test.jar] Source `classes.class' not found, needed by target `test.jar'. diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml index 08c6f04..a621422 100644 --- a/doc/generated/examples/troubleshoot_Dump_2.xml +++ b/doc/generated/examples/troubleshoot_Dump_2.xml @@ -79,7 +79,7 @@ scons: Reading SConscript files ... 'SHCXX': '$CXX', '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_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml index e481f76..064fdcb 100644 --- a/doc/generated/examples/troubleshoot_explain1_3.xml +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -3,5 +3,5 @@ cp file.in file.oout scons: warning: Cannot find target file.out after building -File "/Users/bdbaddog/devel/scons/git/scons-bugfixes/bootstrap/src/script/scons.py", line 201, in <module> +File "/home/bdbaddog/scons/git/scons/bootstrap/src/script/scons.py", line 201, in <module> diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index 26b7e22..f858aa4 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -778,19 +778,19 @@ Sets construction variables for the Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. - - packaging + + Packaging -A framework for building binary and source packages. +Sets construction variables for the Package Builder. - - Packaging + + packaging -Sets construction variables for the Package Builder. +A framework for building binary and source packages. diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod index f9bc1d7..1209d74 100644 --- a/doc/generated/tools.mod +++ b/doc/generated/tools.mod @@ -78,8 +78,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -packaging"> Packaging"> +packaging"> pdf"> pdflatex"> pdftex"> @@ -186,8 +186,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -packaging"> Packaging"> +packaging"> pdf"> pdflatex"> pdftex"> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 2961b91..a756d35 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -3209,7 +3209,7 @@ The command line used to call the Java archive tool. The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -3219,7 +3219,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -6614,6 +6614,16 @@ Example + + SHLIBVERSIONFLAGS + + +Extra flags added to $SHLINKCOM when building versioned +SharedLibrary. These flags are only used when $SHLIBVERSION is +set. + + + _SHLIBVERSIONFLAGS @@ -6627,16 +6637,6 @@ and some extra dynamically generated options (such as - - SHLIBVERSIONFLAGS - - -Extra flags added to $SHLINKCOM when building versioned -SharedLibrary. These flags are only used when $SHLIBVERSION is -set. - - - SHLINK diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 460724e..6ecf6c9 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -496,8 +496,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$_SHLIBVERSIONFLAGS"> $SHLIBVERSIONFLAGS"> +$_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> @@ -1125,8 +1125,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$_SHLIBVERSIONFLAGS"> $SHLIBVERSIONFLAGS"> +$_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index f740a79..ce95128 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -812,7 +812,7 @@ env.Foo('file') -bld = Builder(action = 'my_command $SOURCES > $TARGET', +bld = Builder(action = './my_command $SOURCES > $TARGET', suffix = '.foo', src_suffix = '.input', emitter = '$MY_EMITTER') -- cgit v0.12 From 32df95374e7ccb78ba677b5f287a437d12c0df4b Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 19 Feb 2018 16:09:09 -0500 Subject: Fix HOWTO/README. Remove vestiges of Option(). [ci skip] --- HOWTO/README | 5 ----- src/engine/SCons/Script/__init__.py | 2 -- 2 files changed, 7 deletions(-) diff --git a/HOWTO/README b/HOWTO/README index 951c019..e20df73 100644 --- a/HOWTO/README +++ b/HOWTO/README @@ -22,8 +22,3 @@ new-tool.txt release.txt Steps to go through when releasing a new version of SCons. -subrelease.txt - Steps to go through when releasing a new subsidiary version - of SCons--for example, 0.95.1 after we've released 0.95. - So far, we've only done this to get some early testing on major - refactorings. diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index a05c541..89fc061 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -280,8 +280,6 @@ sconscript_reading = 0 def Variables(files=[], args=ARGUMENTS): return SCons.Variables.Variables(files, args) -def Options(files=[], args=ARGUMENTS): - return SCons.Options.Options(files, args) # The list of global functions to add to the SConscript name space # that end up calling corresponding methods or Builders in the -- cgit v0.12 From a1a453e5046dbb1151eba2ca605d08b5d5820e81 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 20 Feb 2018 10:01:26 -0500 Subject: Update README.rst. Was missing correct info on python 3.5+ support. [ci skip] --- README.rst | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/README.rst b/README.rst index 8eb5af1..d63c8a4 100644 --- a/README.rst +++ b/README.rst @@ -72,9 +72,8 @@ version at the SCons download page: Execution Requirements ====================== -Running SCons requires Python version 2.7 or later (Python 3 is not -yet supported). There should be no other dependencies or requirements -to run SCons. +Running SCons requires Python version 2.7.* and Python 3.5 or higher. +There should be no other dependencies or requirements to run SCons. The default SCons configuration assumes use of the Microsoft Visual C++ compiler suite on WIN32 systems, and assumes a C compiler named 'cc', a C++ @@ -105,13 +104,11 @@ populate the build/scons/ subdirectory. You would do this as follows on a Linux or UNIX system (using sh or a derivative like bash or ksh):: $ setenv MYSCONS=`pwd`/src - $ setenv SCONS_LIB_DIR=$MYSCONS/engine $ python $MYSCONS/script/scons.py [arguments] Or on Windows:: C:\scons>set MYSCONS=%cd%\src - C:\scons>set SCONS_LIB_DIR=%MYSCONS%\engine C:\scons>python %MYSCONS%\script\scons.py [arguments] An alternative approach is to skip the above and use:: @@ -181,7 +178,7 @@ Or on Windows:: By default, the above commands will do the following: -- Install the version-numbered "scons-3.0.0" and "sconsign-3.0.0" scripts in +- Install the version-numbered "scons-3.1.0" and "sconsign-3.1.0" scripts in the default system script directory (/usr/bin or C:\\Python\*\\Scripts, for example). This can be disabled by specifying the "--no-version-script" option on the command line. @@ -193,23 +190,23 @@ By default, the above commands will do the following: before making it the default on your system. On UNIX or Linux systems, you can have the "scons" and "sconsign" scripts be - hard links or symbolic links to the "scons-3.0.0" and "sconsign-3.0.0" + hard links or symbolic links to the "scons-3.1.0" and "sconsign-3.1.0" scripts by specifying the "--hardlink-scons" or "--symlink-scons" options on the command line. -- Install "scons-3.0.0.bat" and "scons.bat" wrapper scripts in the Python +- Install "scons-3.1.0.bat" and "scons.bat" wrapper scripts in the Python prefix directory on Windows (C:\\Python\*, for example). This can be disabled by specifying the "--no-install-bat" option on the command line. On UNIX or Linux systems, the "--install-bat" option may be specified to - have "scons-3.0.0.bat" and "scons.bat" files installed in the default system + have "scons-3.1.0.bat" and "scons.bat" files installed in the default system script directory, which is useful if you want to install SCons in a shared file system directory that can be used to execute SCons from both UNIX/Linux and Windows systems. - Install the SCons build engine (a Python module) in an appropriate - version-numbered SCons library directory (/usr/lib/scons-3.0.0 or - C:\\Python\*\\scons-3.0.0, for example). See below for more options related to + version-numbered SCons library directory (/usr/lib/scons-3.1.0 or + C:\\Python\*\\scons-3.1.0, for example). See below for more options related to installing the build engine library. - Install the troff-format man pages in an appropriate directory on UNIX or @@ -487,7 +484,7 @@ running all of "runtest.py -a". Building Packages ================= -We use SCons (version 3.0.0 or later) to build its own packages. If you +We use SCons (version 3.1.0 or later) to build its own packages. If you already have an appropriate version of SCons installed on your system, you can build everything by simply running it:: @@ -502,9 +499,7 @@ about `Executing SCons Without Installing`_):: Depending on the utilities installed on your system, any or all of the following packages will be built:: - build/dist/scons-3.0.0-1.noarch.rpm - build/dist/scons-3.0.0-1.src.rpm - build/dist/scons-3.0.0.linux-i686.tar.gz + build/dist/scons-3.1.0.linux-i686.tar.gz build/dist/scons-3.1.0.alpha.yyyymmdd.tar.gz build/dist/scons-3.1.0.alpha.yyyymmdd.win32.exe build/dist/scons-3.1.0.alpha.yyyymmdd.zip @@ -513,7 +508,6 @@ following packages will be built:: build/dist/scons-local-3.1.0.alpha.yyyymmdd.zip build/dist/scons-src-3.1.0.alpha.yyyymmdd.tar.gz build/dist/scons-src-3.1.0.alpha.yyyymmdd.zip - build/dist/scons_3.0.0-1_all.deb The SConstruct file is supposed to be smart enough to avoid trying to build packages for which you don't have the proper utilities installed. For @@ -537,10 +531,6 @@ system, it should not try to install it.) The runtest.py script supports a -p option that will run the specified tests (individually or collectively via the -a option) against the unpacked build/test-/\* subdirectory:: - $ python runtest.py -p deb - - $ python runtest.py -p rpm - $ python runtest.py -p local-tar-gz $ python runtest.py -p local-zip @@ -690,18 +680,22 @@ in the LICENSE file. Reporting Bugs ============== -Please report bugs by following the detailed instructions on our Bug -Submission page: +The SCons project welcomes bug reports and feature requests. - http://scons.tigris.org/bug-submission.html +Please make sure you send email with the problem or feature request to the SCons user's mailing list, +which you can join via the link below: -You can also send mail to the SCons developers' mailing list: + http://two.pairlist.net/mailman/listinfo/scons-users - scons-dev@scons.org +Once you have discussed your issue on the users mailing list and the community has confirmed that +it is either a new bug or a duplicate of an existing bug, then please follow the instructions the c +ommunity provides to file a new bug or to add yourself to the CC list for an existing bug + +You can explore the list of existing bugs, which may include workarounds for the problem you've +run into on GitHub Issues: + + https://github.com/SCons/scons/issues -But even if you send email to the mailing list please make sure that you ALSO -submit a bug report to the project page bug tracker, because bug reports in -email often get overlooked in the general flood of messages. Mailing Lists @@ -773,5 +767,5 @@ many contributors, including but not at all limited to: \... and many others. -Copyright (c) 2001 - 2017 The SCons Foundation +Copyright (c) 2001 - 2018 The SCons Foundation -- cgit v0.12 From 796d4f35a68e72d11c0cf3f3bae6c20332aee5fe Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Tue, 20 Feb 2018 11:31:30 -0500 Subject: changed the way JobTests.py checks for tests running in parallel to fix github issue 3102 --- src/engine/SCons/JobTests.py | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py index 6ae8e92..36dceb3 100644 --- a/src/engine/SCons/JobTests.py +++ b/src/engine/SCons/JobTests.py @@ -87,6 +87,7 @@ class Task(object): self.taskmaster = taskmaster self.was_executed = 0 self.was_prepared = 0 + def prepare(self): self.was_prepared = 1 @@ -104,9 +105,19 @@ class Task(object): self.taskmaster.guard.acquire() self.taskmaster.begin_list.append(self.i) self.taskmaster.guard.release() - + + # while task is executing, represent this in the parallel_list + # and then turn it off + self.taskmaster.parallel_list[self.i] = 1 self._do_something() - + self.taskmaster.parallel_list[self.i] = 0 + + # check if task was executing while another was also executing + for j in range(1, self.taskmaster.num_tasks): + if(self.taskmaster.parallel_list[j+1] == 1): + self.taskmaster.found_parallel = True + break + self.was_executed = 1 self.taskmaster.guard.acquire() @@ -115,7 +126,7 @@ class Task(object): def executed(self): self.taskmaster.num_executed = self.taskmaster.num_executed + 1 - + self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") self.taskmaster.test_case.failUnless(self.was_executed, @@ -132,13 +143,16 @@ class Task(object): def postprocess(self): self.taskmaster.num_postprocessed = self.taskmaster.num_postprocessed + 1 + def exception_set(self): + pass + class RandomTask(Task): def _do_something(self): # do something that will take some random amount of time: - for i in range(random.randrange(0, num_sines, 1)): + for i in range(random.randrange(0, 1000 + num_sines, 1)): x = math.sin(i) - time.sleep(0.01) - + time.sleep(0.1) + class ExceptionTask(object): """A dummy task class for testing purposes.""" @@ -190,7 +204,10 @@ class Taskmaster(object): self.num_executed = 0 self.num_failed = 0 self.num_postprocessed = 0 + self.parallel_list = [0] * (n+1) + self.found_parallel = False self.Task = Task + # 'guard' guards 'task_begin_list' and 'task_end_list' try: import threading @@ -222,12 +239,7 @@ class Taskmaster(object): def tasks_were_serial(self): "analyze the task order to see if they were serial" - serial = 1 # assume the tasks were serial - for i in range(num_tasks): - serial = serial and (self.begin_list[i] - == self.end_list[i] - == (i + 1)) - return serial + return not self.found_parallel def exception_set(self): pass @@ -562,4 +574,4 @@ if __name__ == "__main__": # tab-width:4 # indent-tabs-mode:nil # End: -# vim: set expandtab tabstop=4 shiftwidth=4: +# vim: set expandtab tabstop=4 shiftwidth=4: \ No newline at end of file -- cgit v0.12 From 8f45abe8808744685ea5d6384ae6368b32d9f19d Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Tue, 20 Feb 2018 12:06:24 -0500 Subject: removed JobTests.py workaround from travis --- .travis.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e02b41..9d8b96d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,12 +14,7 @@ jobs: include: - &test_job stage: Test - script: - # WORKAROUND: attempt to retry JobTests.py if it fails and then continue if it passes, if it fails ten times - # then it is a real failure not related to intermittent travis failures - - n=0; while [[ $n -lt 10 ]]; do python runtest.py src/engine/SCons/JobTests.py && break; n=$((n+1)); done; if [ "$n" -gt "9" ]; then false; fi - - echo "src/engine/SCons/JobTests.py" > exclude_jobtest - - python runtest.py -a --exclude-list exclude_jobtest || if [[ $? == 2 ]]; then true; else false; fi + script: python runtest.py -a || if [[ $? == 2 ]]; then true; else false; fi before_script: skip after_success: skip python: 2.7 @@ -71,14 +66,8 @@ jobs: - echo "parallel = True" >> .coveragerc - printf "omit =\n\t*Tests.py\n\tsrc/test_*\n\tsrc/setup.py\n\n" >> .coveragerc - echo "[path] = $PWD" >> .coveragerc - # Not including this workaround in the coverage report, because it will result - # in constantly changing coverage reports depending on the number of times - # the JobTests.py had to run to pass - # TODO: figure out how to cover JobTests.py - # - n=0; while [[ $n -lt 10 ]]; do coverage run --rcfile=$PWD/.coveragerc runtest.py src/engine/SCons/JobTests.py && break; n=$((n+1)); done; if [ "$n" -gt "9" ]; then false; fi - # exclude JobTest.py becuase we already ran that - - echo "src/engine/SCons/JobTests.py" > exclude_jobtest - - python runtest.py -l -a --exclude-list exclude_jobtest > all_tests + # get a list of all the tests to split them up + - python runtest.py -l -a > all_tests - let "start = ($(wc -l < all_tests) / ${TOTAL_BUILD_JOBS}) * (${BUILD_JOB_NUM} - 1)"; true; - let "end = ($(wc -l < all_tests) / ${TOTAL_BUILD_JOBS}) * ${BUILD_JOB_NUM}" - if (( ${BUILD_JOB_NUM} == ${TOTAL_BUILD_JOBS} )); then end=$(wc -l < all_tests); fi -- cgit v0.12 From f620c01ef13e0ecc3a7f2086c7c4ecef9e560725 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Tue, 20 Feb 2018 12:17:46 -0500 Subject: whitespace clean up, no functional changes --- src/engine/SCons/JobTests.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py index 36dceb3..cc5e3c7 100644 --- a/src/engine/SCons/JobTests.py +++ b/src/engine/SCons/JobTests.py @@ -87,7 +87,6 @@ class Task(object): self.taskmaster = taskmaster self.was_executed = 0 self.was_prepared = 0 - def prepare(self): self.was_prepared = 1 @@ -105,19 +104,19 @@ class Task(object): self.taskmaster.guard.acquire() self.taskmaster.begin_list.append(self.i) self.taskmaster.guard.release() - + # while task is executing, represent this in the parallel_list - # and then turn it off + # and then turn it off self.taskmaster.parallel_list[self.i] = 1 self._do_something() self.taskmaster.parallel_list[self.i] = 0 - + # check if task was executing while another was also executing for j in range(1, self.taskmaster.num_tasks): if(self.taskmaster.parallel_list[j+1] == 1): self.taskmaster.found_parallel = True break - + self.was_executed = 1 self.taskmaster.guard.acquire() @@ -126,7 +125,7 @@ class Task(object): def executed(self): self.taskmaster.num_executed = self.taskmaster.num_executed + 1 - + self.taskmaster.test_case.failUnless(self.was_prepared, "the task wasn't prepared") self.taskmaster.test_case.failUnless(self.was_executed, @@ -152,7 +151,7 @@ class RandomTask(Task): for i in range(random.randrange(0, 1000 + num_sines, 1)): x = math.sin(i) time.sleep(0.1) - + class ExceptionTask(object): """A dummy task class for testing purposes.""" @@ -574,4 +573,4 @@ if __name__ == "__main__": # tab-width:4 # indent-tabs-mode:nil # End: -# vim: set expandtab tabstop=4 shiftwidth=4: \ No newline at end of file +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12 From fd6d431634dc461cca47e11d4a89cc1737220fe2 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Tue, 20 Feb 2018 15:23:20 -0500 Subject: reduced number of calculations and sleep time to improve test speed --- src/engine/SCons/JobTests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py index cc5e3c7..39918db 100644 --- a/src/engine/SCons/JobTests.py +++ b/src/engine/SCons/JobTests.py @@ -52,7 +52,7 @@ def get_cpu_nums(): return 1 # Default # a large number -num_sines = 10000 +num_sines = 500 # how many parallel jobs to perform for the test num_jobs = get_cpu_nums()*2 @@ -148,9 +148,9 @@ class Task(object): class RandomTask(Task): def _do_something(self): # do something that will take some random amount of time: - for i in range(random.randrange(0, 1000 + num_sines, 1)): + for i in range(random.randrange(0, 100 + num_sines, 1)): x = math.sin(i) - time.sleep(0.1) + time.sleep(0.01) class ExceptionTask(object): """A dummy task class for testing purposes.""" @@ -282,7 +282,7 @@ class ParallelTestCase(unittest.TestCase): class SleepTask(Task): def _do_something(self): - time.sleep(0.1) + time.sleep(0.01) global SaveThreadPool SaveThreadPool = SCons.Job.ThreadPool @@ -292,7 +292,7 @@ class ParallelTestCase(unittest.TestCase): ThreadPoolCallList.append('put(%s)' % task.i) return SaveThreadPool.put(self, task) def get(self): - time.sleep(0.5) + time.sleep(0.05) result = SaveThreadPool.get(self) ThreadPoolCallList.append('get(%s)' % result[0].i) return result -- cgit v0.12 From a3d092855944aef928c5c3d6cba23908dbaa17f5 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 17 Mar 2018 13:50:50 -0400 Subject: Initial creation of issue template. --- .github/issue_template.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/issue_template.md diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000..6af45d1 --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,10 @@ +# Please bring your issue to the SCons users mailing list before filing an issue here +# See: http://scons.org/bugs.html + +# If the issue is confirmed to be a bug please include the following information +* Version of SCons +* Version of Python +* How you installed SCons +* What Platform are you on? (Linux/Windows and which version) +* How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. + -- cgit v0.12 From 0a16004dfdafb829780f150a82784f0537755f57 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 17 Mar 2018 16:13:13 -0400 Subject: Update issue_template.md --- .github/issue_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 6af45d1..3298b73 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -7,4 +7,4 @@ * How you installed SCons * What Platform are you on? (Linux/Windows and which version) * How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. - +* Link to SCons Users thread discussing your issue. -- cgit v0.12 From e7b15e2288afa13cab09943bb2a5fa723cfa789e Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 20 Mar 2018 16:46:30 -0400 Subject: Update issue_template.md --- .github/issue_template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/issue_template.md b/.github/issue_template.md index 3298b73..9f632b0 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -4,6 +4,7 @@ # If the issue is confirmed to be a bug please include the following information * Version of SCons * Version of Python +* Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc) * How you installed SCons * What Platform are you on? (Linux/Windows and which version) * How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. -- cgit v0.12