faust icon indicating copy to clipboard operation
faust copied to clipboard

faust2sc should throw error if it encountrers problems generating a file

Open LFSaw opened this issue 4 years ago • 0 comments

reproducer

a dsp-file nonstandardname.dsp with content

declare name "not an sc - naming scheme";

process = 1 - 1';

compiling with faust2supercollider (in debug mode) shows an error in faust2sc, this does not show up when running it without the -d option and thus does not point to a possible error.

$ faust2supercollider -d nonstandardname.dsp
faust2sc[INFO]  Parsing nonstandardname.dsp.xml ...
faust2sc[INFO]  Generating sclang code for not an sc - naming scheme ...
faust2sc[ERROR] no implicit conversion of nil into String
faust2sc[ERROR] /usr/local/bin/faust2sc:54:in `+'
faust2sc[ERROR] /usr/local/bin/faust2sc:54:in `encapitalize'
faust2sc[ERROR] /usr/local/bin/faust2sc:320:in `block in make_class_name'
faust2sc[ERROR] /usr/local/bin/faust2sc:320:in `each_index'
faust2sc[ERROR] /usr/local/bin/faust2sc:320:in `make_class_name'
faust2sc[ERROR] /usr/local/bin/faust2sc:364:in `initialize'
faust2sc[ERROR] /usr/local/bin/faust2sc:535:in `new'
faust2sc[ERROR] /usr/local/bin/faust2sc:535:in `generate_plugin'
faust2sc[ERROR] /usr/local/bin/faust2sc:162:in `block in generate_body'
faust2sc[ERROR] /usr/local/bin/faust2sc:158:in `each'
faust2sc[ERROR] /usr/local/bin/faust2sc:158:in `each_with_index'
faust2sc[ERROR] /usr/local/bin/faust2sc:158:in `generate_body'
faust2sc[ERROR] /usr/local/bin/faust2sc:150:in `generate'
faust2sc[ERROR] /usr/local/bin/faust2sc:625:in `<main>'
faust2sc[ERROR] Omitting nonstandardname.dsp.xml
Retaining intermediate products directory 'faust.ZgBJrT'
./nonstandardname.scx;./nonstandardname.sc; 

cd into temp dir and running faust2sc manually creates same error messages

$ cd faust.ZgBJrT
$ faust2sc nonstandardname/nonstandardname.dsp.xml
faust2sc[INFO]  Parsing nonstandardname/nonstandardname.dsp.xml ...
faust2sc[INFO]  Generating sclang code for not an sc - naming scheme ...
faust2sc[ERROR] no implicit conversion of nil into String
faust2sc[ERROR] /usr/local/bin/faust2sc:54:in `+'
faust2sc[ERROR] /usr/local/bin/faust2sc:54:in `encapitalize'
faust2sc[ERROR] /usr/local/bin/faust2sc:320:in `block in make_class_name'
faust2sc[ERROR] /usr/local/bin/faust2sc:320:in `each_index'
faust2sc[ERROR] /usr/local/bin/faust2sc:320:in `make_class_name'
faust2sc[ERROR] /usr/local/bin/faust2sc:364:in `initialize'
faust2sc[ERROR] /usr/local/bin/faust2sc:535:in `new'
faust2sc[ERROR] /usr/local/bin/faust2sc:535:in `generate_plugin'
faust2sc[ERROR] /usr/local/bin/faust2sc:162:in `block in generate_body'
faust2sc[ERROR] /usr/local/bin/faust2sc:158:in `each'
faust2sc[ERROR] /usr/local/bin/faust2sc:158:in `each_with_index'
faust2sc[ERROR] /usr/local/bin/faust2sc:158:in `generate_body'
faust2sc[ERROR] /usr/local/bin/faust2sc:150:in `generate'
faust2sc[ERROR] /usr/local/bin/faust2sc:625:in `<main>'
faust2sc[ERROR] Omitting nonstandardname/nonstandardname.dsp.xml

but return state of faust2sc is 0 (should be 1).

environment

$ faust -v
FAUST Version 2.28.8
Embedded backends:
   DSP to C
   DSP to C++
   DSP to FIR
   DSP to Interpreter
   DSP to Java
   DSP to LLVM IR
   DSP to old C++
   DSP to Rust
   DSP to SOUL
   DSP to WebAssembly (wast/wasm)
Build with LLVM version 10.0.0
Copyright (C) 2002-2020, GRAME - Centre National de Creation Musicale. All rights reserved.
$ git rev-parse HEAD
c1bce6cd64214ab58e49ddba259e0c0616a585bf
$

LFSaw avatar Nov 22 '20 15:11 LFSaw