You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR is set up to use cadl-apiview 0.3.4. If I run cadl compile on this PR from the specs repo, it completes and I get an APIView. I can confirm that something isn't rendering in APIView.
Now I need to debug, so I switch to the azure-sdk-tools repo and go to the cadl-apiview folder. Here I have the same dependency versions at the PR in question and I set up launch.json so that I can run APIView on this spec and debug into that process.
However, when I run this, that same spec with the same dependencies no longer even compiles. Instead it throws errors and thus I cannot debug into the program.
C:\Program Files\nodejs\node.exe .\node_modules\@cadl-lang\compiler\dist\core\cli\cli.js compile E:/repos/azure-rest-api-specs-pr/specification/cognitiveservices/HealthDecisionSupport/client.cadl --emit="E:\repos\azure-sdk-tools\tools\apiview\emitters\cadl-apiview"
Cadl compiler v0.39.0
Diagnostics were reported during compilation:
E:/repos/azure-rest-api-specs-pr/specification/cognitiveservices/HealthDecisionSupport/routes/route.oncophenotype.cadl:15:3 - error @cadl-lang/rest/duplicate-operation: Duplicate operation "GetJob1" routed at "get /".
> 15 | @summary("Get Onco Phenotype job details")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 16 | @tag("OncoPhenotype")
| ^^^^^^^^^^^^^^^^^^^^^^^
> 17 | @doc("Gets the status and details of the Onco Phenotype job.")
| ^^^^^^^^^^^^^^^^^^^^^^^
> 18 | @example("./examples/SuccessfulOncoPhenotypeResponse.json", "SuccessfulOncoPhenotypeGetAnalyzeStatus")
| ^^^^^^^^^^^^^^^^^^^^^^^
> 19 | GetJob1 is Azure.Core.ResourceRead<OncoPhenotypeResponse>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E:/repos/azure-rest-api-specs-pr/specification/cognitiveservices/HealthDecisionSupport/routes/route.trialmatcher.cadl:14:3 - error @cadl-lang/rest/duplicate-operation: Duplicate operation "GetJob2" routed at "get /".
> 14 | @summary("Get Trial Matcher job details")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 15 | @tag("TrialMatcher")
| ^^^^^^^^^^^^^^^^^^^^^^
> 16 | @doc("Gets the status and details of the Trial Matcher job.")
| ^^^^^^^^^^^^^^^^^^^^^^
> 17 | @example("./examples/SuccessfulTrialMatcherResponse.json", "SuccessfulTrialMatcherGetAnalyzeStatus")
| ^^^^^^^^^^^^^^^^^^^^^^
> 18 | GetJob2 is Azure.Core.ResourceRead<TrialMatcherResponse>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E:/repos/azure-rest-api-specs-pr/specification/cognitiveservices/HealthDecisionSupport/node_modules/@azure-tools/cadl-dpg/lib/decorators.cadl:3:1 - warning @azure-tools/cadl-azure-core/casing-style: The names of Namespace types must use PascalCase
> 3 | namespace Azure.DPG;
| ^^^^^^^^^^^^^^^^^^^^
Found 2 errors, 1 warning.
Process exited with code 1
This feels very similar to this closed issue (#1232) because it had the same symptom. Running from the spec repo behaved different than running from the azure-sdk-tools repo, but I don't know that these issues are at all related.
The text was updated successfully, but these errors were encountered:
tjprescott
changed the title
Inconsistent behavior of cadl compile
Inconsistent behavior of cadl compile depending on which repo I run an emitter from
Feb 7, 2023
I haven't figured this out yet, somehow the rest library doesn't find the right route when run from the other location. I haven't found the usual culprit of double loading of a library or global state.
The only code that seems to be loaded twice in this configuration is the cadl compiler core. There is possibly some global state in there somewhere lurking, but I haven't found it. I found one suspicious thing on projectedNameKey not using createStateSymbol, which is surely a bug, but not the blocking one.
A workaround is to change your launch.json like this, to use the core compiler next to the spec.
Here's the PR I am looking at: https://github.com/Azure/azure-rest-api-specs-pr/pull/10411
This PR is set up to use cadl-apiview 0.3.4. If I run cadl compile on this PR from the specs repo, it completes and I get an APIView. I can confirm that something isn't rendering in APIView.
Now I need to debug, so I switch to the azure-sdk-tools repo and go to the cadl-apiview folder. Here I have the same dependency versions at the PR in question and I set up launch.json so that I can run APIView on this spec and debug into that process.
However, when I run this, that same spec with the same dependencies no longer even compiles. Instead it throws errors and thus I cannot debug into the program.
This feels very similar to this closed issue (#1232) because it had the same symptom. Running from the spec repo behaved different than running from the azure-sdk-tools repo, but I don't know that these issues are at all related.
The text was updated successfully, but these errors were encountered: