Skip to content

Crash When Specifying Entrypoint File in SubDirectory #15140

@jorgerangel-msft

Description

@jorgerangel-msft

When the entrypointFile property of tsp-location.yaml is pointing to a sub-directory:

repo: Azure/azure-rest-api-specs
directory: "specification/storage/Microsoft.BlobStorage"
entrypointFile: "batch/batch-client-csharp.tsp"
commit: 8cf14494a8cb381ce332ffc656b6958cbd50b5df
emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-emitter-package.json"

The tsp-client update cmd is failing with

'output-dir' is only used to find directory containing tsp-location.yaml, the value isn't interpolated when 'emitter-output-dir' is specified in emitter options.
    Using output directory 'C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/sdk/storage/Azure.Storage.Blobs.Batch/'

    888                                      888 d8b                   888
    888                                      888 Y8P                   888
    888                                      888                       888
    888888 .d8888b  88888b.          .d8888b 888 888  .d88b.  88888b.  888888
    888    88K      888 "88b        d88P"    888 888 d8P  Y8b 888 "88b 888
    888    "Y8888b. 888  888 888888 888      888 888 88888888 888  888 888
    Y88b.       X88 888 d88P        Y88b.    888 888 Y8b.     888  888 Y88b.
     "Y888  88888P' 88888P"          "Y8888P 888 888  "Y8888  888  888  "Y888
                    888
                    888
                    888

    0.32.0
    Created temporary working directory C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/sdk/storage/Azure.Storage.Blobs.Batch/TempTypeSpecFiles
    Repo root is C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net
    Using project name: Microsoft.BlobStorage
    Created temporary sparse-checkout directory C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/../sparse-specfa5c90d2-c982-4394-b463-8c8e97a10873
    Cloning repo to C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/../sparse-specfa5c90d2-c982-4394-b463-8c8e97a10873
    Removing sparse-checkout directory C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/../sparse-specfa5c90d2-c982-4394-b463-8c8e97a10873
    Found emitter package @azure-typespec/http-client-csharp@1.0.0-alpha.20260409.3
    Skipping creation of tsp-client-metadata.yaml file.
    Discovering entry file in C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/sdk/storage/Azure.Storage.Blobs.Batch/TempTypeSpecFiles/Microsoft.BlobStorage
    update

    Sync and generate from a TypeSpec project

    Options:
      -d, --debug            Enable debug logging                          [boolean]
      -o, --output-dir       Specify an alternate output directory for the generated
                             files.                          [string] [default: "."]
      -y, --no-prompt        Skip any interactive prompts.                 [boolean]
          --help             Show help                                     [boolean]
          --repo             Repository where the project is defined        [string]
          --commit           Commit hash to be used                         [string]
          --tsp-config       Path to tspconfig.yaml                         [string]
          --local-spec-repo  Path to local spec repo                        [string]
          --emitter-options  The options to pass to the emitter             [string]
          --save-inputs      Don't clean up the temp directory after generation
                                                                           [boolean]
          --skip-install     Skip installing dependencies                  [boolean]
          --trace            Enable tracing during compile                   [array]
      -v, --version          Show version number                           [boolean]

    EXEC : error Couldn't find the entrypoint file specified in tsp-location.yaml: "batch/batch-client-csharp.tsp". Please verify that the entrypoint file name is correct.
        at discoverEntrypointFile (file:///C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/eng/common/tsp-client/node_modules/@azure-tools/typespec-client-generator-cli/dist/typespec.js:35:19)
        at async generateCommand (file:///C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/eng/common/tsp-client/node_modules/@azure-tools/typespec-client-generator-cli/dist/commands.js:342:26)
        at async updateCommand (file:///C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/eng/common/tsp-client/node_modules/@azure-tools/typespec-client-generator-cli/dist/commands.js:476:5)
        at async Object.handler (file:///C:/Users/jorgerangel/Development/AzureSdk/azure-sdk-for-net/eng/common/tsp-client/node_modules/@azure-tools/typespec-client-generator-cli/dist/index.js:193:5)

Changing the path to use \\ path separator fixes the issue. This is on a windows machine.

Metadata

Metadata

Labels

tsp-clientIssues related to tsp-client

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions