Skip to content

Support new version of AP242 STEP schema#470

Open
starseeker wants to merge 11 commits intostepcode:developfrom
starseeker:treat
Open

Support new version of AP242 STEP schema#470
starseeker wants to merge 11 commits intostepcode:developfrom
starseeker:treat

Conversation

@starseeker
Copy link
Copy Markdown
Member

@TRThurman here's what I've got so far for #468

starseeker and others added 10 commits February 9, 2026 09:16
* Initial plan

* Add baseline instrumentation test for PE056 in AP242 schema

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
* Implement deep aggregate unwrapping for QUERY resolution (PE056 fix)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
…#13)

* Add TREAT keyword and grammar infrastructure
* Complete TREAT infrastructure and test schema (parser generation pending)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
…pressions (#14)

Implement flow-sensitive narrowing - ap242 schema can now be read

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
…son (#15)

* Initial plan

* Add documentation and clarify TYPEis_aggregate as shallow check

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

* Add test for aggregate unwrapping with typedef chains

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

* Add TREAT-based corrected AP242 schema and comparison documentation

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

* Add AP242 schema README and update documentation with comparison references

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
…ches (#16)

Add AP242 styled_item functional test infrastructure
Test both vanilla AP242 schema (needs flow-sensitive narrowing)
and modded schema that is more strictly compliant.

Both schema tests use same STEP file

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
@TRThurman
Copy link
Copy Markdown
Member

@starseeker Conflicts this week. I hope to check this on macos next week.

@TRThurman
Copy link
Copy Markdown
Member

CI failures: duplicate add_subdirectory() for AP242 schemas

All four CI builds are failing with the same CMake error:

add_subdirectory called with binary directory "build/schemas/sdai_ap242"
  (and "build/schemas/sdai_ap242treat") already specified for a different source directory.

Root cause: Commit e1de455 added SCHEMA_CMLIST() calls for ap242 and ap242treat in test/cpp/schema_specific/CMakeLists.txt (lines 79–80). Those schemas are already built by data/CMakeLists.txt when SC_BUILD_SCHEMAS=ALL, which is the default whenever SC_ENABLE_TESTING=ON. The BRL-CAD integration tests pass because they don't enable SC_ENABLE_TESTING, so the duplicate never triggers there.

Suggested fix: Make SCHEMA_CMLIST idempotent by tracking which schema directories have already been added, using a global CMake property. This way the macro is safe to call from multiple places without requiring callers to coordinate:

diff --git a/cmake/schema_scanner/schemaScanner.cmake b/cmake/schema_scanner/schemaScanner.cmake
--- a/cmake/schema_scanner/schemaScanner.cmake
+++ b/cmake/schema_scanner/schemaScanner.cmake
@@ -97,7 +97,12 @@ macro(SCHEMA_CMLIST SCHEMA_FILE)
   string(STRIP "${_ss_out}" _ss_stripped)
   string(REGEX REPLACE "\\\n" ";" _list ${_ss_stripped})
   foreach(_dir ${_list})
-    add_subdirectory(${_dir} ${_dir}) #specify source and binary dirs as the same
+    get_property(_already_added GLOBAL PROPERTY _SC_SCHEMA_DIRS)
+    list(FIND _already_added "${_dir}" _idx)
+    if(${_idx} EQUAL -1)
+      set_property(GLOBAL APPEND PROPERTY _SC_SCHEMA_DIRS "${_dir}")
+      add_subdirectory(${_dir} ${_dir}) #specify source and binary dirs as the same
+    endif()
   endforeach(_dir ${_ss_out})

The global property _SC_SCHEMA_DIRS accumulates each directory the first time it is seen; subsequent calls for the same schema silently skip the add_subdirectory(). This keeps the fix local to the macro rather than requiring every callsite to know what has already been built.

Happy to open this as a separate PR if that would be easier.

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.

A quick experiment shows the following error from the schema scanner:

3 participants