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

Errors on installing uber-juno #482

Closed
5 tasks done
goyalyashpal opened this issue Apr 10, 2023 · 18 comments
Closed
5 tasks done

Errors on installing uber-juno #482

goyalyashpal opened this issue Apr 10, 2023 · 18 comments
Labels
bug Something isn't working

Comments

@goyalyashpal
Copy link

goyalyashpal commented Apr 10, 2023

Important info containing links:

New title:
Errors on installing uber-juno

Old title was:
Dependence on ComSpec causes issues: /usr/bin/bash: /s: No such file or directory


Old report

well, this wasn't going to reach anywhere in the first place.
but, meanwhile, some other issues got some of the attention they needed. so, i thought to reframe just this description & title part of the issue to reflect that.

the new title will also look relatable elsewhere wherever this issue has appeared so far lol - all of which were about this new title: "Error on installing uber-juno"

Old title was:
Dependence on ComSpec causes issues: /usr/bin/bash: /s: No such file or directory

On clicking/expanding this para, the old report will appear under this horizontal line:


Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

What happened?

.* failed. Hide output…
    /usr/bin/bash: /s: No such file or directory

Pulsar version

1.103.0

Which OS does this happen on?

🪟 Windows

OS details

Win 10 22H2

Which CPU architecture are you running this on?

64-bit(x86_64)

What steps are needed to reproduce this?

Open Settings (bottom right gear icon) > go to any (one or more) of the following:

  • Packages > Install (arrive via URI: atom:// protocol, example here): Installing “uber-juno@0.3.0” failed. Hide output…
  • Themes > Installed themes: ``
  • Updates > Click "Check for updates": Fetching outdated packages and themes failed. Hide output…
  • Install Packages > Click "Themes" or "Packages": Fetching featured packages failed. Hide output…

Additional Information:

how did you install Pulsar? Was it from our Website?
- @ confused-Techie at #411 (comment)

  • I downloaded Pulsar from github/pulsar/releases
  • I installed Pulsar as admin, in a custom location
  • I am using msys2 on my system.
  • My system variable for current account (non-admin) is ComSpec: ...\bash.exe

@goyalyashpal goyalyashpal added the bug Something isn't working label Apr 10, 2023
@confused-Techie
Copy link
Member

Thanks a ton for opening an issue for this one.

It sounds almost like Pulsar is having trouble finding your pulsar configuration location, do you have a %userprofile%/.pulsar/ file on your system?

But otherwise I'll test with installing it to a custom location and see if I can reproduce this

@confused-Techie
Copy link
Member

Also just noticed on the other issue you commented on you asked if native modules can be compiled with msys2 toolkit.

So native modules being built to be consumable by node isn't a process controlled by Pulsar, it's really a Node thing. Which Node uses node-gyp, which looks like for Windows it specifies that you need Python, and Visual Studio Community, or Visual Studio Build Tools.

So it'd depend on if a mysys2 toolkit was a drop in replacement for Visual Studio Build Tools, or if otherwise node-gyp added support for another toolkit. So you'd wanna check in with them to see if another toolkit to compile native modules was supported.

@goyalyashpal
Copy link
Author

do you have a %userprofile%/.pulsar/ file on your system?

yep, the whole folder exists pretty well.

$ ls "$USERPROFILE/.pulsar"
blob-store     config.cson  init.js      packages       storage
compile-cache  github.cson  keymap.cson  snippets.cson  styles.less

@confused-Techie
Copy link
Member

@goyalyashpal So I noticed you used the Linux way to specify the directory location, I wonder if this is something to do with, I'm assuming you are using WSL?

I have it setup to without any issues, but might depend a bit on how Pulsar is being launched.

Otherwise, tbh I'd thinking this may be related to setting ComSpec to being bash.exe Pulsar uses a few scripts to launch Pulsar itself and PPM that is intended to integrate with having ComSpec set to cmd.exe (Or otherwise the default on Windows Systems) and can't say it's ever been tested otherwise.

Is cmd.exe still available on your PATH at all? Or would it be possible to test if this behavior still occurs when setting ComSpec back to defaults, to see at least if that's the source of the issue

@goyalyashpal
Copy link
Author

goyalyashpal commented Apr 12, 2023

I wonder if this is something to do with, I'm assuming you are using WSL?

nope, i am not using WSL. It's msys2 - it provides linux/gnu utils like bash etc - which i find much much more pleasant to work with. It's totally standalone, it works with local system, doesn't require entering in any special environment like WSL or any other such thing.

would it be possible to test if this behavior still occurs when setting ComSpec back to defaults, to see at least if that's the source of the issue

ohkay, i will see

Is cmd.exe still available on your PATH at all?

yes:

$ where cmd
C:\Windows\System32\cmd.exe
D:\msys64\usr\bin\cmd

$ which -a cmd
/c/Windows/system32/cmd
/c/WINDOWS/system32/cmd
/d/msys64/usr/bin/cmd

@goyalyashpal
Copy link
Author

goyalyashpal commented Apr 12, 2023

yep, setting ComSpec back to C:\WINDOWS\system32\cmd.exe fixed the issues

(but i will reset it back to bash, as i can't stand MS cmd 😅)

@goyalyashpal goyalyashpal changed the title /usr/bin/bash: /s: No such file or directory Dependence on ComSpec causes issues: /usr/bin/bash: /s: No such file or directory Apr 12, 2023
@confused-Techie
Copy link
Member

So I'll take a look into this, but do want to mention that it may not be something we can totally resolve.

Since it looks like this issue occurs when settings-view ./lib/package-manager.coffee uses BufferedProcess to launch a shell. We don't explicitly invoke any kind of shell, which means either this error is happening within BufferedProcess itself, or the handling of PPM.

Now hopefully there is a way to rework this in a way that works for existing users and users like yourself.

But I do want to ask @pulsar-edit/core is this something we want to work to support?

Keep in mind that the first Google Result for setting Comspec to bash is a StackOverflow post pointing out the ways this is very likely to break existing applications.

Although the simplest solution might be to see if either we can launch PPM via a specified CLI, or if we can otherwise optionally change the ./src/package-manager.js possibleApmPaths() to return the apm.sh when it detects that bash.exe is set as ComSpec. (Assuming of course that bash.exe is able to let ppm.sh run without issue on Windows.

@confused-Techie
Copy link
Member

So a follow-up here, in ./src/buffered-process.js uses child_process to spawn any shells used, such as those for where these errors are occurring.

In child_process itself, when on Windows it will use whatever %COMSPEC% is as the shell used to invoke any commands.
Since PPM is not currently compatible with this, one thing we could do is simply check if %COMSPEC% is in fact cmd.exe and if not, manually use that instead by setting shell in the spawn options.

This would effectively ignore any other terminals being used, but might be a good idea, to keep things working.

@goyalyashpal
Copy link
Author

goyalyashpal commented Apr 13, 2023

hiding myself as resolved and outdated


Just for records: After @ savetheclocktower 's input, I checked the file in VSCodium, and under "Problems" it showed following Error:

⊗ Identifier expected. 'package' is a reserved word in strict mode. Modules are automatically in strict mode.
Copy Error in VSCodium
[{
	"resource": "/%USERPROFILE%/.pulsar/packages/uber-juno/lib/incompatible-packages.js",
	"owner": "typescript",
	"code": "1214",
	"severity": 8,
	"message": "Identifier expected. 'package' is a reserved word in strict mode. Modules are automatically in strict mode.",
	"source": "ts",
	...
}]

one more thing, on trying to install that uber-juno with ComSpec:cmd, it threw following error:

[FIXED UPSTREAM] Failed to load the uber-juno package: Unexpected reserved word package

Though fixed upstream, as of 2023.04.17, fix hasn't been tagged, or new version of package with fix hasn't been released.

Versions

Atom: 1.103.0 x64
Electron: 12.2.3
OS: Microsoft Windows 10 Home Single Language
Thrown From: uber-juno package 0.3.0

Stack Trace

Failed to load the uber-juno package

At D:\ProgramFiles\Pulsar\file:\%USERPROFILE%\.pulsar\packages\uber-juno\lib\incompatible-packages.js: Unexpected reserved word 'package'. (5:11)

  3 | export function checkIncompatible () {
  4 |   let incompat = []
> 5 |   for (let package of atom.packages.getLoadedPackages()) {
    |            ^
  6 |     if (!package.isCompatible()) {
  7 |       incompat.push(package)
  8 |     }
Show Stack Trace
SyntaxError: D:\ProgramFiles\Pulsar\file:\%USERPROFILE%\.pulsar\packages\uber-juno\lib\incompatible-packages.js: Unexpected reserved word 'package'. (5:11)

  3 | export function checkIncompatible () {
  4 |   let incompat = []
> 5 |   for (let package of atom.packages.getLoadedPackages()) {
    |            ^
  6 |     if (!package.isCompatible()) {
  7 |       incompat.push(package)
  8 |     }
    at instantiate (/app.asar/node_modules/@babel/parser/lib/index.js:67:32)
    at constructor (/app.asar/node_modules/@babel/parser/lib/index.js:364:12)
    at FlowParserMixin.raise (/app.asar/node_modules/@babel/parser/lib/index.js:3364:19)
    at FlowParserMixin.checkReservedWord (/app.asar/node_modules/@babel/parser/lib/index.js:12464:12)
    at FlowParserMixin.parseIdentifierName (/app.asar/node_modules/@babel/parser/lib/index.js:12412:12)
    at FlowParserMixin.parseIdentifier (/app.asar/node_modules/@babel/parser/lib/index.js:12387:23)
    at FlowParserMixin.parseBindingAtom (/app.asar/node_modules/@babel/parser/lib/index.js:10563:17)
    at FlowParserMixin.parseBindingAtom (/app.asar/node_modules/@babel/parser/lib/index.js:5927:22)
    at FlowParserMixin.parseVarId (/app.asar/node_modules/@babel/parser/lib/index.js:13598:21)
    at FlowParserMixin.parseVarId (/app.asar/node_modules/@babel/parser/lib/index.js:5940:11)
    at FlowParserMixin.parseVar (/app.asar/node_modules/@babel/parser/lib/index.js:13577:12)
    at FlowParserMixin.parseForStatement (/app.asar/node_modules/@babel/parser/lib/index.js:13221:12)
    at FlowParserMixin.parseStatementContent (/app.asar/node_modules/@babel/parser/lib/index.js:12933:21)
    at FlowParserMixin.parseStatement (/app.asar/node_modules/@babel/parser/lib/index.js:12917:17)
    at FlowParserMixin.parseStatement (/app.asar/node_modules/@babel/parser/lib/index.js:5309:24)
    at FlowParserMixin.parseBlockOrModuleBlockBody (/app.asar/node_modules/@babel/parser/lib/index.js:13497:25)
    at FlowParserMixin.parseBlockBody (/app.asar/node_modules/@babel/parser/lib/index.js:13489:10)
    at FlowParserMixin.parseBlock (/app.asar/node_modules/@babel/parser/lib/index.js:13477:10)
    at FlowParserMixin.parseFunctionBody (/app.asar/node_modules/@babel/parser/lib/index.js:12287:24)
    at FlowParserMixin.parseFunctionBody (/app.asar/node_modules/@babel/parser/lib/index.js:5284:18)
    at FlowParserMixin.parseFunctionBodyAndFinish (/app.asar/node_modules/@babel/parser/lib/index.js:12271:10)
    at FlowParserMixin.parseFunctionBodyAndFinish (/app.asar/node_modules/@babel/parser/lib/index.js:5293:18)
    at /app.asar/node_modules/@babel/parser/lib/index.js:13637:12
    at FlowParserMixin.withSmartMixTopicForbiddingContext (/app.asar/node_modules/@babel/parser/lib/index.js:12617:14)
    at FlowParserMixin.parseFunction (/app.asar/node_modules/@babel/parser/lib/index.js:13636:10)
    at FlowParserMixin.parseFunctionStatement (/app.asar/node_modules/@babel/parser/lib/index.js:13276:17)
    at FlowParserMixin.parseStatementContent (/app.asar/node_modules/@babel/parser/lib/index.js:12947:21)
    at FlowParserMixin.parseStatement (/app.asar/node_modules/@babel/parser/lib/index.js:12917:17)
    at FlowParserMixin.parseStatement (/app.asar/node_modules/@babel/parser/lib/index.js:5309:24)
    at FlowParserMixin.parseExportDeclaration (/app.asar/node_modules/@babel/parser/lib/index.js:14181:17)
    at FlowParserMixin.parseExportDeclaration (/app.asar/node_modules/@babel/parser/lib/index.js:5527:20)
    at FlowParserMixin.maybeParseExportDeclaration (/app.asar/node_modules/@babel/parser/lib/index.js:14135:31)
    at FlowParserMixin.parseExport (/app.asar/node_modules/@babel/parser/lib/index.js:14058:29)
    at FlowParserMixin.parseExport (/app.asar/node_modules/@babel/parser/lib/index.js:5493:24)
    at FlowParserMixin.parseStatementContent (/app.asar/node_modules/@babel/parser/lib/index.js:13020:27)
    at FlowParserMixin.parseStatement (/app.asar/node_modules/@babel/parser/lib/index.js:12917:17)
    at FlowParserMixin.parseStatement (/app.asar/node_modules/@babel/parser/lib/index.js:5309:24)
    at FlowParserMixin.parseBlockOrModuleBlockBody (/app.asar/node_modules/@babel/parser/lib/index.js:13497:25)
    at FlowParserMixin.parseBlockBody (/app.asar/node_modules/@babel/parser/lib/index.js:13489:10)
    at FlowParserMixin.parseProgram (/app.asar/node_modules/@babel/parser/lib/index.js:12832:10)
    at FlowParserMixin.parseTopLevel (/app.asar/node_modules/@babel/parser/lib/index.js:12822:25)
    at FlowParserMixin.parseTopLevel (/app.asar/node_modules/@babel/parser/lib/index.js:6174:28)
    at FlowParserMixin.parse (/app.asar/node_modules/@babel/parser/lib/index.js:14674:10)
    at parse (/app.asar/node_modules/@babel/parser/lib/index.js:14716:38)
    at parser (/app.asar/node_modules/@babel/core/lib/parser/index.js:52:34)
    at parser.next (<anonymous>)
    at normalizeFile (/app.asar/node_modules/@babel/core/lib/transformation/normalize-file.js:87:38)
    at normalizeFile.next (<anonymous>)
    at run (/app.asar/node_modules/@babel/core/lib/transformation/index.js:31:50)
    at run.next (<anonymous>)
    at Object.transform (/app.asar/node_modules/@babel/core/lib/transform.js:25:41)
    at transform.next (<anonymous>)
    at evaluateSync (/app.asar/node_modules/gensync/index.js:251:28)
    at Object.sync (/app.asar/node_modules/gensync/index.js:89:14)
    at Object.exports.compile (/app.asar/src/babel.js:60:16)
    at Object.compile (/app.asar/src/package-transpilation-registry.js:66:27)
    at compileFileAtPath (/app.asar/src/compile-cache.js:106:31)
    at /app.asar/src/compile-cache.js:251:22)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Function.o._load (electron/js2c/renderer_init.js:33:379)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (/app.asar/src/native-compile-cache.js:67:27)
    at /packages/uber-juno/lib/uber-juno.coffee:3:10)
    at /packages/uber-juno/lib/uber-juno.coffee:1:1)
    at /packages/uber-juno/lib/uber-juno.coffee:1:1)
    at Module._compile (/app.asar/src/native-compile-cache.js:120:30)
    at /app.asar/src/compile-cache.js:252:23)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Function.o._load (electron/js2c/renderer_init.js:33:379)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (/app.asar/src/native-compile-cache.js:67:27)
    at requireModule (/app.asar/src/module-utils.js:3:17)
    at Package.requireMainModule (/app.asar/src/package.js:909:27)
    at /app.asar/src/package.js:141:16
    at Package.measure (/app.asar/src/package.js:82:19)
    at Package.load (/app.asar/src/package.js:127:10)
    at PackageManager.loadAvailablePackage (/app.asar/src/package-manager.js:701:10)
    at PackageManager.loadPackage (/app.asar/src/package-manager.js:630:19)
    at PackageManager.activatePackage (/app.asar/src/package-manager.js:774:17)
    at /app.asar/node_modules/settings-view/lib/package-manager.coffee:321:25
    at exit (/app.asar/node_modules/settings-view/lib/package-manager.coffee:68:7)
    at triggerExitCallback (/app.asar/src/buffered-process.js:280:9)
    at /app.asar/src/buffered-process.js:310:9)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

Non-Core Packages

uber-juno 0.3.0 
[FIXED UPSTREAM] Failed to activate the ink Package: subs is not defined

Though fixed upstream, as of 2023.04.17, fix hasn't been tagged, or new version of package with fix hasn't been released.

After replacing package with pkg in incompatible-packages.js (3 occurences), and relaunching pulsar afresh, It showed the blue information overlay on top right with "Installing smth smth", then showed following red error overlay.

Juno: Installing julia-client
Inks Package: subs not defined


Versions

Atom: 1.103.0 x64
Electron: 12.2.3
OS: Microsoft Windows 10 Home Single Language
Thrown From: ink package 0.12.6

Stack Trace

Failed to activate the ink package

At subs is not defined
Show Stack Trace
ReferenceError: subs is not defined
    at Function.activate (pane.js:14:9)
    at Object.activate (linter.js:13:14)
    at Object.activate (/packages/ink/lib/ink.coffee:48:9)
    at Package.activateNow (/app.asar/src/package.js:242:27)
    at /app.asar/src/package.js:211:27
    at Package.measure (/app.asar/src/package.js:82:19)
    at /app.asar/src/package.js:205:14
    at new Promise (<anonymous>)
    at Package.activate (/app.asar/src/package.js:203:32)
    at PackageManager.activatePackage (/app.asar/src/package-manager.js:780:36)
    at /app.asar/node_modules/settings-view/lib/package-manager.coffee:321:25
    at exit (/app.asar/node_modules/settings-view/lib/package-manager.coffee:68:7)
    at triggerExitCallback (/app.asar/src/buffered-process.js:280:9)
    at /app.asar/src/buffered-process.js:310:9)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

Non-Core Packages

hyperclick 0.1.5 
indent-detective 0.4.0 
ink 0.12.6 
language-julia 0.22.1 
latex-completions 0.3.6 
tool-bar 1.4.4 
uber-juno 0.3.0 

Unfilled Prerequisites Checklist
Unfilled template

Description

Steps to Reproduce

Expected behavior:

Actual behavior:

Commands

Additional Information

@savetheclocktower
Copy link
Contributor

That's not a fun one. Open the the incompatible-packages.js file for editing and replace each instance of the word package with anything else, like pkg.

@goyalyashpal
Copy link
Author

goyalyashpal commented Apr 13, 2023

Also, the colors here are very beautiful, i gotta say that. good job :)
Err, update: but they are totally indistinguishable in grayscale mode lol.

I don't know why it's showing internet related thing, i have a perfectly working internet connection. But also, at this point, I think it's not really Pulsar's thing... so, i will leave it at that.

2023.05 update: see this: JunoLab/Juno.jl#610 (comment) issue

Juno: Error installing package julia-client
Please check your internet connection

Error: Installing "julia-client@0.12.6" failed.

Pulsar v1.103.0

All these following are related to this very same issue, but the upstream is doing nothing :)

Unrelated-ish:


Juno Error: Installing julia-client@0.12.6 failed

@savetheclocktower
Copy link
Contributor

Man, that's a bit sloppy on the package author's part — using a variable without declaring it first.

https://github.com/JunoLab/atom-ink/blob/master/lib/linter/pane.js#L14

You can change both instances of subs to this.subs in this file and that'll fix that specific error.

@confused-Techie
Copy link
Member

@savetheclocktower Fyi it does look like @sertonix has already tried contacting the author of this package to fix some of this issues. @goyalyashpal Because this package has been neglected for so long, I do want to mention it may be a good idea to see if there are any other community packages that can accomplish the same thing. Since it seems this one isn't fully functional, which is unfortunate, but otherwise hopefully this is the last issue to arise.

@savetheclocktower
Copy link
Contributor

Maybe atom-ink should be added to our informal list of packages needing adoption.

@confused-Techie
Copy link
Member

@savetheclocktower It may also be beneficial to add a badge to this package, since it does not work at all without manual edits.

@confused-Techie
Copy link
Member

@goyalyashpal So I've talked further with the team about this issue.

Essentially the conclusion we've come to, is that while I understand it might be frustrating for things to not work properly, like I mentioned the only resource I can find about users changing the ComSpec value to something else is the chance of things breaking is likely.

And there's no realistic way to support this. If we go out of the way to support this particular program, that would also mean we need to support users changing this value to cygwin, gitbash, or a dozen other possible applications that might be used. And tbh, Pulsar itself never calls on ComSpec the NodeJS module fs does, which is the standard in operating on the filesystem, and to hack around it likely won't be an easy task at all.

So all in all, I'm glad we were able to pursue some other issues with specific packages, but as for the reason you made this issue I don't believe we will be able to support it. Thanks a ton for reporting this issue though and contributing!

@confused-Techie confused-Techie closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2023
@goyalyashpal
Copy link
Author

goyalyashpal commented May 22, 2023

btw, i just noticed that i never mentioned what the expected outcome is / solution can be...

supporting non-cmd is not an option as u noted, but maybe on the event of occuring a failure, comspec can be checked and if found guilty, then a more helpful error might be raised; smth like "ComSpec found to be non-compliant, try resetting it back to cmd"

but yeah, to be honest, thus is too corner of a use-case (& that too which's broken anyway - see comment below) - so even this may not be worth doing it...

@goyalyashpal
Copy link
Author

goyalyashpal commented May 22, 2023

yeah, lots of things break on changing comspec i.e. are dependent on it being cmd...

@goyalyashpal goyalyashpal changed the title Dependence on ComSpec causes issues: /usr/bin/bash: /s: No such file or directory Errors on installing uber-juno May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants