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

Windows 'teminus_exec' fails with cargo with arguments #368

Open
eugenesvk opened this issue Jul 27, 2022 · 7 comments
Open

Windows 'teminus_exec' fails with cargo with arguments #368

eugenesvk opened this issue Jul 27, 2022 · 7 comments

Comments

@eugenesvk
Copy link

This is a copy of a previously closed, but still unresolved issue #310

I've managed to find out that the core issue is that the winpty version is too old — for some reason it doesn't work with composable commands like ["cargo","--version"], only works with ["cargo"] (same issue with rustc)

After I've manually updated winpty that your pywinpty uses to the latest version the issue disappeared

  • had to update all pyte, wcwidth, winpty and Terminus to use the python 3.8 plugin host
  • removed any explicit dependencies by Terminus to force it to use the manually installed packages

(haven't tested any of the previous versions nor tested with the 3.3 plugin host (the latest version of pyte requires 3.7)

Would you please update this and your other packages to the latest pypi versions that would finally resolve this issue?
Thanks!

@PWAlessi
Copy link

I'm having the same issue in Sublime. You should probably submit a PR with your fix.

@eugenesvk
Copy link
Author

It's not that simple — the fix touches dependencies, which are poorly documented, so I couldn't even test them locally

And as I've later found out after wasting much time on trying to fix the deps, you might not even be able to move deps to python 3.8 according to this forum comment

No. Only py33 plugin can use dependencies at this moment.

(that explains why my local dependencies only worked under the python 3.3 plugin host despite all the .python-version with 38 files I added)

Thus the fix might be more involved and require vendoring all the deps instead, but that might also be rather tricky due to the way Sublime overrides python package loading (I had issues with loading deps that were failing because they couldn't find themselves before)

So I'm not sure what the proper fix is and will better wait for the more knowledgable repo/deps owner to chime in

@randy3k
Copy link
Owner

randy3k commented Aug 5, 2022

@eugenesvk, thanks for the detail investigation. So the workaround is to update https://github.com/packagecontrol/pywinpty?

@eugenesvk
Copy link
Author

There might be a simple workaround like that, though the challenge is that the newer https://pypi.org/project/pywinpty/ versions might not work with the old py3.3 plugin host in Sublime

  • pywinpty 2.0.6 Released: Jul 7, 2022 lists Python >=3.7 as a requirement
  • pywinpty 1.1.1 Released: May 19, 2021 lists Python >=3.6 as a requirement
  • pywinpty 1.1.0 Released: May 18, 2021 is the latest that does NOT list a newer Python version

Maybe the version 1.1.0 :

  • works with the Python 3.3 plugin host and
  • fixes the issue

but there are no py3.3 wheels on pypi, so I haven't tested it.

Otherwise you'd need to update not only pywinpty, but also all the other dependencies of Terminus (pyte and wcwidth), move all of them to the new py3.8 plugin host and, since this new plugin host doesn't seem to support dependencies yet, vendor all the dependencies instead of relying on package control

Or maybe I'm missing something and there is a simpler way

@eugenesvk
Copy link
Author

fyi this fork seems to work via a direct Package Control install, it vendors those deps (and thus can't be packed due to winpty binaries) and uses a hack to append module loading path (didn't manage to do it propertly, winpty would only load when placed in the plugin hosts' folder, not locally with Terminus)

@jeefs
Copy link

jeefs commented Sep 20, 2023

I'm also experiencing this problem, what should I do to fix it?

@gwentmaster
Copy link

passing the original command to a shell like cmd or bash works for me

{
    "cancel": "terminus_cancel_build",
    "cmd": [
        "cmd", "/C",
        "cargo test $file -- tests --nocapture"
    ],
    "env": {
        "RUSTFLAGS": "-Awarnings"
    },
    "file_regex": "(?|, ([^,<\n]*\\.[A-z]{2}):([0-9]+)|[ \t]*-->[ \t]*([^<\n]*):([0-9]+):([0-9]+))",
    "selector": "source.rust",
    "syntax": "Packages/Rust/Cargo.sublime-syntax",
    "target": "terminus_exec",
    "working_dir": "$project_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

5 participants