Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 2 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,37 +50,10 @@ jobs:
if: runner.os == 'macOS'
run: |
brew install autoconf automake libtool pkg-config
- name: Bootstrap registries
shell: julia --project=. {0}
run: |
using Pkg

function ensure_registry(name::String; spec=nothing)
registries = Pkg.Registry.reachable_registries()
any(registry -> registry.name == name, registries) && return
if isnothing(spec)
Pkg.Registry.add(name)
else
Pkg.Registry.add(spec)
end
end

ensure_registry("General")
ensure_registry(
"OpenModelica";
spec=Pkg.RegistrySpec(url="https://github.com/JKRT/OpenModelicaRegistry.git"),
)
- name: Resolve and build package
- uses: julia-actions/julia-buildpkg@v1
env:
JULIA_PKG_PRECOMPILE_AUTO: "0"
WENDAO_CODE_PARSER_BOOTSTRAP_ENV: ${{ runner.temp }}/wendaocodeparser-env
run: |
julia ./scripts/prepare_wendao_code_parser_env.jl
- name: Run package tests
- uses: julia-actions/julia-runtest@v1
env:
JULIA_NUM_THREADS: ${{ matrix.nthreads }}
JULIA_PKG_PRECOMPILE_AUTO: "0"
WENDAO_CODE_PARSER_BOOTSTRAP_ENV: ${{ runner.temp }}/wendaocodeparser-env
run: |
chmod +x ./scripts/test_wendao_code_parser.sh
./scripts/test_wendao_code_parser.sh
31 changes: 2 additions & 29 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,10 @@ jobs:
if: runner.os == 'macOS'
run: |
brew install autoconf automake libtool pkg-config
- name: Bootstrap registries
shell: julia --project=. {0}
run: |
using Pkg

function ensure_registry(name::String; spec=nothing)
registries = Pkg.Registry.reachable_registries()
any(registry -> registry.name == name, registries) && return
if isnothing(spec)
Pkg.Registry.add(name)
else
Pkg.Registry.add(spec)
end
end

ensure_registry("General")
ensure_registry(
"OpenModelica";
spec=Pkg.RegistrySpec(url="https://github.com/JKRT/OpenModelicaRegistry.git"),
)
- name: Resolve and build package
- uses: julia-actions/julia-buildpkg@v1
env:
JULIA_PKG_PRECOMPILE_AUTO: "0"
WENDAO_CODE_PARSER_BOOTSTRAP_ENV: ${{ runner.temp }}/wendaocodeparser-env
run: |
julia ./scripts/prepare_wendao_code_parser_env.jl
- name: Run package tests
- uses: julia-actions/julia-runtest@v1
env:
JULIA_NUM_THREADS: ${{ matrix.nthreads }}
JULIA_PKG_PRECOMPILE_AUTO: "0"
WENDAO_CODE_PARSER_BOOTSTRAP_ENV: ${{ runner.temp }}/wendaocodeparser-env
run: |
chmod +x ./scripts/test_wendao_code_parser.sh
./scripts/test_wendao_code_parser.sh
7 changes: 5 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ authors = ["CyberXiuXian Workshop"]
Absyn = "ce2f92e2-a952-11e9-0543-8b443f216f1d"
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
gRPCServer = "608c6337-0d7d-447f-bb69-0f5674ee3959"
ImmutableList = "4a558cac-c1ed-11e9-20da-3584bcd8709a"
JuliaSyntax = "70703baa-626e-46a2-a12c-08ffd08c73b4"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand All @@ -15,6 +16,7 @@ MetaModelica = "9d7f2a79-07b5-5542-8b19-c0100dda6b06"
OMParser = "11f87224-cae7-4e99-a924-e50d12f62c59"
PureHTTP2 = "7d1e1b98-28e7-4969-8df9-5a308937986a"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
WendaoArrow = "561c8d8d-4bcf-4807-873b-a6b7d1e55843"

[sources]
Expand All @@ -33,17 +35,18 @@ WendaoArrow = {rev = "e992839d84dc92ffc4972e10d160ee4ce53ce126", url = "https://
Absyn = "1.3"
Arrow = "2.8.1"
ArrowTypes = "2.3.0"
gRPCServer = "0.1"
ImmutableList = "0.1, 0.3"
JuliaSyntax = "2"
MetaModelica = "0.0.5, 0.1"
MetaModelica = "0.0.5, 0.1, 0.2"
OMParser = "0.0.3"
PureHTTP2 = "0.5.0"
Tables = "1"
TOML = "1"
WendaoArrow = "0.1"
julia = "1.12"

[extras]
gRPCServer = "608c6337-0d7d-447f-bb69-0f5674ee3959"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
Expand Down
63 changes: 40 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,29 @@ Package boundary:
The initial slice keeps the Rust client cutover out of scope and proves the
provider contract first.

`WendaoSearch.jl` can also mount these parser routes into its existing live gRPC
service with `--code-parser-route-names`, so the same Arrow Flight process can
serve both graph-search routes and AST-query routes during local loopback tests.
Service runtime:

1. `scripts/run_service.jl` starts the parser-summary and AST-query Flight
service directly from this package
2. `config/live/parser_summary.toml` is the package-local live-service
descriptor for the default Julia and Modelica parser routes
3. `contracts/wendaocodeparser_parser_summary.toml` is the package-local
route and transport contract consumed by Rust integration tests

Start the default service:

```bash
julia --project=. scripts/run_service.jl --config config/live/parser_summary.toml
```

Override listener fields without changing the package-owned route contract:

```bash
julia --project=. scripts/run_service.jl \
--config config/live/parser_summary.toml \
--host 127.0.0.1 \
--port 41081
```

Package docs now also live under `docs/`:

Expand All @@ -41,26 +61,26 @@ Current backend status:
`lib/parser -> autoconf -> ./configure -> make`
4. The current workspace lock pins `OMParser.jl` to
`https://github.com/tao3k/OMParser.jl` at
`cebc0696407385e52496608fcc13e95a556da3b5` until the bootstrap fixes are
consumed upstream
`d59051069e43fb2624aa13fe8935532ca15aecec` until the upstream source-build
fixes are consumed
5. The current workspace lock pins `WendaoArrow.jl` to
`https://github.com/tao3k/WendaoArrow.jl.git` at
`3325a646785e022a3286d08f28b19dafb4e7c8dd`
6. The package also pins the inherited `Arrow.jl`, `ArrowTypes`, and
`PureHTTP2.jl` transport sources directly in `Project.toml`, so clean
`e992839d84dc92ffc4972e10d160ee4ce53ce126`
6. The package also pins the inherited `Arrow.jl`, `ArrowTypes`,
`gRPCServer.jl`, and `PureHTTP2.jl` transport sources directly in
`Project.toml`, so clean
package resolution and GitHub Actions do not rely on a workflow-local
inherited-source bootstrap
inherited-source shim

Native bridge note:

1. `OMParser.jl` still uses a native parse bridge that resolves `Absyn`,
`ImmutableList`, and `MetaModelica` from `Main` during parser
initialization
2. `WendaoCodeParser.jl` therefore aliases those already-loaded modules into
`Main` before the first Modelica parse, especially for mounted live-child
startup under `WendaoSearch.jl`
`Main` before the first Modelica parse
3. This runtime requirement is separate from the upstream `OMParser.jl`
build/bootstrap lane: the upstream PR still matters for `Pkg.build(...)`,
source-build lane: the upstream PR still matters for `Pkg.build(...)`,
release assets, and CI coverage, but it does not by itself close the live
child startup contract

Expand Down Expand Up @@ -92,7 +112,7 @@ Parser layout note:
10. `src/parsers/julia/collect.jl` owns SyntaxNode traversal and Julia summary
or AST state collection
11. `src/parsers/modelica/backend.jl` now only owns the `OMParser.jl` native
bridge and shared-library/runtime bootstrap
bridge and shared-library/runtime initialization
12. `src/parsers/modelica/nodes.jl` owns generic Modelica AST node
materialization
13. `src/parsers/modelica/dependencies.jl` owns Modelica `import` / `extends`
Expand Down Expand Up @@ -278,12 +298,10 @@ Contract note:
distinct AST nodes instead of being collapsed globally
28. package tests are now split under `test/support/` and `test/cases/`, so
`test/runtests.jl` stays as a small runner instead of a monolithic file
29. parser-specific Flight round-trip coverage is now isolated in
`test/cases/flight_native_columns.jl`, and mounted shared-service parser
regressions are isolated under `WendaoSearch.jl/test/integration/`,
including `live_code_parser.jl`, `live_dependency_semantics.jl`,
`live_relative_dependencies.jl`, `live_modelica_import_forms.jl`, and
`live_julia_type_headers.jl`
29. parser-specific Flight round-trip coverage is isolated in
`test/cases/flight_native_columns.jl`, while parser-service route parsing,
listener config, and multiplexed live-service behavior are covered in
`test/cases/flight_services.jl`
30. AST match rows now also promote parser-owned stable columns such as
`match_target_name`, `match_root_module_name`, `match_top_level`,
`match_reexported`, `match_visibility`, `match_type_name`,
Expand All @@ -306,7 +324,6 @@ GitHub Actions note:
1. package-local CI now runs `Pkg.build()` plus `Pkg.test()` on
`ubuntu-latest` and `macos-latest` for Julia `1.12` and `pre`
2. a separate nightly workflow runs weekly on `ubuntu-latest`
3. both workflows bootstrap `General` plus `OpenModelicaRegistry` before
running `Pkg.resolve()`, `Pkg.instantiate()`, `Pkg.build()`, and package
tests, so remote runners resolve the same source-locked transport stack as
local runs
3. both workflows use `julia-actions/julia-buildpkg` and
`julia-actions/julia-runtest`, so remote runners resolve from the
package-owned source contract instead of workflow-local dependency shims
10 changes: 10 additions & 0 deletions config/live/parser_summary.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
code_parser_route_names = [
"julia_file_summary",
"julia_root_summary",
"modelica_file_summary",
"modelica_ast_query",
]

[interface]
host = "127.0.0.1"
port = 41081
21 changes: 21 additions & 0 deletions contracts/wendaocodeparser_parser_summary.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
contract_version = 1

[service]
script = "scripts/run_service.jl"
config = "config/live/parser_summary.toml"
host = "127.0.0.1"
port = 41081
default_code_parser_route_names = [
"julia_file_summary",
"julia_root_summary",
"modelica_file_summary",
"modelica_ast_query",
]

[modelica_transport]
schema_version = "v3"
file_summary_route_name = "modelica_file_summary"
ast_query_route_name = "modelica_ast_query"
file_summary_path = "/wendao/code-parser/modelica/file-summary"
ast_query_path = "/wendao/code-parser/modelica/ast-query"
readiness_route_names = ["modelica_file_summary", "modelica_ast_query"]
109 changes: 0 additions & 109 deletions scripts/prepare_wendao_code_parser_env.jl

This file was deleted.

Loading
Loading