beardsvibe / buildfox

Minimalistic Ninja generator
MIT License
50 stars 8 forks source link

ValueError: unable to deduce auto rule #100

Closed xpac27 closed 8 years ago

xpac27 commented 8 years ago

When using the latest bf from pip (to this date) and modifying my config file line 14:

build out/objects/lib/**_*.obj: auto lib/src/**/*.cpp

and line 23:

build out/libs/shlib(tw) | out/libs/lib(tw): auto out/objects/lib/**_*.obj

I get the following error:

$ bf
Traceback (most recent call last):
  File "/usr/local/bin/bf", line 9, in <module>
    load_entry_point('buildfox==0.1.2', 'console_scripts', 'bf')()
  File "/Library/Python/2.7/site-packages/buildfox/__init__.py", line 1775, in main
    engine.load(args.get("in"))
  File "/Library/Python/2.7/site-packages/buildfox/__init__.py", line 820, in load
    parse(self, filename)
  File "/Library/Python/2.7/site-packages/buildfox/__init__.py", line 459, in parse
    parser.parse()
  File "/Library/Python/2.7/site-packages/buildfox/__init__.py", line 73, in parse
    self.parse_line()
  File "/Library/Python/2.7/site-packages/buildfox/__init__.py", line 98, in parse_line
    self.engine.on_build(obj, assigns)
  File "/Library/Python/2.7/site-packages/buildfox/__init__.py", line 1061, in on_build
    name, vars = self.eval_auto(inputs_explicit, targets_explicit)
  File "/Library/Python/2.7/site-packages/buildfox/__init__.py", line 936, in eval_auto
    self.current_line_i,
ValueError: unable to deduce auto rule in 'build out/objects/lib/**_*.obj: auto lib/src/**/*.cpp', please check if your file extensions are supported by current toolchain (build.fox:14)
jimon commented 8 years ago

You need to use build obj(out/objects/lib/**_*): auto lib/src/**/*.cpp instead, because it's .o on OS X, and not .obj. Though I will try to improve logging there.

jimon commented 8 years ago

Or maybe we can just allow .obj on *nix, and .o on Windows, @den-mentiei ?

den-mentiei commented 8 years ago

I think we shouldn't allow it - it will simplify the switch to other toolchains and make everything look consistent.

We just need to clarify it in the docs and have a better error messages.

jimon commented 8 years ago

Improved error message in #101