[Scons-users] Randomly, Scons can not find the header

Bill Deegan bill at baddogconsulting.com
Sun Nov 26 22:54:54 EST 2017


Try upgrading to scons 3.0.1 and report back.
-Bill

On Sun, Nov 26, 2017 at 7:20 PM, shijm <fsfshijm at 163.com> wrote:

>
> It exists before Scons runs!, just like the following files, we do not set
> the CPPPATH explicitly, as I understand, SCons should find the header file
> in the current dir, right?
>
> But, I did some testing, and found that, there is no any copy log of abc.h
> when Failure(I print some log in _hardlink_func/_softlink_func/_copy_func),
> the copy log exists when Success; So I think, the problem is SCons does
> not recognize the dependency reandomly, and does not generate the
> dependency tree for this case.
>
> So, do you have more ideas? Thanks very much!
> By the way, I'm planing to upgrade scons to scons3.0, but I'm not sure
> whether scons3.0 can fix this issue.
>
>
> $ls
> abc.h
> abc.cpp
> SConscript
>
> $cat abc.cpp
> include "abc.h"
>
> $caat SConscript
> Import('env')
> srcs = env.Glob('*.cpp')
> objs = env.SharedObject(srcs)
> env.SharedLibrary('abc', objs)
>
>
>
>
>
>
> At 2017-11-20 21:49:20, scons-users-request at scons.org wrote:
> >Send Scons-users mailing list submissions to
> >	scons-users at scons.org
> >
> >To subscribe or unsubscribe via the World Wide Web, visit
> >	https://pairlist4.pair.net/mailman/listinfo/scons-users
> >or, via email, send a message with subject or body 'help' to
> >	scons-users-request at scons.org
> >
> >You can reach the person managing the list at
> >	scons-users-owner at scons.org
> >
> >When replying, please edit your Subject line so it is more specific
> >than "Re: Contents of Scons-users digest..."
> >
> >
> >Today's Topics:
> >
> >   1. Re: Randomly, Scons can not find the header (Bill Deegan)
> >
> >
> >----------------------------------------------------------------------
> >
> >Message: 1
> >Date: Mon, 20 Nov 2017 08:49:15 -0500
> >From: Bill Deegan <bill at baddogconsulting.com>
> >To: SCons users mailing list <scons-users at scons.org>
> >Subject: Re: [Scons-users] Randomly, Scons can not find the header
> >Message-ID:
> >	<CAEyG4CHV4As+_KaPH+xL=e4_hLSrXsKUo-vHsc37kz+fnB9p8Q at mail.gmail.com>
> >Content-Type: text/plain; charset="utf-8"
> >
> >Is abc.h a generated file? Or does it exist before SCons runs?
> >Have you tried running with scons 3.0.1?
> >2.3 is pretty old and many bugs have been fixed since that was released.
> >
> >-Bill
> >
> >On Mon, Nov 20, 2017 at 3:04 AM, shijm <fsfshijm at 163.com> wrote:
> >
> >>
> >> @Bill Deegan Thanks very much for your response
> >>
> >> The command is :
> >> "g++ -o <build path>/abc.os -I<path1> -I<path2> <build path>/abc.cpp "
> >>
> >> In fact, the 'abc.h' and 'abc.cpp' are in the same dir, and the include
> >> way is '#include "abc.h"' using double quotation;
> >> So, I think the compiler should just find the header file in the current
> >> dir, and the '-I' option is not used in this case, Is that right?
> >>
> >> In addition, in your above message, what does the "proper dependencies"
> >> exactly means? Does my case above have the "proper dependencies"?
> >>
> >> Thanks very much!
> >>
> >>
> >>
> >>
> >>
> >> At 2017-11-18 00:03:45, scons-users-request at scons.org wrote:
> >> >Send Scons-users mailing list submissions to
> >> >	scons-users at scons.org
>
> >> >
> >> >To subscribe or unsubscribe via the World Wide Web, visit
> >> >	https://pairlist4.pair.net/mailman/listinfo/scons-users
> >> >or, via email, send a message with subject or body 'help' to
> >> >	scons-users-request at scons.org
> >> >
> >> >You can reach the person managing the list at
> >> >	scons-users-owner at scons.org
> >> >
> >> >When replying, please edit your Subject line so it is more specific
> >> >than "Re: Contents of Scons-users digest..."
> >> >
> >> >
> >> >Today's Topics:
> >> >
> >> >   1. Re: Randomly, Scons can not find the header files(#include)
> >> >      (Bill Deegan)
> >> >   2. Re: Randomly, Scons can not find the header files(#include)
> >> >      (Bill Deegan)
> >> >   3. Re: problem with new Jar builder-wrapper in 3.0.1 (Bill Deegan)
> >> >
> >> >
> >> >----------------------------------------------------------------------
> >> >
> >> >Message: 1
> >> >Date: Fri, 17 Nov 2017 10:57:19 -0500
> >> >From: Bill Deegan <bill at baddogconsulting.com>
> >> >To: SCons users mailing list <scons-users at scons.org>
> >> >Subject: Re: [Scons-users] Randomly, Scons can not find the header
> >> >	files(#include)
> >> >Message-ID:
> >> >	<CAEyG4CE=AfQq4XPzvTp2ToFV9UjtPwBM=SfDAKsR8YT0Wq-7-Q at mail.gmail.com>
> >> >Content-Type: text/plain; charset="utf-8"
> >> >
> >> >What's the command line when it fails?
> >> >Does it have the -I's?
> >> >
> >> >A WAG would be that another file has the proper dependencies on the file
> >> >and thus it's getting copied to build dir, while the one(s) which fail do
> >> >not. Thus if the order of compilation changes it may not be copied in time..
> >> >
> >> >-Bill
> >> >
> >> >On Fri, Nov 17, 2017 at 12:42 AM, shijm <fsfshijm at 163.com> wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >>
> >> >> I?m using Scons 2.3 to compile our projects, but *randomly**,* scans can
> >> >> not find the header files, the error is like this:
> >> >>
> >> >>
> >> >> { xxx.cpp:5:37: error: xxx.h: No such file or directory }
> >> >>
> >> >>
> >> >> My SConstruct and SConscripts:
> >> >>
> >> >>    1. One SConstruct in the root dir, and lots of SConscript in different
> >> >>    sub dirs
> >> >>    2. env.SConscript(dirs='.',exports='env',variant_dir=env[
> >> >>    'BUILD_DIR'],duplicate=1)
> >> >>    3. SetOption('duplicate','hard-soft-copy')
> >> >>    4. In each sub SConscript we define env: Import('env?); env = env.Clone
> >> >>    ()
> >> >>    5. Also, we are using CPPPATH to search the header files
> >> >>
> >> >> When compiling, we always clone a clean code from remote repo, so there is
> >> >> no cache or something else locally.
> >> >> Then the problem is, sometimes the compilation is success, sometimes it's
> >> >> failure, I try to figure out the root cause and found that the header file
> >> >> was not copied to 'BUILD_DIR'(duplicate=1);
> >> >> I don't know why this happened, seams there is some wrong when parsing
> >> >> dependency tree or cp files? I don't know.
> >> >> So, do you have some ideas or suggestions for me to fix/debug this issue?
> >> >> Looking forward to your response! thanks very much!!!
> >> >>
> >> >>
> >> >> Thanks.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> _______________________________________________
> >> >> Scons-users mailing list
> >> >> Scons-users at scons.org
> >> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
> >> >>
> >> >>
> >> >-------------- next part --------------
> >> >An HTML attachment was scrubbed...
> >> >URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171117/6afabdd4/attachment-0001.html>
> >> >
> >> >------------------------------
> >> >
> >> >Message: 2
> >> >Date: Fri, 17 Nov 2017 10:57:36 -0500
> >> >From: Bill Deegan <bill at baddogconsulting.com>
> >> >To: SCons users mailing list <scons-users at scons.org>
> >> >Subject: Re: [Scons-users] Randomly, Scons can not find the header
> >> >	files(#include)
> >> >Message-ID:
> >> >	<CAEyG4CGmO7GFi1gXGwnWYhOqi=BEOwaPM9iZepw59dcoyW+MXQ at mail.gmail.com>
> >> >Content-Type: text/plain; charset="utf-8"
> >> >
> >> >Also.. Try 3.0.1 and see if the problem goes away.
> >> >2.3 is quite old.
> >> >
> >> >On Fri, Nov 17, 2017 at 10:57 AM, Bill Deegan <bill at baddogconsulting.com>
> >> >wrote:
> >> >
> >> >> What's the command line when it fails?
> >> >> Does it have the -I's?
> >> >>
> >> >> A WAG would be that another file has the proper dependencies on the file
> >> >> and thus it's getting copied to build dir, while the one(s) which fail do
> >> >> not. Thus if the order of compilation changes it may not be copied in time..
> >> >>
> >> >> -Bill
> >> >>
> >> >> On Fri, Nov 17, 2017 at 12:42 AM, shijm <fsfshijm at 163.com> wrote:
> >> >>
> >> >>> Hi,
> >> >>>
> >> >>>
> >> >>> I?m using Scons 2.3 to compile our projects, but *randomly**,* scans can
> >> >>> not find the header files, the error is like this:
> >> >>>
> >> >>>
> >> >>> { xxx.cpp:5:37: error: xxx.h: No such file or directory }
> >> >>>
> >> >>>
> >> >>> My SConstruct and SConscripts:
> >> >>>
> >> >>>    1. One SConstruct in the root dir, and lots of SConscript in
> >> >>>    different sub dirs
> >> >>>    2. env.SConscript(dirs='.',exports='env',variant_dir=env['
> >> >>>    BUILD_DIR'],duplicate=1)
> >> >>>    3. SetOption('duplicate','hard-soft-copy')
> >> >>>    4. In each sub SConscript we define env: Import('env?); env =
> >> >>>    env.Clone()
> >> >>>    5. Also, we are using CPPPATH to search the header files
> >> >>>
> >> >>> When compiling, we always clone a clean code from remote repo, so there
> >> >>> is no cache or something else locally.
> >> >>> Then the problem is, sometimes the compilation is success, sometimes it's
> >> >>> failure, I try to figure out the root cause and found that the header file
> >> >>> was not copied to 'BUILD_DIR'(duplicate=1);
> >> >>> I don't know why this happened, seams there is some wrong when parsing
> >> >>> dependency tree or cp files? I don't know.
> >> >>> So, do you have some ideas or suggestions for me to fix/debug this issue?
> >> >>> Looking forward to your response! thanks very much!!!
> >> >>>
> >> >>>
> >> >>> Thanks.
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> _______________________________________________
> >> >>> Scons-users mailing list
> >> >>> Scons-users at scons.org
> >> >>> https://pairlist4.pair.net/mailman/listinfo/scons-users
> >> >>>
> >> >>>
> >> >>
> >> >-------------- next part --------------
> >> >An HTML attachment was scrubbed...
> >> >URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171117/5cfa4411/attachment-0001.html>
> >> >
> >> >------------------------------
> >> >
> >> >Message: 3
> >> >Date: Fri, 17 Nov 2017 11:03:41 -0500
> >> >From: Bill Deegan <bill at baddogconsulting.com>
> >> >To: SCons users mailing list <scons-users at scons.org>
> >> >Subject: Re: [Scons-users] problem with new Jar builder-wrapper in
> >> >	3.0.1
> >> >Message-ID:
> >> >	<CAEyG4CHDfjv5MB1XJp7aeS4ey=MpHtUfO-3xOFc_aGz6q-pMEA at mail.gmail.com>
> >> >Content-Type: text/plain; charset="utf-8"
> >> >
> >> >Mats,
> >> >
> >> >All return values from builders are NodeLists, (list of nodes)
> >> >
> >> >Can you try:
> >> >source=simpleclient_classes+['MANIFEST.MF'])
> >> >
> >> >I've also added a link to this thread in the pull request. Hopefully Daniel
> >> >Moody will respond here.
> >> >
> >> >-Bill
> >> >
> >> >
> >> >On Thu, Nov 16, 2017 at 2:33 PM, Mats Wichmann <mats at wichmann.us> wrote:
> >> >
> >> >>
> >> >> Per the instructions still on the scons.org page, I'm emailing this here
> >> >> prior to filing a ticket.
> >> >>
> >> >> When I tried our build with 3.0.1., the CI builders for the java
> >> >> versions tipped over.
> >> >>
> >> >> The error message looks like this:
> >> >>
> >> >> TypeError: coercing to Unicode: need string or buffer, list found:
> >> >>
> >> >> the relevant bit of the backtrace seems to be:
> >> >>
> >> >> 15:34:53   File
> >> >> "/home/jenkins-ci/workspace/iotivity-verify-linux_secured_
> >> >> with_java/java/examples-java/simpleclient/SConscript",
> >> >> line 25:
> >> >> 15:34:53     example_jar = jdk_env.Jar(target='simpleclient.jar',
> >> >> source=[simpleclient_classes, 'MANIFEST.MF'])
> >> >> 15:34:53   File
> >> >> "/home/jenkins-ci/workspace/iotivity-verify-linux_secured_
> >> >> with_java/scons-local/scons-local-3.0.1/SCons/Environment.py",
> >> >> line 224:
> >> >> 15:34:53     return self.method(*nargs, **kwargs)
> >> >> 15:34:53   File
> >> >> "/home/jenkins-ci/workspace/iotivity-verify-linux_secured_
> >> >> with_java/scons-local/scons-local-3.0.1/SCons/Tool/jar.py",
> >> >> line 174:
> >> >> 15:34:53     if os.path.isfile(s):
> >> >> 15:34:53   File "/usr/lib/python2.7/genericpath.py", line 29:
> >> >> 15:34:53     st = os.stat(path)
> >> >>
> >> >>
> >> >> The code in question in scons in Tool/jar.py is brand new:
> >> >>
> >> >>     """
> >> >>     A pseudo-Builder wrapper around the separate Jar sources{File,Dir}
> >> >>     Builders.
> >> >>     """
> >> >>
> >> >> The invocation that triggered the failure looked like this:
> >> >>
> >> >> simpleclient_classes = jdk_env.Java(target='classes',
> >> >> source=['src/main/java'])
> >> >> example_jar = jdk_env.Jar(target='simpleclient.jar',
> >> >> source=[simpleclient_classes, 'MANIFEST.MF'])
> >> >>
> >> >> (the second line is the one from the traceback)
> >> >>
> >> >> so the return from the Java builder is passed to Jar as part of the
> >> >> source list, but the new code does not appear to expect the type it is
> >> >> passed as a result.  It's not clear if our call to Jar is illegal, but
> >> >> it worked fine through 3.0.0.  It *looks* like the intent is not to do
> >> >> it the way we do, since the preceding call to the Java builder seems
> >> >> unnecessary per this doc snippet:
> >> >>
> >> >> "Any .java files in the source list will be compiled to .class files by
> >> >> calling the Java Builder. "
> >> >>
> >> >> So it would be good to figure out if this is a new bug in jar.py, or if
> >> >> the documentation should be explicit about disallowing the way we are
> >> >> calling it, which at least to my reading it is not explicit about.
> >> >>
> >> >> thanks,
> >> >>
> >> >> -- mats
> >> >>
> >> >> _______________________________________________
> >> >> Scons-users mailing list
> >> >> Scons-users at scons.org
> >> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
> >> >>
> >> >-------------- next part --------------
> >> >An HTML attachment was scrubbed...
> >> >URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171117/9d4073f4/attachment.html>
> >> >
> >> >------------------------------
> >> >
> >> >Subject: Digest Footer
> >> >
> >> >_______________________________________________
> >> >Scons-users mailing list
> >> >Scons-users at scons.org
> >> >https://pairlist4.pair.net/mailman/listinfo/scons-users
> >> >
> >> >
> >> >------------------------------
> >> >
> >> >End of Scons-users Digest, Vol 71, Issue 22
> >> >*******************************************
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Scons-users mailing list
> >> Scons-users at scons.org
> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
> >>
> >>
> >-------------- next part --------------
> >An HTML attachment was scrubbed...
> >URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171120/a8f83e93/attachment.html>
> >
> >------------------------------
> >
> >Subject: Digest Footer
> >
> >_______________________________________________
> >Scons-users mailing list
> >Scons-users at scons.org
> >https://pairlist4.pair.net/mailman/listinfo/scons-users
> >
> >
> >------------------------------
> >
> >End of Scons-users Digest, Vol 71, Issue 28
> >*******************************************
>
>
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171126/496b15db/attachment-0001.html>


More information about the Scons-users mailing list