Coder Social home page Coder Social logo

Comments (18)

mwichmann avatar mwichmann commented on September 27, 2024

in your list of sources in the subdir sconscript, the items are not properly comma-separated, which means string catenation is in effect. Is that just a transcription error, or does it change the behavior to fix that? (a little hard to reproduce here, since don't have ccppc, etc.)

from scons.

mtribiere avatar mtribiere commented on September 27, 2024

It's a transcription error my bad, I'm going to correct that.

from scons.

mtribiere avatar mtribiere commented on September 27, 2024

@mwichmann ccppc is sadly a private compiler, but if that helps, it's GCC 3.3.2 based compiled for windows (Yes an antique)

from scons.

mwichmann avatar mwichmann commented on September 27, 2024

Maybe post a snip from the build.ninja file that shows the instruction gone wrong (and a bit more of the error message)? Commenting out the cross-compile bits it "looks okay to me" here (I'm not the ninja expert at all, though). e.g., produces stuff like:

build subA/subB/src/filea.o: CC subA/subB/src/filea.c | /usr/lib64/ccache/gcc subA/subB/src/filea.c
  CC = gcc
  env = 
  rspc = "-MP" "-MMD" "-MF" "subA/subB/src/filea.o.d" "-fno-cprop-registers" $
      "-fno-guess-branch-probability" "-Idependencies/a" "-Idependencies/b" "-Idependencies/c" $
      "-Idependencies/d" "-c" "-o" "subA/subB/src/filea.o" "subA/subB/src/filea.c"

from scons.

mtribiere avatar mtribiere commented on September 27, 2024

Here is my output:
Capture-bug

I will see what part of the Ninja file I can share

from scons.

bdbaddog avatar bdbaddog commented on September 27, 2024

Here is my output: Capture-bug

I will see what part of the Ninja file I can share

Please paste the text. Posting a screenshot is far less useful and harder to read/use.

from scons.

mwichmann avatar mwichmann commented on September 27, 2024

Can't tell much from that, personally, but the line that starts with BUILD looks like the end is garbled?

from scons.

mwichmann avatar mwichmann commented on September 27, 2024

BTW, when I asked can you post more, I was hoping the sample pasted into the issue here was a working (broken) repro, and you could paste info from that.

from scons.

mtribiere avatar mtribiere commented on September 27, 2024

Here is one of the generated ninja rule:

build build\vaps_gen\QCG\main\fileA.o: CC vaps_gen\QCG\main\fileA.c | $
    vaps_gen\QCG\main\fileA.c
  CC = ccppc
  env = export PATHEXT='.COM;.EXE;.BAT;.CMD';
  rspc = "-MMD" "-MF" "build/vaps_gen/QCG/main/fileA.o.d" "-fno-cprop-registers" $
      "-fno-guess-branch-probability" "-fno-delayed-branch" "-fno-if-conversion2" $
      "-fno-if-conversion" "-fno-crossjumping" "-fno-loop-optimize" "-fno-thread-jumps" $
      "-fno-merge-constants" "-fno-defer-pop" "-fno-zero-initialized-in-bss" "-fsigned-char" $
      "-mcpu=603" "-mstrict-align" "-G" "0" "-g" "-O1" "-fvolatile" "-fno-builtin" "-Wall" $
      "-mvthreads" "-DCPU=PPC603" "-DTOOL=gnu" "-D__TARGET__" $
      "-Idependencies/CIG_PART_HMI/DEPA/" $
      "-Idependencies/MRCL_CIG_LIB/DEPB/" $
      "-Idependencies/MRCL_CIG_LIB/DEPC/" $
      "-Idependencies/MRCL_CIG_LIB/DEPD/" $
      "-Idependencies/MRCL_CIG_LIB/DEPE" "-c" "-o" $
      "build/vaps_gen/QCG/main/filaA.o" "vaps_gen/QCG/main/fileA.c"

And the text outut:

scons: Reading SConscript files ...
Initializing ninja tool... this feature is experimental. SCons internals and all environments will be affected.
SCons running in ninja mode. build.ninja will be generated.
scons: done reading SConscript files.
scons: Building targets ...
Generating: build.ninja
ninja will be run with command line targets:
Executing: ninja -f C:\Tools\DEV\HLX_HMI_CORE_DEV\build.ninja -j1

FAILED: build/vaps_gen/QCG/main/fileA.o←[2K
export PATHEXT='.COM;.EXE;.BAT;.CMD';ccppc "-MP" "-MMD" "-MF" "build/vaps_gen/QCG/main/fileA.o.d" "-fno-cprop-registers" "-fno-guess-branch-probability" "-fno-delayed-branch" "-fno-if-conversion2" "-fno-if-conversion" "-fno-crossjumping" "-fno-loop-optimize" "-fno-thread-jumps" "-fno-merge-constants" "-fno-defer-pop" "-fno-zero-initialized-in-bss" "-fsigned-char" "-mcpu=603" "-mstrict-align" "-G" "0" "-g" "-O1" "-fvolatile" "-fno-builtin" "-Wall" "-mvthreads" "-DCPU=PPC603" "-DTOOL=gnu" "-D__TARGET__" [... ALL MY DEPS... ] "-c" "-o" "build/vaps_gen/QCG/main/fileA.o" "vaps_gen/QCG/main/fileA.c"
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.scons: *** [build.ninja] CalledProcessError : Command 'ninja' returned non-zero exit status 1.
Traceback (most recent call last):
  File "C:\Tools\DEV\scons\scripts\..\SCons\Action.py", line 1310, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "C:\Tools\DEV\scons\scripts\..\SCons\Tool\ninja\__init__.py", line 123, in ninja_builder
    for output in execute_ninja():
  File "C:\Tools\DEV\scons\scripts\..\SCons\Tool\ninja\__init__.py", line 120, in execute_ninja
    raise subprocess.CalledProcessError(return_code, 'ninja')
subprocess.CalledProcessError: Command 'ninja' returned non-zero exit status 1.
scons: building terminated because of errors.

from scons.

mtribiere avatar mtribiere commented on September 27, 2024

BTW, when I asked can you post more, I was hoping the sample pasted into the issue here was a working (broken) repro, and you could paste info from that.

I'm sorry I can't dedicate much more time for a sample repo right now, but if I can I will

from scons.

jcbrill avatar jcbrill commented on September 27, 2024

@mwichmann Is it possible that the text after BUILD are terminal control characters?

The exact sequence shows up in (at least the first link):
https://stackoverflow.com/questions/66395499/sbt-has-lost-its-ability-to-format-a-screen-with-ctrl-characters-why
https://stackoverflow.com/questions/16755142/how-to-make-win32-console-recognize-ansi-vt100-escape-sequences-in-c#comment92954461_16799175

from scons.

mwichmann avatar mwichmann commented on September 27, 2024

sure, it's possible... since an external tool is involved (ninja) it's kind of hard to see what's going on, so failure to find a file and a display that shows extra chars possibly attached to a filename raised suspicions. Just guessing at the moment.

from scons.

bdbaddog avatar bdbaddog commented on September 27, 2024

How did you install ninja on your system?
Where is the binary located on your system?

from scons.

bdbaddog avatar bdbaddog commented on September 27, 2024

From the error, looks like either ninja couldn't be found, or ccppc couldn't be found.

Can you try specifing ccppc in your example SConstruct with it's full path rather than just as ccppc ?

from scons.

dmoody256 avatar dmoody256 commented on September 27, 2024

ninja produces this error when the binary it's trying to execute is not in the path:

CreateProcess failed: The system cannot find the file specified.

It is trying to create a subprocess to perform some task and the binary it tried to use in that process creation can not be found.

SCons does not generally rely on shell environment from the shell its launched from (unless you manually forced it do so) and so SCons is constructing a path internally for the commands it needs to run. Ninja however requires you to setup the shell, because it is launching the process with the given binary from the current shell environment.

from scons.

dmoody256 avatar dmoody256 commented on September 27, 2024

looking at your SConstruct a little closer I see its setting the PLATFORM to 'posix', this is causing ninja to use export to set things in ninja commands:
export PATHEXT='.COM;.EXE;.BAT;.CMD';ccppc ...
The export command is not in the default windows shell environment (cmd.exe), so it could be that the The system cannot find the file specified. message is actually from export.

from scons.

mtribiere avatar mtribiere commented on September 27, 2024

How did you install ninja on your system? Where is the binary located on your system?

I tried two ways, one with the executable inside the root folder of the project and one with the pip install ninja. Both gave the same output.

Can you try specifing ccppc in your example SConstruct with it's full path rather than just as ccppc ?

I will try a little later.

looking at your SConstruct a little closer I see its setting the PLATFORM to 'posix', [,,,]

Yes sadly it's a bit of a tricky environment where I'm on windows but I need posix-style commands/arguments. I tried export and it indeed doesn't work.

from scons.

bdbaddog avatar bdbaddog commented on September 27, 2024

How did you install ninja on your system? Where is the binary located on your system?

I tried two ways, one with the executable inside the root folder of the project and one with the pip install ninja. Both gave the same output.

Can you try specifing ccppc in your example SConstruct with it's full path rather than just as ccppc ?

I will try a little later.

looking at your SConstruct a little closer I see its setting the PLATFORM to 'posix', [,,,]

Yes sadly it's a bit of a tricky environment where I'm on windows but I need posix-style commands/arguments. I tried export and it indeed doesn't work.

Sounds more like mingw type environment?

from scons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.