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

shell2batch stops translation When yarn or npm is encountered #572

Open
cwfitzgerald opened this issue Jul 23, 2021 · 5 comments
Open

shell2batch stops translation When yarn or npm is encountered #572

cwfitzgerald opened this issue Jul 23, 2021 · 5 comments
Assignees

Comments

@cwfitzgerald
Copy link

cwfitzgerald commented Jul 23, 2021

Describe The Bug

When using shell2batch, once a single yarn or npm is encountered, translation stops.

To Reproduce

Place the following in any cargo project's README.toml with yarn or npm available locally:

[config]
default_to_workspace = false
load_cargo_aliases = true

[tasks.js-build]
script_runner = "@shell"
script = '''
yarn install
yarn build:release
'''

The really weird thing is that when I put random applications (like vulkaninfo) in the script instead of yarn install or npm install, it works perfectly.

Error Stack

I expect both commands to run, but only a single command runs.

@sagiegurari
Copy link
Owner

I used your makefile as is and created the following package.json

{
  "name": "my_package",
  "version": "1.0.0",
  "scripts": {
    "build:release": "echo build release.... yay"
  }
}

yarn version: 1.22.10
I used gitpod to run the whole thing and it works good.

[cargo-make] INFO - cargo make 0.35.0
[cargo-make] INFO - Project: cargo-make
[cargo-make] INFO - Build File: test.toml
[cargo-make] INFO - Task: js-build
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: legacy-migration
[cargo-make] INFO - Running Task: js-build
yarn install v1.22.10
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.06s.
yarn run v1.22.10
$ echo build release.... yay
build release.... yay
Done in 0.05s.
[cargo-make] INFO - Build Done in 0.42 seconds.

so i would first try to create a simple test case so i can reproduce the issue.

@cwfitzgerald
Copy link
Author

cwfitzgerald commented Jul 23, 2021

Thanks for looking at this. That's super weird that it doesn't repro. I'll throw together a full repo for you to test.

@sagiegurari
Copy link
Owner

great thanks. that would really make things easier.
it is possible that its an issue with run_script that is known when some processes require the input stream. but... lets see once you have something.

@jayvdb
Copy link
Contributor

jayvdb commented Nov 18, 2022

Someone in my team is experience a strange problem when running a task which has npx as the command. It works if they run the same command in git bash.

We havent done a lot of investigation yet, but I recalled seeing this issue and wondered if it might be the same thing.

I am wondering if it is similar to the problems of having Windows preinstall a "python.exe" which is a wrapper to install Python from App Store https://devblogs.microsoft.com/python/python-in-the-windows-10-may-2019-update/ , which causes all sorts of problems .c.f https://stackoverflow.com/questions/58754860/cmd-opens-windows-store-when-i-type-python . I found WSL also does something similar with bash.exe kscripting/kscript#347 (comment) . I dont know if Windows is doing the same thing for npm/npx/yarn/..

@sagiegurari
Copy link
Owner

i don't have windows available so its not something i can repo.
if you have more insights or can help here, that would be great

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

No branches or pull requests

3 participants