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

Add --print-env option to c3c #1880

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Adversing
Copy link
Contributor

Add --print-env option to c3c to print build environment in JSON format as requested in #1832

Add `--print-env` option to `c3c` to print build environment in JSON format as requested in c3lang#1832
Added "print_env" field.
Added function init of "print_build_env" in "build.h"
@lerno
Copy link
Collaborator

lerno commented Jan 25, 2025

When wired up it produces the following for compile:

{
  "c3c": {
    "version": "0.6.7",
    "stdlib": "/Users/lerno/Projects/c3c/cmake-build-debug-latest/../lib/",
    "c3c_exe": "../../cmake-build-debug-latest/c3c"
  },
  "project": {
    "path": "/Users/lerno/Projects/c3c/resources/testproject",
    "target": "(null)"
  },
  "environment": {
    "system_path": "/opt/homebrew/bin:/opt/homebrew/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Xcode.app/Contents/Developer/../Applications/Application Loader.app/Contents/MacOS/itms/bin",
    "os": "UNKNOWN",
    "variables": {
      "env::POSIX": false,
      "env::win32": false,
      "LIBC": false
    }
  }
}
  1. It's on MacOS, so the target detection is incorrect.
  2. I don't have a project, so it should possibly list matching files and such, but not a project.

@lerno
Copy link
Collaborator

lerno commented Feb 4, 2025

Ping

@Adversing
Copy link
Contributor Author

Apologies, I can't work on it at the moment. If anyone else wants to take it on, please feel free.

@lerno
Copy link
Collaborator

lerno commented Feb 5, 2025

It's fine, I can complete it later.

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

Successfully merging this pull request may close these issues.

2 participants