How to use the fusesoc.coremanager.DependencyError function in fusesoc

To help you get started, we’ve selected a few fusesoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github olofk / fusesoc / fusesoc / main.py View on Github external
export_root = None
    try:
        work_root   = os.path.join(build_root,
                                   core.get_work_root(flags))
    except SyntaxError as e:
        logger.error(e.msg)
        exit(1)
    eda_api_file = os.path.join(work_root,
                                core.name.sanitized_name+'.eda.yml')
    if not os.path.exists(eda_api_file):
        do_configure = True

    if do_configure:
        try:
            cores = cm.get_depends(core.name, flags)
        except DependencyError as e:
            logger.error(e.msg + "\nFailed to resolve dependencies for {}".format(system))
            exit(1)
        except SyntaxError as e:
            logger.error(e.msg)
            exit(1)
        try:
            edalizer = Edalizer(core.name,
                                flags,
                                cores,
                                cache_root=cm.config.cache_root,
                                work_root=work_root,
                                export_root=export_root,
                                system_name=system_name)
        except SyntaxError as e:
            logger.error(e.msg)
            exit(1)
github optimsoc / optimsoc / fusesoc / main.py View on Github external
def _get_core(name, has_system=False):
    core = None
    try:
        core = CoreManager().get_core(Vlnv(name))
    except RuntimeError as e:
        pr_err(str(e))
        exit(1)
    except DependencyError as e:
        pr_err("'" + name + "' or any of its dependencies requires '" + e.value + "', but this core was not found")
        exit(1)
    if has_system and not core.backend:
        pr_err("Unable to find .system file for '{}'".format(name))
        exit(1)
    return core
github optimsoc / optimsoc / fusesoc / coremanager.py View on Github external
top_core.relation,
                                     self._package_version(top_core))
        requirement = Requirement._from_string(_top_dep)
        request.install(requirement)
        installed_repository = Repository()
        pool = Pool([repo])
        pool.add_repository(installed_repository)
        solver = DependencySolver(pool, [repo], installed_repository)

        try:
            transaction = solver.solve(request)
        except SatisfiabilityError as e:
            msg = "UNSATISFIABLE: {}"
            raise RuntimeError(msg.format(e.unsat.to_string(pool)))
        except NoPackageFound as e:
            raise DependencyError(top_core.name)

        return [op.package.core for op in transaction.operations]
github olofk / fusesoc / fusesoc / coremanager.py View on Github external
top_core.relation,
                                     self._package_version(top_core))
        requirement = Requirement._from_string(_top_dep)
        request.install(requirement)
        installed_repository = Repository()
        pool = Pool([repo])
        pool.add_repository(installed_repository)
        solver = DependencySolver(pool, [repo], installed_repository)

        try:
            transaction = solver.solve(request)
        except SatisfiabilityError as e:
            raise DependencyError(top_core.name,
                                  msg=e.unsat.to_string(pool))
        except NoPackageFound as e:
            raise DependencyError(top_core.name)

        objdict = {}
        depdict = {}
        if (len(transaction.operations) > 1):
            for op in transaction.operations:
                objdict[op.package._name] = str(op.package.core.name)
                depdict[str(op.package.core.name)] = [objdict[n[0]] for n in op.package.install_requires]
                op.package.core.direct_deps = [objdict[n[0]] for n in op.package.install_requires]
        return [op.package.core for op in transaction.operations]
github olofk / fusesoc / fusesoc / coremanager.py View on Github external
request = Request()
        _top_dep = "{} {} {}".format(self._package_name(top_core),
                                     top_core.relation,
                                     self._package_version(top_core))
        requirement = Requirement._from_string(_top_dep)
        request.install(requirement)
        installed_repository = Repository()
        pool = Pool([repo])
        pool.add_repository(installed_repository)
        solver = DependencySolver(pool, [repo], installed_repository)

        try:
            transaction = solver.solve(request)
        except SatisfiabilityError as e:
            raise DependencyError(top_core.name,
                                  msg=e.unsat.to_string(pool))
        except NoPackageFound as e:
            raise DependencyError(top_core.name)

        objdict = {}
        depdict = {}
        if (len(transaction.operations) > 1):
            for op in transaction.operations:
                objdict[op.package._name] = str(op.package.core.name)
                depdict[str(op.package.core.name)] = [objdict[n[0]] for n in op.package.install_requires]
                op.package.core.direct_deps = [objdict[n[0]] for n in op.package.install_requires]
        return [op.package.core for op in transaction.operations]