Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO] Change JSON config language API #8

Open
JustinMeimar opened this issue Nov 17, 2024 · 0 comments
Open

[TODO] Change JSON config language API #8

JustinMeimar opened this issue Nov 17, 2024 · 0 comments

Comments

@JustinMeimar
Copy link
Collaborator

JustinMeimar commented Nov 17, 2024

The current API is coupled to a single runtime library config. It can be extended to a generic ENV field for each executable.
With this we can solve platform compatibility between macOS and linux at the config level and save several LOC that handle shared library setup internally. Making ENV variables first class also just makes the tester more generic.

The reason this was not done in F24 is because it is an API breaking change which would require updating all the student configs.

Current config for runtime compilers:

{
  "testDir": "../packages/RuntimeCPackage",
  "testedExecutablePaths": {
    "gcc": "/usr/bin/clang"
  },
  "runtimes": {
    "gcc": "../lib/libfib.so"
  },
  "toolchains": {
    "clang-runtime": [
      {
        "stepName": "clang",
        "executablePath": "$EXE",
        "arguments": ["-c", "$INPUT", "-o", "$OUTPUT"],
        "output": "/tmp/prog.o"
      },
      {
        "stepName": "compile",
        "executablePath": "$EXE",
        "arguments": ["$INPUT", "-o", "$OUTPUT", "-L$RT_PATH", "-l$RT_LIB"],
        "output": "/tmp/prog"
      },
      {
        "stepName": "run",
        "executablePath": "$INPUT",
        "arguments": [],
        "usesInStr": true,
        "allowError": true,
        "usesRuntime": true
      }
    ]
  }
}

Proposed Change:
Create a distinction between automatic variables and environment variables (@ and $ respectively)

{
  "testDir": "../packages/RuntimeCPackage",
  "testedExecutablePaths": {
    "gcc": {
       "path":
       "env": {
          ''LD_LIBRARY_PATH": "../lib"
       }
     }
  },
  "toolchains": {
    "clang-runtime": [
      {
        "stepName": "clang",
        "executablePath": "@EXE",
        "arguments": ["-c", "@INPUT", "-o", "@OUTPUT"],
        "output": "/tmp/prog.o"
      },
      {
        "stepName": "compile",
        "executablePath": "@EXE",
        "arguments": ["@INPUT", "-o", "@OUTPUT", "-L$RT_PATH", "-l$RT_LIB"],
        "output": "/tmp/prog"
      },
      {
        "stepName": "run",
        "executablePath": "@INPUT",
        "arguments": [],
        "usesInStr": true,
        "allowError": true,
        "usesRuntime": true
      }
    ]
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant