What's the best way to uninstall pants on windows?...
# general
r
What's the best way to uninstall pants on windows? Coworker of mine is dealing with a nasty cache issue that we seem to have made worse by deleting stuff from the cache 😬
✅ 1
f
Pants doesn't really have installation outside of a few caches. You should be able to uninstall it by blowing them all away. On Unix like systems they're in
~/.cache/pants
and
~/.cache/nce
. Not sure where those cache dirs are in windows under wsl but in principle it should be the same thing
r
Yeah we nuked
~/.cache/pants
but now it's just telling us it can't find stuff from the cache
f
pkill pantsd
maybe?
It's possible the running Pantsd daemon still think the caches are there
r
This is the error we're getting now while trying to run pants peek
Copy code
ProcessExecutionFailure: Process 'Parse Terraform module sources: arbitrary/terraform/module' failed with exit code 1.
stdout:

stderr:
Traceback (most recent call last):
  File "/home/moncrieffed1/.cache/pants/named_caches/pex_root/venvs/s/ef0390ce/venv/lib/python3.8/site-packages/lark/lexer.py", line 598, in lex
    token = self.root_lexer.next_token(lexer_state, parser_state)
  File "/home/moncrieffed1/.cache/pants/named_caches/pex_root/venvs/s/ef0390ce/venv/lib/python3.8/site-packages/lark/lexer.py", line 528, in next_token
    raise UnexpectedCharacters(lex_state.text, line_ctr.char_pos, line_ctr.line, line_ctr.column,
' in the current parser context, at line 1 col 12 matches '

terraform {
           ^
Expected one of:
        * RPAR
        * "&&"
        * STAR
        * LSQB
        * COMMA
        * PLUS
        * /<<-(?P<heredoc_trim>[a-zA-Z][a-zA-Z0-9._-]+)\n(?:.|\n)*?(?P=heredoc_trim)/
        * ".*"
        * EXP_MARK
        * LESSTHAN
        * PERCENT
        * "||"
        * /<<(?P<heredoc>[a-zA-Z][a-zA-Z0-9._-]+)\n(?:.|\n)*?(?P=heredoc)/
        * "=>"
        * "<="
        * MORETHAN
        * COLON
        * QMARK
        * "..."
        * LPAR
        * /#.*\n/
        * EQUAL
        * MINUS
        * DECIMAL
        * LBRACE
        * SLASH
        * "=="
        * RBRACE
        * RSQB
        * /[a-zA-Z_][a-zA-Z0-9_-]*/
        * /\/\/.*\n/
        * "[*]"
        * BANG
        * STRING_LIT
        * ">="
        * /\n/
        * "!="
        * DOT

Previous tokens: Token('LBRACE', '{')
f
Looks like it's trying to introspect something about your terraform modules and it's not able to parse them
r
I am unable to recreate this issue on my own machine with the same file contents. We also tried moving the
python-hcl2
dependency to a resolve but it's still happening. However, there's no issue when we activate the venv for that resolve and run it directly, so it's definitely something really screwy going on with the virtual environments.
f
the venvs should have been recreated when you nuked the caches though
r
after like 4 hours of investigation we found the issue...windows line endings
f
From that traceback ... "/home/moncrieffed1/.cache/pants/named_caches/pex_root/venvs/s/ef0390ce/venv/lib/*python3.8*/site-packages/lark/lexer.py" is that python version expected?
oh snap
r
lmao
f
r
I use a mac now but I can't tell you how many times at my previous job I'd go through a deploy process + EMR cluster spin up only for the launcher bash script to immediately fail due to line endings 😅
f
I've always set this gitattributes thing up when I've had people using windows dev machines, it's a huge huge time saver