-
Notifications
You must be signed in to change notification settings - Fork 1
Codex-generated pull request #8
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
Merged
DarkStarStrix
merged 1 commit into
main
from
codex/add-missing-features-and-improve-compiler
Feb 16, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,40 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
| project(PyC_Core C CXX) | ||
|
|
||
| # Set the source directory | ||
| set(SRC_DIR "${CMAKE_SOURCE_DIR}/Core/C_Files") | ||
| set(HEADER_DIR "${CMAKE_SOURCE_DIR}/Core/Header") | ||
|
|
||
| # Gather all .c and .cpp files | ||
| file(GLOB SOURCES | ||
| "${SRC_DIR}/*.c" | ||
| "${SRC_DIR}/*.cpp" | ||
| set(CMAKE_C_STANDARD 11) | ||
| set(CMAKE_C_STANDARD_REQUIRED ON) | ||
| set(CMAKE_CXX_STANDARD 11) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
|
||
| set(HEADER_DIR "${CMAKE_SOURCE_DIR}/Core/Header_Files") | ||
| include_directories(${HEADER_DIR}) | ||
|
|
||
| # Build a stable core library that is currently portable and compiles in CI. | ||
| add_library(pyc_foundation STATIC | ||
| Core/C_Files/stack.c | ||
| Core/C_Files/symbol_table.c | ||
| ) | ||
|
|
||
| # Add the executable | ||
| add_executable(PyC_Core ${SOURCES}) | ||
| target_include_directories(pyc_foundation PUBLIC ${HEADER_DIR}) | ||
|
|
||
| # Ensure the compiler can find your header files! | ||
| target_include_directories(PyC_Core PRIVATE ${HEADER_DIR}) | ||
| option(PYC_BUILD_EXPERIMENTAL "Build experimental compiler sources" OFF) | ||
|
|
||
| # (Optional) Set C++ standard if needed | ||
| set_target_properties(PyC_Core PROPERTIES | ||
| CXX_STANDARD 11 | ||
| CXX_STANDARD_REQUIRED YES | ||
| ) | ||
| if(PYC_BUILD_EXPERIMENTAL) | ||
| message(STATUS "Building experimental PyC compiler sources") | ||
|
|
||
| add_executable(PyC_Core | ||
| Core/C_Files/Core.cpp | ||
| Core/C_Files/IR.c | ||
| Core/C_Files/api.c | ||
| Core/C_Files/backend.c | ||
| Core/C_Files/codegen.c | ||
| Core/C_Files/error_handler.c | ||
| Core/C_Files/frontend.c | ||
| Core/C_Files/ir_generator.c | ||
| Core/C_Files/lexer.c | ||
| Core/C_Files/main.c | ||
| Core/C_Files/parser.c | ||
| ) | ||
|
|
||
| # (Optional) Link libraries here, e.g.: | ||
| # target_link_libraries(PyC_Core PRIVATE <library_name>) | ||
| target_include_directories(PyC_Core PRIVATE ${HEADER_DIR}) | ||
| endif() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 2 months ago
In general, the fix is to explicitly declare the minimal required
GITHUB_TOKENpermissions in the workflow YAML using apermissions:block, either at the top level (applies to all jobs) or per job. Since this workflow only needs to read repository contents to check out and build,contents: readis sufficient.The best fix here, without changing functionality, is to add a root-level
permissionsblock near the top of.github/workflows/c-cpp.yml, for example immediately after theon:section (or beforejobs:). This will apply to all jobs (currently justlinux-build) and restrict the automaticGITHUB_TOKENto read-only access to repository contents. No changes to steps, actions, or other configuration are necessary.Concretely:
Edit
.github/workflows/c-cpp.yml.Insert:
between the
on:block and theconcurrency:block (or equivalently betweenon:andjobs:if preferred), keeping indentation consistent.No new imports, libraries, or additional GitHub Actions are required.