craftr-build / net.maxon.c4d

Build module for the MAXON Cinema 4D SDK
4 stars 3 forks source link

Errors on OSX #10

Closed fusepilot closed 7 years ago

fusepilot commented 7 years ago

Hey Niklas,

Getting a few errors trying out the latest 2.0.0.dev7. Repro here: https://github.com/fusepilot/craftr-plugin-repro

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.6
BuildVersion:   15G31

> python --version
Python 3.6.0

> pip --version
pip 9.0.1 from /Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages (python 3.6)

> craftr version
2.0.0.dev7

This is the error I get exporting for R17:

> craftr export -d c4d_path="/Applications/Maxon/Cinema 4D R17"

Loading CXX Toolkit "craftr.lang.cxx.common" (with craftr.lang.cxx.common.toolkit="")                                   (craftr.lang.cxx:33)
  cxc.name="llvm"                                                                                                       (craftr.lang.cxx:36)
  cxc.target_arch="x86_64-apple-darwin15.6.0"                                                                           (craftr.lang.cxx:37)
  cxc.version="8.0.0"                                                                                                   (craftr.lang.cxx:38)
Namespace(debug=False, rtti='false', c4d_path='/Applications/Maxon/Cinema 4D R17', release='')
load_module() is deprecated, use load() instead                                                              (NiklasRosenstein.maxon.c4d:58)
load_module() is deprecated, use load() instead                                                              (NiklasRosenstein.maxon.c4d:59)
load_module() is deprecated, use load() instead                                                              (NiklasRosenstein.maxon.c4d:61)
craftr.lang.cxx:cpp_compile() is deprecated, use cxx.compile_cpp() instead                                   (NiklasRosenstein.maxon.c4d:66)
craftr.lang.cxx:cxx_library() is deprecated, use cxx.library() instead                                       (NiklasRosenstein.maxon.c4d:68)
Traceback (most recent call last):
  File "/Users/michael/.pyenv/versions/3.6.0/bin/craftr", line 11, in <module>
    load_entry_point('craftr-build==2.0.0.dev7', 'console_scripts', 'craftr')()
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 755, in main_and_exit
    sys.exit(main())
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 751, in main
    return commands[args.command].execute(parser, args)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 222, in wrapper
    return func(*args, **kwargs)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 332, in execute
    return self._export_run_or_help(args, module)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 398, in _export_run_or_help
    module.run()
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/core/session.py", line 490, in run
    exec(code, vars(self.namespace))
  File "/Users/michael/Downloads/template/craftr/Craftrfile", line 4, in <module>
    c4d = load('NiklasRosenstein.maxon.c4d')
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/defaults.py", line 186, in load
    loaded_module.run()
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/core/session.py", line 490, in run
    exec(code, vars(self.namespace))
  File "/Users/michael/Downloads/template/craftr/modules/NiklasRosenstein.maxon.c4d/Craftrfile", line 68, in <module>
    output = 'cinema4d-{}-{}'.format(mode, cxc.target_arch)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/stl/craftr.lang.cxx/Craftrfile", line 99, in cxx_library
    return library(*args, name=gtn(name, None), **kwargs)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/stl/craftr.lang.cxx/Craftrfile", line 49, in library
    target = cxc.staticlib(*args, name=gtn(name, None), **kwargs)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/stl/craftr.lang.cxx.common/Craftrfile", line 305, in staticlib
    return self.ar.staticlib(*args, name=gtn(name, None), **kwargs)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/stl/craftr.lang.cxx.common/Craftrfile", line 556, in staticlib
    description='ar staticlib ($out)')
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/targetbuilder.py", line 260, in build
    session.graph.add_target(target)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/core/build.py", line 127, in add_target
    .format(target.name))
ValueError: a target with the name 'NiklasRosenstein.maxon.c4d-1.0.1.c4d_sdk_library' already exists

And then a different error for R15:

> craftr export -d c4d_path="/Applications/Maxon/Cinema 4D R15"

Loading CXX Toolkit "craftr.lang.cxx.common" (with craftr.lang.cxx.common.toolkit="")                                   (craftr.lang.cxx:33)
  cxc.name="llvm"                                                                                                       (craftr.lang.cxx:36)
  cxc.target_arch="x86_64-apple-darwin15.6.0"                                                                           (craftr.lang.cxx:37)
  cxc.version="8.0.0"                                                                                                   (craftr.lang.cxx:38)
Namespace(debug=False, rtti='false', c4d_path='/Applications/Maxon/Cinema 4D R15', release='')
load_module() is deprecated, use load() instead                                                              (NiklasRosenstein.maxon.c4d:58)
Traceback (most recent call last):
  File "/Users/michael/.pyenv/versions/3.6.0/bin/craftr", line 11, in <module>
    load_entry_point('craftr-build==2.0.0.dev7', 'console_scripts', 'craftr')()
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 755, in main_and_exit
    sys.exit(main())
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 751, in main
    return commands[args.command].execute(parser, args)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 222, in wrapper
    return func(*args, **kwargs)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 332, in execute
    return self._export_run_or_help(args, module)
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/__main__.py", line 398, in _export_run_or_help
    module.run()
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/core/session.py", line 490, in run
    exec(code, vars(self.namespace))
  File "/Users/michael/Downloads/template/craftr/Craftrfile", line 4, in <module>
    c4d = load('NiklasRosenstein.maxon.c4d')
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/defaults.py", line 186, in load
    loaded_module.run()
  File "/Users/michael/.pyenv/versions/3.6.0/lib/python3.6/site-packages/craftr/core/session.py", line 490, in run
    exec(code, vars(self.namespace))
  File "/Users/michael/Downloads/template/craftr/modules/NiklasRosenstein.maxon.c4d/Craftrfile", line 58, in <module>
    sdk, legacy_sdk = load_file('sdk.py').get_frameworks()
  File "/Users/michael/Downloads/template/craftr/modules/NiklasRosenstein.maxon.c4d/sdk.py", line 177, in get_frameworks
    c4d_sdk = get_mac_framework()
  File "/Users/michael/Downloads/template/craftr/modules/NiklasRosenstein.maxon.c4d/sdk.py", line 154, in get_mac_framework
    forced_include = [join(source_dir, 'ge_mac_flags.h')]
NameError: name 'join' is not defined
NiklasRosenstein commented 7 years ago

Hi @fusepilot , it seems you have a relatively old version of the code. Please make sure you get the newest from the repository. The second exception is definitely already resolved in the current code. I am unsure about the first exception. Please try again with the latest version.

NiklasRosenstein commented 7 years ago

Btw. you can check the stability of the latest version on Travis CI where the C4D SDK is compiled on macOS and Linux, and AppVeyor for Windows.

fusepilot commented 7 years ago

Yeah, I'm not sure what happened there. I must have been looking at an old version of this repo when I downloaded it originally. But now that I've dropped in the latest, I get this error now:

> craftr export -d directory="/Applications/Maxon/Cinema 4D R17/" 

Loading CXX Toolkit "craftr.lang.cxx.common" (with craftr.lang.cxx.common.toolkit="")                           (craftr.lang.cxx:33)
  cxc.name="llvm"                                                                                               (craftr.lang.cxx:36)
  cxc.target_arch="x86_64-apple-darwin15.6.0"                                                                   (craftr.lang.cxx:37)
  cxc.version="8.0.0"                                                                                           (craftr.lang.cxx:38)
error: C4D installation path could not be determined

I also tried > craftr export -d .directory="/Applications/Maxon/Cinema 4D R17/"

I debugged a little bit and it seems like options.directory in the Craftrfile is always empty. Am I not passing options correctly? Also is there an up to date c++ example that has all of this working?

NiklasRosenstein commented 7 years ago

The "directory" option is not inheritable from the global options namespace, thus it must be specified with its full name.

craftr export -d NiklasRosenstein.maxon.c4d.directory="..."

If you build your plugin from inside the C4D application plugin's folder and your Cinema 4D installation directory's name is of the format Cinema 4D RXX it should automatically be able to detect the directory and version. Otherwise you will also need to specify the NiklasRosenstein.maxon.c4d.release=17 option.

The template directory contains an example that is (or should be) working.

NiklasRosenstein commented 7 years ago

I just noticed you used a relative option name (with the . (dot) in the beginning). What is the main module you want yo build: Your plugin or the C4D SDK? Because a relative option name is relative to the main module, and if you build your plugin, it's going to be yourpluginmodulename.directory option that you specify.

fusepilot commented 7 years ago

Thanks Niklas. craftr export -d NiklasRosenstein.maxon.c4d.directory="..." works. I didn't pick up on that reading through the docs.