'Internal Error: no cycle found in Scons Build

When I build my Sconstruct file, I am getting the below error.

scons: *** Found dependency cycle(s):
  build/sselser/sselConfigArgs.h -> build/sselser/sselConfigArgs.h
  Internal Error: no cycle found for node build/sselser/sselMain (<SCons.Node.FS.File instance at 0x9f61e8>) in state pending
  Internal Error: no cycle found for node build/sselser/sselMain.o (<SCons.Node.FS.File instance at 0x9f2e68>) in state pending

File "/nfs/scons/scons-1.3.0/lib/scons-1.3.0/SCons/Taskmaster.py", line 1026, in cleanup

I guess this is due to dependency of sselMain in sselTransorm as the error occurs during the build of sselTransform directory.

Makefile in sselTransform:

UNIT_SUPPORT_FILES += ../sselser/sselMain intest ../../../make/Makenv

MDE_SUPPORT_FILES += ../sselser/sselMain intest ../../../make/Makenv

I need to add the same in Sconscript of sselTransform directory to resolve this issue.

How to resolve this issue?

Sconscript:

#Set CPPPATH, RPATH, DEFINES and CCFLAGS

env = Environment(CPPPATH =['.','../sselTransform','../sselSm','../sselSRC'],
RPATH = ['/l-n/app/colr/lib/infra/SunOS5.10/WS12.0'],CPPDEFINES = ['THREADSAFE','_RWSTD_SOLARIS_THREADS','_SVID_GETTO
D','DEBUG','sun5'],CCFLAGS = ['library=rwtools7_std','features=no%tmplife','-pta','-mt','-xdebugformat=stabs','-g0','-xildoff'])

env['CXX']=CXX

Src = Split('sselManager.C PromoNotifyMgr.C ')
env.StaticLibrary('libSselser-g0.a',Src)

Src1 = Split('sselMain.C  sselManager.o PromoNotifyMgr.o ')

env.Program('sselMain',Src1)

configfile = 'sselConfigArgs.h'

CONFIG_PATH = '../../build/include/'

CONFIG=CONFIG_PATH+configfile

env.Command(CONFIG,configfile,
           [Copy('$TARGET', '$SOURCE'),
           Chmod('$TARGET', 0444)])

Sconstruct:

SConscript('src/ssel/sselser/SConscript',variant_dir='build/sselser',duplicate=0,exports='env')


Solution 1:[1]

Try this?

Notes:

  1. I'm saving the build objects for your two source files and using those in both the program and static library.

  2. I've added the target dir you're copying the header file to earlier in the CPPPATH.

  3. You could have skipped the variables configfile, CONFIG_PATH, CONFIG and just used the strings in your Command.

  4. You are using a VERY old version of SCons. If you're limited to python 2.7 please try using SCons 3.0.1? If you're not and can use Python 3.6, then try using SCons 4.3.0.

    #Set CPPPATH, RPATH, DEFINES and CCFLAGS
    
    env = Environment(
       CPPPATH =['.','../include','../sselTransform','../sselSm','../sselSRC'],
       RPATH = ['/l-n/app/colr/lib/infra/SunOS5.10/WS12.0'],
       CPPDEFINES = ['THREADSAFE','_RWSTD_SOLARIS_THREADS','_SVID_GETTOD','DEBUG','sun5'],
       CCFLAGS = ['library=rwtools7_std','features=no%tmplife','-pta','-mt','-xdebugformat=stabs','-g0','-xildoff'])
    
    env['CXX']=CXX
    
    Src = ['sselManager.C','PromoNotifyMgr.C']
    objects = []
    for s in Src:
        objects.extend(env.StaticObject(s))
    
    env.StaticLibrary('Sselser-g0',objects)
    
    Src1 = ['sselMain.C'] + objects
    
    env.Program('sselMain', Src1)
    
    configfile = 'sselConfigArgs.h'
    
    CONFIG_PATH = '../include/'
    
    CONFIG=CONFIG_PATH+configfile
    
    env.Command(CONFIG, configfile,
               [Copy('$TARGET', '$SOURCE'),
               Chmod('$TARGET', 0444)])
    

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bdbaddog