Azure/azure-sdk-for-python

Python typespec generation with reasonable package length hits path limit

GrahamMThomas opened this issue · 2 comments

  • Package Name: specification\healthdataaiservices\HealthDataAIServices.Deidentification
  • Package Version:
  • Operating System: Windows, powershell 7
  • Python Version: 3.12.2

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
1.

Expected behavior
Expected generation of python sdk within the azure/azure-sdk-for-python repo.

Screenshots
If applicable, add screenshots to help explain your problem.

PS C:\Users\gthomas\sdk-repos\azure-rest-api-specs\specification\healthdataaiservices\HealthDataAIServices.Deidentification> ..\..\..\eng\scripts\TypeSpec-Generate-Sdk.ps1 -SdkRepoRootDirectory C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\ . 13df78a98978b6306302ae4332cfacaf43e7d755 https://github.com/Azure/azure-rest-api-specs
Using module powershell-yaml with version 0.4.7.
created service folder C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid
created package folder C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid
creating tsp-location.yaml in C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid
updated tsp-location.yaml commit to 13df78a98978b6306302ae4332cfacaf43e7d755
updated tsp-location.yaml repo to Azure/azure-rest-api-specs
updated tsp-location.yaml directory to specification/healthdataaiservices/HealthDataAIServices.Deidentification
updated tsp-location.yaml additionalDirectories to
finished updating tsp-location.yaml in C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid
Calling TypeSpec-Project-Sync.ps1
Using module powershell-yaml with version 0.4.7.
Reading configuration from C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid\tsp-location.yaml
Copying spec from C:\Users\gthomas\sdk-repos\azure-rest-api-specs\specification\healthdataaiservices\HealthDataAIServices.Deidentification to C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid/TempTypeSpecFiles
Calling TypeSpec-Project-Generate.ps1
Using module powershell-yaml with version 0.4.7.
Reading configuration from C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid\tsp-location.yaml
Generating from C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid\TempTypeSpecFiles\HealthDataAIServices.Deidentification
Copying package.json from C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\eng\common\scripts\..\..\emitter-package.json
Copying package-lock.json from C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\eng\common\scripts\..\..\emitter-package-lock.json
> npm ci
Command succeeded (00:00:45.6484720)

npx tsp compile C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid\TempTypeSpecFiles\HealthDataAIServices.Deidentification\client.tsp --emit @azure-tools/typespec-python --option @azure-tools/typespec-python.emitter-output-dir=C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid/
Unrecognized definition type "eTag" is found, falling back it as "string"!
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid\TempTypeSpecFiles\HealthDataAIServices.Deidentification\node_modules\@autorest\python\autorest\black\__init__.py", line 10, in <module>
    import black
ImportError: DLL load failed while importing 30fcd23745efe32ce681__mypyc: The filename or extension is too long.
Error: Command failed: py -3 C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@autorest/python/run_cadl.py --output-folder=C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid/ --cadl-file=C:/Users/gthomas/AppData/Local/Temp/cadl-codegen/typespec-python-yaml-map808768bc-d53d-402e-aa5f-6e689f88b17a.yaml --package-version=1.0.0b1 --generate-packaging-files=true --flavor=azure --package-dir=azure-healthdataaiservices-deid --package-name=azure-healthdataaiservices-deid --package-mode=azure-dataplane --models-mode=dpg --emit-cross-language-definition-file=true --from-typespec=true
Emitter "@azure-tools/typespec-python" crashed! This is a bug.
Please file an issue at https://github.com/Azure/autorest.python/issues

Error: Command failed: C:\Program Files\nodejs\node.exe C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@autorest/python/run-python3.js C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@autorest/python/run_cadl.py --output-folder=C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid/ --cadl-file=C:/Users/gthomas/AppData/Local/Temp/cadl-codegen/typespec-python-yaml-map808768bc-d53d-402e-aa5f-6e689f88b17a.yaml --package-version=1.0.0b1 --generate-packaging-files=true --flavor=azure --package-dir=azure-healthdataaiservices-deid --package-name=azure-healthdataaiservices-deid --package-mode=azure-dataplane --models-mode=dpg --emit-cross-language-definition-file=true --from-typespec=true
Unrecognized definition type "eTag" is found, falling back it as "string"!
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid\TempTypeSpecFiles\HealthDataAIServices.Deidentification\node_modules\@autorest\python\autorest\black\__init__.py", line 10, in <module>
    import black
ImportError: DLL load failed while importing 30fcd23745efe32ce681__mypyc: The filename or extension is too long.
Error: Command failed: py -3 C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@autorest/python/run_cadl.py --output-folder=C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid/ --cadl-file=C:/Users/gthomas/AppData/Local/Temp/cadl-codegen/typespec-python-yaml-map808768bc-d53d-402e-aa5f-6e689f88b17a.yaml --package-version=1.0.0b1 --generate-packaging-files=true --flavor=azure --package-dir=azure-healthdataaiservices-deid --package-name=azure-healthdataaiservices-deid --package-mode=azure-dataplane --models-mode=dpg --emit-cross-language-definition-file=true --from-typespec=true

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execFileSync (node:child_process:926:15)
    at Object.$onEmit [as emitFunction] (file:///C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@azure-tools/typespec-python/dist/src/emitter.js:88:9)
    at async runEmitter (file:///C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@typespec/compiler/dist/src/core/program.js:555:13)
    at async compile (file:///C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@typespec/compiler/dist/src/core/program.js:238:9)
    at async compileOnce (file:///C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@typespec/compiler/dist/src/core/cli/actions/compile/compile.js:37:25)
    at async compileAction (file:///C:/Users/gthomas/sdk-repos/sdk-repos/azure-sdk-for-python/sdk/deid/azure-healthdataaiservices-deid/TempTypeSpecFiles/HealthDataAIServices.Deidentification/node_modules/@typespec/compiler/dist/src/core/cli/actions/compile/compile.js:21:9)

--------------------------------------------------
Library Version                0.23.9
TypeSpec Compiler Version      0.55.0
--------------------------------------------------
Write-Error: C:\Users\gthomas\sdk-repos\azure-rest-api-specs\eng\scripts\TypeSpec-Generate-Sdk.ps1:92
Line |
  92 |      . $commonScript -TypeSpecProjectDirectory $TypeSpecProjectDirecto|      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Failed to generate sdk project at C:\Users\gthomas\sdk-repos\sdk-repos\azure-sdk-for-python\sdk\deid\azure-healthdataaiservices-deid

Additional context
Changing the package name from azure-healthdataaiservices-deid to azure-deid fixes the problem.