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

Linux binary install via NPM no longer works with Spago 0.7 #157

Closed
Dretch opened this issue Mar 24, 2019 · 13 comments
Closed

Linux binary install via NPM no longer works with Spago 0.7 #157

Dretch opened this issue Mar 24, 2019 · 13 comments

Comments

@Dretch
Copy link
Contributor

Dretch commented Mar 24, 2019

With Spago 0.6.4, on Linux, there was a binary installed at node_modules/.bin/spago, but with Spago 0.7.2 there is not.

I'm not sure exactly why this issue occurs, but I guess it is related to #121

@f-f
Copy link
Member

f-f commented Mar 24, 2019

Hi @Dretch, thanks for the report!

#121 is indeed the most recent change affecting this, and this week I noticed that Windows install sometimes doesn't work.
However, both on my macOS and my NixOS machines running npm install spago does indeed create a binary in node_modules/.bin/spago

Which distro are you on? And which version of npm?

@GoNZooo
Copy link

GoNZooo commented Mar 25, 2019

Doesn't work here either; Windows, yarn v1.12.3, so this doesn't seem like a Linux issue, exactly.

@f-f
Copy link
Member

f-f commented Mar 25, 2019

@GoNZooo I think the Windows issue is a different one, it looks like the release archive might be corrupted on some systems (I've seen both the cases happen). In fact, are you able to decompress the release archive for Windows by hand?

@GoNZooo
Copy link

GoNZooo commented Mar 25, 2019

In fact, are you able to decompress the release archive for Windows by hand?

Yes, decompressed without issue with 7zip and executed fine.

@Dretch
Copy link
Contributor Author

Dretch commented Mar 25, 2019

I have found my problem: it is a bug with Yarn: yarnpkg/yarn#3421

I think it worked with 0.6.4 because the file being symlinked already existed (as a stub) whereas with 0.7.0 the file gets created by the preinstall script (which Yarn runs after creating the bin symlinks).

Workarounds:

  • Run yarn --check-files
  • Use npm

@f-f
Copy link
Member

f-f commented Mar 25, 2019

@Dretch oh wow, great catch! 😮 👏

I think we could bring back the stub, since it looks like the linked bug is not likely to get fixed.

@GoNZooo does it work for you if you use npm?

@GoNZooo
Copy link

GoNZooo commented Mar 25, 2019

@GoNZooo does it work for you if you use npm?

No, it fails with the following error, actually highlighting the issue, I guess. There's no error at all (just silent failure) with yarn.

npm ERR! path [...]\node_modules\spago\spago.exe
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '[...]\node_modules\spago\spago.exe'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

@f-f
Copy link
Member

f-f commented Mar 26, 2019

@GoNZooo great, this is also the failure I've seen happening on Windows.
In my case though we weren't able to extract the file. However, we didn't try 7z, which makes me think that the cause could be 7z's tar implementation (which we use to pack the archive here) being different from node-tar's implementation (which we use to unpack the archive here)

@f-f
Copy link
Member

f-f commented Mar 30, 2019

@Dretch, @GoNZooo: new release 0.7.5 with the fixes for both issues is now available on npm, could you try it out?

@Dretch
Copy link
Contributor Author

Dretch commented Mar 31, 2019

@f-f It works for me - thanks!

@GoNZooo
Copy link

GoNZooo commented Apr 1, 2019

@f-f With npm it works, yes. Unfortunately yarn still silently fails and there's no binary after installation.

@f-f
Copy link
Member

f-f commented Apr 1, 2019

@GoNZooo sounds like progress 🎉 Could you upgrade yarn to the latest (v1.15.2) and see if it still fails?

@GoNZooo
Copy link

GoNZooo commented Apr 1, 2019

This is strange. When installing with yarn, the binary is indeed created and everything, but the link just doesn't seem to actually work.

λ  ls .\node_modules\.bin\spago                                                                                                           
                                                                                                                                          
                                                                                                                                          
    Directory: [...]\node_modules\.bin                                                          
                                                                                                                                          
                                                                                                                                          
Mode                LastWriteTime         Length Name                                                                                     
----                -------------         ------ ----                                                                                     
-a----       2019-04-01     13:55            301 spago                                                                                    
                                                                                                                                                                                                                                  
λ  .\node_modules\.bin\spago --help                                                                                                       
/bin/bash: [...]\node_modules\.bin\..\spago\spago.exe: No such file or directory                
                                                                                           
λ  .\node_modules\.bin\..\spago\spago.exe --help                                                                                          
Spago - manage your PureScript projects                                                                                                   
                                                                                                                                          
Usage: spago.exe [-v|--verbose]                                                                                                           
                 (init | build | repl | test | run | bundle | make-module | docs                                                          
                 |                                                                                                                        
                 install | sources | list-packages | verify | verify-set | package-set-upgrade | freeze                                   
                 |                                                                                                                        
                 psc-package-local-setup | psc-package-insdhall | psc-package-clean                                                       
                 | version)                                                                                                               
                                                                                                                                          
Available options:                                                                                                                        
  -h,--help                Show this help text                                                                                            
  -v,--verbose             Enable additional debug logging, e.g. printing `purs`                                                          
                           commands                                                                                                       
                                                                                                                                          
Project commands:                                                                                                                         
  init                     Initialize a new sample project, or migrate a psc-package one                                                  
  build                    Install the dependencies and compile the current package                                                       
  repl                     Start a REPL                                                                                                   
  test                     Test the project with some module, default Test.Main                                                           
  run                      Runs the project with some module, default Main                                                                
  bundle                   Bundle the project, with optional main and target path arguments                                               
  make-module              Bundle a module into a CommonJS module                                                                         
  docs                     Generate docs for the project and its dependencies                                                             
                                                                                                                                          
Package set commands:                                                                                                                     
  install                  Install (download) all dependencies listed in spago.dhall                                                      
  sources                  List all the source paths (globs) for the dependencies of the project                                          
  list-packages            List packages available in your packages.dhall                                                                 
  verify                   Verify that a single package is consistent with the Package Set                                                
  verify-set               Verify that the whole Package Set builds correctly                                                             
  package-set-upgrade      Upgrade the upstream in packages.dhall to the latest package-sets release                                      
  freeze                   Recompute the hashes for the package-set                                                                       
                                                                                                                                          
Psc-Package compatibility commands:                                                                                                       
  psc-package-local-setup  Setup a local package set by creating a new packages.dhall                                                     
  psc-package-insdhall     Insdhall the local package set from packages.dhall                                                             
  psc-package-clean        Clean cached packages by deleting the .psc-package folder                                                      
                                                                                                                                          
Other commands:                                                                                                                           
  version                  Show spago version                                                                                                                                                                                        

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