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

Run button is not working on Windows #44

Open
lufog opened this issue Oct 27, 2021 · 10 comments
Open

Run button is not working on Windows #44

lufog opened this issue Oct 27, 2021 · 10 comments

Comments

@lufog
Copy link

lufog commented Oct 27, 2021

Run button image, opens new Terminus tab with this error message:

error: couldn't determine self executable name process is terminated with return code 1.

Sublime Text 4 build 4121
LSP v1.12.1
LSP-rust-analyzer v1.0.1
Terminus v0.3.23

@rwols
Copy link
Member

rwols commented Oct 28, 2021

Works fine here. This sounds like something Cargo-specific.

@lufog
Copy link
Author

lufog commented Oct 28, 2021

@rwols, all cargo actions from "Build With..." works fine. Could this be happening because I am using CARGO_HOME and RUSTUP_HOME environment variables, to redefine default locations for .cargo and .rustup folders?


upd:
Nope, .cargo and .rustup symlinks in user folder don't fixed the problem.


upd2:
I don't know Python, but I tried to investigate this. So I modified plugin.py and put in open_runnables_in_terminus func

print(terminus_args)

before

window.run_command("terminus_open", terminus_args)

To see if terminus_args valid. What I get:

{'title': 'run create-window', 'auto_close': False, 'cwd': 'E:\\Programming\\Windows.Education.Rust\\com.microsoft.windows-samples-rs\\create_window', 'cmd': ['cargo', 'run', '--package', 'create-window', '--bin', 'create-window']}

If I manually open the Terminus tab and paste the same thing into it, it works:
image

But if I just press the run button, I get:
image

@lufog
Copy link
Author

lufog commented Oct 29, 2021

To exclude all possible errors from my side, I decided to check everything in a virtual machine with a clean operating system. What I did, step by step:

  • installed Rust via rustup-init.exe with default parameters;
    image
  • downloaded portable Sublime Text 4 Build 4121 for Windows;
  • installed LSP, LSP-rust-analizer, Terminus packages;
    image
  • created hello_world with cargo new;
  • added hellow_world folder to editor via Project -> Add folder to project;
  • pressed Run button.

And after all, I get the same error:
image

@lufog lufog changed the title Start button not working Start button not working on Windows Oct 29, 2021
@lufog lufog changed the title Start button not working on Windows Run button not working on Windows Oct 29, 2021
@lufog lufog changed the title Run button not working on Windows Run button is not working on Windows Oct 31, 2021
@daggy1234
Copy link
Collaborator

Hey so sorry about that , so do the args the LSP sends to terminus work fine? Like when run. Based on this I'm not sure exactly whats happening. Does Terminus work okay as well?

@ShabbirHasan1
Copy link

I am encountering the same problem, is anybody able to solve this on windows 10?

@eugenesvk
Copy link

This seems like a Terminus issue, this aa.sublime-build illustrates it (add this file to your sublime user folder and run a build with: aa command on any file):

{
"cmd"   	: ["cargo"]            	, // this works
// "cmd"	: ["cargo","--version"]	, // this fails with couldn't determine self executable name
"target"	: "terminus_exec",
}

Commenting out terminus_exec target make both commands work (so does using exec as a target)

There is this exact issue opened randy3k/Terminus#310, though no solutions there either

@eugenesvk
Copy link

Found the solution — randy3k/Terminus#368 depends on a very old and buggy winpty, if you manually use the updated pypi versions of Terminus deps (in your Data\Lib\python38 as pypi has no 3.3 versions and some deps have a min py version above 3.3) and also install Terminus manually without package control (so that it doesn't auto-install those dependencies), then the Run button works!

@TakiGuan
Copy link

Found the solution — randy3k/Terminus#368 depends on a very old and buggy winpty, if you manually use the updated pypi versions of Terminus deps (in your Data\Lib\python38 as pypi has no 3.3 versions and some deps have a min py version above 3.3) and also install Terminus manually without package control (so that it doesn't auto-install those dependencies), then the Run button works!

@eugenesvk Can you help to provide more detailed guidance on how you performed to make this work? That can help a lot.

@eugenesvk
Copy link

eugenesvk commented Sep 10, 2023

maybe try this (or this fork with vendored dependencies seems to also work https://github.com/eugenesvk/Terminus/tree/vendor38 by installing all deps locally with the package)

  • install Terminus, extract it with PackageResourceViewer (or install from github locally)
  • remove dependencies.json file from Terminus' root to not auto-install deps
  • add .python-version file with 3.8 to Terminus' root to load in the 3.8 plugin host
  • extract/copy 3 python packages pyte,wcwidth ,pywinpty (3.8 version for pywinpty, others work in any) to the Data\Lib\python38 folder of your sublime text install (I think I just installed packages with pip and copied them or maybe manually downloaded and extracted .whl distributions, don't remember)

@jeefs
Copy link

jeefs commented Sep 21, 2023

I'm having this problem now, is there a solution?

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

7 participants