Skip to content

Refactor: describe each supported language once in mkconcore.py instead of repeating if/elif chains #677

Open

Description

@yadavchiragg

Problem: mkconcore.py handles each supported language with separate if langext == ... chains: about ten of them, 56 references to langext in total. They cover runtime-file copying, the Docker build, and the posix/windows/debug script generation. Adding Julia local builds (#669) meant editing about ten places, and #648 (MATLAB literal helper files not copied) is the kind of bug this structure makes easy: one file missing from a hand-written copy list.

Proposal: describe each language once (extension, runtime files for local and docker builds, how to run, how to debug) in a small table, and have the generators loop over it. I would do it in phases, each a small PR that does not change any generated output:

  1. the runtime-file copy blocks (the if '<lang>' in required_langs: sections), with a test that every listed runtime file exists,
  2. the Docker build selection,
  3. the run/debug script generation, one platform at a time.

tests/test_demo_workflows_generate.py (#674) already generates every demo workflow for every build type, so output changes would be caught.

To avoid conflicts, I would start only after the open PRs touching these chains (#669, #637, #639, #635, #672) have been merged or closed.

Does this direction work for you, or would you prefer a different structure? @pradeeban

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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