GithubHelp home page GithubHelp logo

biojppm / cmany Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 2.0 908 KB

Easily batch-build cmake projects!

License: MIT License

Python 96.14% CMake 1.07% C++ 0.26% Batchfile 0.93% Shell 1.07% Makefile 0.53%
build-automation build-pipelines build-system build-tools cmake command-line-tool

cmany's People

Contributors

avdn avatar biojppm avatar jppm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

avdn apiviuw

cmany's Issues

cmany.yml doesn't seem to work

If I use cmany without a cmany.yml file, it seems to work fine. create_proj also seems to work. However any commands after that, that try to read the cmany.yml file, seem to crash:

PS C:\path\to\my\project> cmany create_proj
PS C:\path\to\my\project> cmany show_build_names
Traceback (most recent call last):
  File "C:\Program Files\Python38\Scripts\cmany-script.py", line 11, in <module>
    load_entry_point('cmany', 'console_scripts', 'cmany')()
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\main.py", line 52, in cmany_main
    args.func(args)
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\args.py", line 47, in exec_cmd
    proj = obj.proj(args)
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\main.py", line 137, in proj
    return Project(**vars(args))
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\project.py", line 101, in __init__
    self._init_with_build_items(**kwargs)
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\project.py", line 126, in _init_with_build_items
    self.add_build(s_, a_, c_, t_, v_)
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\project.py", line 227, in add_build
    s = _dup_item(system)
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\project.py", line 225, in _dup_item
    i.flags.resolve_flag_aliases(compiler, aliases=self.configs.flag_aliases)
  File "C:\Program Files\Python38\__manually_downloaded_via_git\cmany\src\c4\cmany\build_flags.py", line 36, in resolve_flag_aliases
    self.defines = aliases.as_defines(self.defines, compiler)
AttributeError: 'NoneType' object has no attribute 'as_defines'
PS C:\path\to\my\project>

Content of cmany.yml:

project:
  systems:
  - windows
  architectures:
  - x86_64
  compilers:
  - vs2019
  build_types:
  - Release
  variants:
  - none

python3.6: Incorrect installation layout

cmany expects the following layout:

if util.in_windows():
    SHARE_DIR = osp.abspath(
        osp.join(osp.dirname(sys.executable), 'share', 'c4', 'cmany')
    )
else:
    SHARE_DIR = osp.abspath(
        osp.join(osp.dirname(osp.dirname(sys.executable)), 'share', 'c4', 'cmany')
    )
CONF_DIR = osp.join(SHARE_DIR, 'conf')
DOC_DIR = osp.join(SHARE_DIR, 'doc')

But a vanilla pip install (pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)) creates the following:

global install:

  /usr/local/bin/cmany
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__init__.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/__init__.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/architecture.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/args.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/build.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/build_flags.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/build_item.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/build_type.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/cmake.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/combination_rules.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/compiler.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/conan.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/conf.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/flags.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/generator.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/help.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/main.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/named_item.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/project.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/system.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/util.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/variant.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/__pycache__/vsinfo.cpython-36.pyc
  /usr/local/lib/python3.6/dist-packages/c4/cmany/architecture.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/args.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/build.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/build_flags.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/build_item.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/build_type.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/cmake.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/combination_rules.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/compiler.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/conan.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/conf.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/flags.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/generator.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/help.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/main.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/named_item.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/project.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/system.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/util.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/variant.py
  /usr/local/lib/python3.6/dist-packages/c4/cmany/vsinfo.py
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2-py3.5-nspkg.pth
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/DESCRIPTION.rst
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/INSTALLER
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/METADATA
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/RECORD
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/WHEEL
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/entry_points.txt
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/metadata.json
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/namespace_packages.txt
  /usr/local/lib/python3.6/dist-packages/cmany-0.1.2.dist-info/top_level.txt
  /usr/local/share/c4/cmany/LICENSE.txt
  /usr/local/share/c4/cmany/README.rst
  /usr/local/share/c4/cmany/conf/cmany.yml
  /usr/local/share/c4/cmany/doc/build_items.txt
  /usr/local/share/c4/cmany/doc/cmany.txt
  /usr/local/share/c4/cmany/doc/dependencies.txt
  /usr/local/share/c4/cmany/doc/excluding_builds.txt
  /usr/local/share/c4/cmany/doc/flags.txt
  /usr/local/share/c4/cmany/doc/index.txt
  /usr/local/share/c4/cmany/doc/installing.txt
  /usr/local/share/c4/cmany/doc/quick_tour.txt
  /usr/local/share/c4/cmany/doc/reusing_arguments.txt
  /usr/local/share/c4/cmany/doc/vs.txt
  /usr/local/share/c4/cmany/requirements.txt
  /usr/local/share/c4/cmany/requirements_test.txt

local install:

  /home/jack/.local/bin/cmany
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__init__.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/__init__.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/architecture.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/args.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/build.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/build_flags.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/build_item.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/build_type.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/cmake.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/combination_rules.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/compiler.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/conan.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/conf.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/flags.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/generator.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/help.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/main.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/named_item.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/project.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/system.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/util.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/variant.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/__pycache__/vsinfo.cpython-36.pyc
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/architecture.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/args.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/build.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/build_flags.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/build_item.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/build_type.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/cmake.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/combination_rules.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/compiler.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/conan.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/conf.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/flags.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/generator.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/help.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/main.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/named_item.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/project.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/system.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/util.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/variant.py
  /home/jack/.local/lib/python3.6/site-packages/c4/cmany/vsinfo.py
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2-py3.5-nspkg.pth
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/DESCRIPTION.rst
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/INSTALLER
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/METADATA
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/RECORD
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/WHEEL
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/entry_points.txt
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/metadata.json
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/namespace_packages.txt
  /home/jack/.local/lib/python3.6/site-packages/cmany-0.1.2.dist-info/top_level.txt
  /home/jack/.local/share/c4/cmany/LICENSE.txt
  /home/jack/.local/share/c4/cmany/README.rst
  /home/jack/.local/share/c4/cmany/conf/cmany.yml
  /home/jack/.local/share/c4/cmany/doc/build_items.txt
  /home/jack/.local/share/c4/cmany/doc/cmany.txt
  /home/jack/.local/share/c4/cmany/doc/dependencies.txt
  /home/jack/.local/share/c4/cmany/doc/excluding_builds.txt
  /home/jack/.local/share/c4/cmany/doc/flags.txt
  /home/jack/.local/share/c4/cmany/doc/index.txt
  /home/jack/.local/share/c4/cmany/doc/installing.txt
  /home/jack/.local/share/c4/cmany/doc/quick_tour.txt
  /home/jack/.local/share/c4/cmany/doc/reusing_arguments.txt
  /home/jack/.local/share/c4/cmany/doc/vs.txt
  /home/jack/.local/share/c4/cmany/requirements.txt
  /home/jack/.local/share/c4/cmany/requirements_test.txt

Cmany displays python errors after unsuccessful build

Hello,
I really enjoy using your tool. The only thing that kinda irks me is that while developing, compiler errors are not uncommon, especially when doing meta programming, but errors during the compilation make cmany spew out (i assume) a long python exception stack trace. I see that this is just a minor inconvenience, but I don't see any additional value in showing the internal stack trace of cmany. Is there a way to disable this?

Thanks in advance, your tool is great!

P.S.: The stack trace I receive on my system (ArchLinux, up-to-date) is shown in this pastebin.

[RFC] Integrate cmany into CI workflow

Which would be the best way to integrate cmany in a CI?
Create different environments and then call cmany in the building stage with all the compilers + (debug/realease) matrix?

How is your workflow?

build serialization fails in python 3.3/3.4, but not in 3.5/3.6

From appveyor:
or from travis:

======================================================================
ERROR: test01 (test06xcompile.Test00Arm)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 272, in _getattribute
    obj = getattr(obj, subpath)
AttributeError: 'module' object has no attribute 'Var'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 911, in save_global
    obj2 = _getattribute(module, name, allow_qualname=self.proto >= 4)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 275, in _getattribute
    .format(name, obj))
AttributeError: Can't get attribute 'Var' on <module 'c4.cmany.cmake' from '/home/travis/build/biojppm/cmany/src/c4/cmany/cmake.py'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/biojppm/cmany/test/test06xcompile.py", line 84, in test01
    'linux-armv7-{compiler}-Release',
  File "/home/travis/build/biojppm/cmany/test/test06xcompile.py", line 66, in r
    do_toolchain_builds(tc_armhf, self, args, expected_builds)
  File "/home/travis/build/biojppm/cmany/test/test06xcompile.py", line 59, in do_toolchain_builds
    actual_builds = run_with_args(t, args)
  File "/home/travis/build/biojppm/cmany/test/test06xcompile.py", line 42, in run_with_args
    cmany_main(args)
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/main.py", line 41, in cmany_main
    args.func(args)
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/args.py", line 37, in exec_cmd
    obj._exec(proj, args)
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/main.py", line 133, in _exec
    proj.build()
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/project.py", line 274, in build
    self._execute(do_build, "Build", silent=False, **restrict_to)
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/project.py", line 373, in _execute
    fn(b)  # <-- here
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/project.py", line 273, in do_build
    build.build(self.targets)
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/build.py", line 232, in build
    self.configure()
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/build.py", line 186, in configure
    self.mark_configure_done(cmd)
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/build.py", line 208, in mark_configure_done
    self._serialize()
  File "/home/travis/build/biojppm/cmany/src/c4/cmany/build.py", line 151, in _serialize
    dill.dump(self, f, protocol)
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/dill/dill.py", line 274, in dump
    pik.dump(obj)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 412, in dump
    self.save(obj)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 524, in save
    self.save_reduce(obj=obj, *rv)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 627, in save_reduce
    save(state)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 479, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/dill/dill.py", line 871, in save_module_dict
    StockPickler.save_dict(pickler, obj)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 814, in save_dict
    self._batch_setitems(obj.items())
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 828, in _batch_setitems
    save(v)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 524, in save
    self.save_reduce(obj=obj, *rv)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 624, in save_reduce
    self._batch_setitems(dictitems)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 828, in _batch_setitems
    save(v)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 524, in save
    self.save_reduce(obj=obj, *rv)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 603, in save_reduce
    save(args)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 479, in save
    f(self, obj) # Call unbound method with explicit self
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 744, in save_tuple
    save(element)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 479, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/dill/dill.py", line 1299, in save_type
    StockPickler.save_global(pickler, obj)
  File "/opt/python/3.4.6/lib/python3.4/pickle.py", line 915, in save_global
    (obj, module_name, name))
_pickle.PicklingError: Can't pickle <class 'c4.cmany.cmake.CMakeCache.Var'>: it's not found as c4.cmany.cmake.Var

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.