Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emitter-output-dir/-o cli option not working as expected #2974

Open
swathipil opened this issue Dec 17, 2024 · 2 comments
Open

emitter-output-dir/-o cli option not working as expected #2974

swathipil opened this issue Dec 17, 2024 · 2 comments

Comments

@swathipil
Copy link
Member

I'm running the tsp-client update command in the same folder as [this tsp-location.yaml]. This points to [this spec] with [this tspconfig].

However, it's not emitting to the directory specified in emitter-output-dir (apiview-stub-generator/apistub/_generated) in the tspconfig.yaml. It's instead emitting to apiview-stub-generator.

I also tried specifying the directory in the cli using -o. However, I run into the following error:

[~/repos/azure-sdk-tools/packages/python-packages/apiview-stub-generator]$ tsp-client update -o apistub/_genera
ted
Using output directory '/home/swathip/repos/azure-sdk-tools/packages/python-packages/apiview-stub-generator/apistub/_generated'

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.13.1
Error reading tsp-location.yaml: Error: ENOENT: no such file or directory, stat '/home/swathip/repos/azure-sdk-tools/packages/python-packages/apiview-stub-generator/apistub/_generated/tsp-location.yaml'
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]
  -v, --version          Show version number                    [boolean]

Error: ENOENT: no such file or directory, stat '/home/swathip/repos/azure-sdk-tools/packages/python-packages/apiview-stub-generator/apistub/_generated/tsp-location.yaml'
    at async stat (node:internal/fs/promises:1032:18)
    at async readTspLocation (file:///home/swathip/.nvm/versions/node/v20.15.1/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/fs.js:20:26)
    at async syncCommand (file:///home/swathip/.nvm/versions/node/v20.15.1/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/commands.js:132:25)
    at async updateCommand (file:///home/swathip/.nvm/versions/node/v20.15.1/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/commands.js:291:5)
    at async Object.handler (file:///home/swathip/.nvm/versions/node/v20.15.1/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/index.js:151:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/home/swathip/repos/azure-sdk-tools/packages/python-packages/apiview-stub-generator/apistub/_generated/tsp-location.yaml'
}

I expect that it would look in current directory for tsp-location.yaml and not the output directory. Is there anything I'm missing here?

Thanks!

@msyyc
Copy link
Member

msyyc commented Dec 18, 2024

It seems an issue of tsp-client. Add @catalinaperalta for help.

@catalinaperalta
Copy link
Member

catalinaperalta commented Dec 18, 2024

@swathipil I think there are multiple issues here. First let's tackle the tsp-client update command not finding tsp-location.yaml. Have you verified that there's a tsp-location.yaml in that directory? If not, then maybe you want to run tsp-client init -c <tspconfig.yaml file url with commit> -o <path to specific output dir>

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

No branches or pull requests

3 participants