Skip to content

concore run fails with FileNotFoundError when executed outside repository root #214

@Titas-Ghosh

Description

@Titas-Ghosh

Hi @pradeeban ,

I hope you're doing well! While testing the concore run command to simulate a standard user workflow, I encountered a FileNotFoundError that breaks usage for normal projects. I’ve analyzed the root cause and have a fix ready.

Here are the details:

Summary

The concore run command fails when executed from a standard project directory (e.g., after concore init) because the CLI assumes mkconcore.py and core assets are located in the current working directory (CWD).

This behavior breaks the standard workflow where a user installs the package, creates a new project in a separate directory, and attempts to run it.

Steps to Reproduce

  1. Install concore in editable mode:
    pip install -e .
  2. Initialize a new project in a separate directory:
    concore init my-project
    cd my-project
  3. Attempt to run a workflow:
    concore run workflow.graphml

Expected Behavior

The workflow should execute successfully, generating artifacts in the default output directory (out/), regardless of the directory from which the command is run. The CLI should resolve the absolute path to its internal scripts.

Actual Behavior

The command fails immediately because Python cannot locate the script in the current directory:

python: can't open file 'mkconcore.py': [Errno 2] No such file or directory

If the script is manually copied, subsequent errors occur because mkconcore.py resolves internal assets (like concore.hpp or concore.py) relative to the CWD (CONCOREPATH="."), causing asset lookup failures.

Root Cause Analysis

concore_cli/commands/run.py: Invokes mkconcore.py using a relative filename. This only works if the user is explicitly executing from the concore source root.
mkconcore.py: Sets CONCOREPATH to . (dot), causing it to search for C++ headers and Python bindings in the user's project folder instead of the package installation directory.

Basically it breaks the "Quick Start" flow documented in README.md.
Makes the CLI unusable for end-users who install it as a package.

Proposed Solution

I propose (and am currently implementing) the following fixes:

Absolute Path Resolution: Update run.py to dynamically resolve the absolute path of mkconcore.py using os.path.dirname(file).

Context Awareness: Ensure mkconcore.py resolves assets relative to its own installation location, not the user's CWD.

Regression Testing: Add a test case that initializes and runs a project from a temporary directory to prevent regression.

I am working on a fix for this and will submit a PR shortly.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions