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

psscriptanalyzer hanging #840

Open
sheldonhull opened this issue Aug 5, 2024 · 6 comments
Open

psscriptanalyzer hanging #840

sheldonhull opened this issue Aug 5, 2024 · 6 comments

Comments

@sheldonhull
Copy link
Contributor

I'm on latest version of trunk 1.22.2 and plugins were just updated v1.6.1.
I love that there is a psscriptanalyzer option, but this is the second time I've tried to use and both had timeouts.

Never seems to return and just hangs.

config that seems relevant.
Any idea what might be causing this?

version: '0.1'
cli:
  version: 1.22.2
  shell_hooks:
    path_add:
      - '${workspace}/tools'
plugins:
  sources:
    - id: trunk
      ref: v1.6.1
      uri: https://github.com/trunk-io/plugins
lint:
  enabled:
    - [email protected]
tools:
  enabled:
    - [email protected]
    - [email protected]

CleanShot 2024-08-05 at 18 38 41

CleanShot 2024-08-05 at 18 40 57

This also applied when I tried to run trunk fmt first, and it kept hanging.

@TylerJang27
Copy link
Collaborator

Hi! Sorry that you're running into this. We are investigating a similar issue with trufflehog, but we don't yet have a fix. In the meantime, you should be able to trunk daemon shutdown and then rerun and be up and running again. We will keep investigating to identify the root cause. If this doesn't fix your problem, please let us know

@sheldonhull
Copy link
Contributor Author

⬆️ bump. Any knowledge on why this is failing? I'd like to have powershell scripts linted and formatted as part of the stack but need to ensure it's fast and not hanging.

@TylerJang27
Copy link
Collaborator

Sorry, it seems to be a different issue from trufflehog, which has to do with a batching bug. We will keep looking into this, but last I checked it is an issue with psscriptanalyzer spawning child processes and disconnecting from them, which is why we can't currently support it on Mac. It's a race condition related to their execution flow, but we don't have a clean way to wrap it on our end yet.

@sheldonhull
Copy link
Contributor Author

Ok, this is useful to know.
How about a custom action, would just invoking it myself make any difference in the way you are executing if I install it as a tool?

@TylerJang27
Copy link
Collaborator

Not that I know of. Also, CLI version 1.22.6 was just released which fixes the trufflehog hanging bug. If you could give that a try if you have a reliable repro for the psscriptanalyzer hanging, please let us know.

@sheldonhull
Copy link
Contributor Author

Opened this issue up as I notice that the manual invocation of formatter fails regardless of in trunk or not. Sounds related based on your mention.

PowerShell/PSScriptAnalyzer#2031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants