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

dcli compile fails with pubGetException. the path assumed for pub and dart2native is different from actual #121

Closed
lohanidamodar opened this issue Dec 21, 2020 · 9 comments

Comments

@lohanidamodar
Copy link
Contributor

@bsutton For me as i described and you can see in the output of dcli doctor the path for pub and dart2native are not in the path assumed by the dcli. And for me the problem is not during the dcli install its with dcli compile where it's unable to find the pub and pubGetException is raised as below

Setting flag: verbose
DCli Version: 0.34.6
Found command Instance of 'CompileCommand'
Setting flag: install

Compiling ./pcreate.dart...

exists: ./pcreate.dart followLinks: true
env:  SHELL:/usr/bin/zsh
env:  SHELL:/usr/bin/zsh
env:  SUDO_USER:null
path: /<path>/dart/scripts/pcreate.dart
exists: /<path>/dart/scripts/pubspec.yaml followLinks: true
lockcount = 0
Hardlock taken
exists: /<path>/dart/scripts followLinks: true
find: pwd: /home/dlohani/Documents/dart/scripts root: /<path>/dart/scripts pattern: *.script.lock caseSensitive: false recursive: false types: [file] 
found [] lock files
Taking lock .486796.2833298015332279.script.lock for isolates/2833298015332279
Lock Source: named_lock.dart : NamedLock.withLock : 104
touch: /<path>/dart/scripts/.486796.2833298015332279.script.lock create: true
exists: /<path>/dart/scripts followLinks: true
Hardlock released
Waiting for warmup to complete...
Incremented lock: 1
lockcount = 1
Incremented lock: 2
env:  SUDO_USER:null
env:  PATH:/usr/local/go/bin:/opt/flutter/bin:/opt/flutter/.pub-cache/bin:/opt/flutter/bin/cache/dart-sdk/bin:/home/dlohani/.pub-cache/bin:/home/dlohani/.dcli/bin
exists: /usr/local/go/bin/dart followLinks: true
exists: /opt/flutter/bin/dart followLinks: true
Process.start: cmdLine /opt/flutter/bin/pub get --no-precompile
Process.start: runInShell: false workingDir: /<path>/dart/scripts mode: normal cmd: /opt/flutter/bin/pub args: get, --no-precompile
exists: /home/dlohani/Documents/dart/scripts followLinks: true
pub get exeception: /opt/flutter/bin/pub get --no-precompile 
exit: 2
reason: Could not find /opt/flutter/bin/pub on the path.
Decremented lock: 1
Decremented lock: 0
Releasing lock: /<path>/dart/scripts/.486796.2833298015332279.script.lock
Hardlock taken
delete:  /<path>/dart/scripts/.486796.2833298015332279.script.lock ask: false
exists: /<path>/dart/scripts/.486796.2833298015332279.script.lock followLinks: true
Hardlock released
DCliException: Instance of 'PubGetException' 
Stacktrace: named_lock.dart : NamedLock.withLock.<anonymous closure> : 127
zone.dart : runZonedGuarded : 1620
zone.dart : runZoned : 1547
named_lock.dart : NamedLock.withLock : 104
dart_project.dart : DartProject.warmup : 126
compile.dart : CompileCommand.compileScript : 108
compile.dart : CompileCommand.run : 65
command_line_runner.dart : CommandLineRunner.process : 86
entry_point.dart : EntryPoint._parseCmdLine : 40
entry_point.dart : EntryPoint.process : 34

Originally posted by @lohanidamodar in #120 (comment)

@lohanidamodar
Copy link
Contributor Author

@bsutton and thank you for willing to fix so soon, as I am making dart automation tutorials on My youtube channel, where I already have first episode. I was inspired to make those because I love dcli. So in the next episode I want to demonstrate compile and install. If it's fixed early as possible that would be awesome 💯

@bsutton
Copy link
Collaborator

bsutton commented Dec 21, 2020 via email

@bsutton
Copy link
Collaborator

bsutton commented Dec 21, 2020 via email

@bsutton
Copy link
Collaborator

bsutton commented Dec 21, 2020 via email

@bsutton
Copy link
Collaborator

bsutton commented Dec 21, 2020

I've just released dcli 0.35 which will use dart compile for version of dart 2.10 and greater.

Can you give it a try and let me know how it goes.

@lohanidamodar
Copy link
Contributor Author

@bsutton only that will not resolve my issue as it also assumes pub path which is different returned by which.

Setting flag: verbose
DCli Version: 0.35.0
Found command Instance of 'CompileCommand'
Setting flag: install

Compiling ./pcreate.dart...

exists: ./pcreate.dart followLinks: true
env:  SHELL:/usr/bin/zsh
env:  SHELL:/usr/bin/zsh
env:  SUDO_USER:null
path: <path>/scripts/pcreate.dart
exists: <path>/scripts/pubspec.yaml followLinks: true
lockcount = 0
Hardlock taken
exists: <path>/scripts followLinks: true
find: pwd: <path>/scripts root: <path>/scripts pattern: *.script.lock caseSensitive: false recursive: false types: [file] 
found [] lock files
Taking lock .567683.2125011233325951.script.lock for isolates/2125011233325951
Lock Source: named_lock.dart : NamedLock.withLock : 104
touch: <path>/scripts/.567683.2125011233325951.script.lock create: true
exists: <path>/scripts followLinks: true
Hardlock released
Waiting for warmup to complete...
Incremented lock: 1
lockcount = 1
Incremented lock: 2
env:  SUDO_USER:null
env:  PATH:/usr/local/go/bin/opt/flutter/.pub-cache/bin:/opt/flutter/bin/cache/dart-sdk/bin:/home/dlohani/.pub-cache/bin:/home/dlohani/.dcli/bin
exists: /usr/local/go/bin/dart followLinks: true
exists: /home/dlohani/.npm/bin/dart followLinks: true
exists: /home/dlohani/Documents/projects/flutter/bin/dart followLinks: true
exists: /usr/local/go/bin/dart followLinks: true
exists: /home/dlohani/.npm/bin/dart followLinks: true
exists: /home/dlohani/Documents/projects/flutter/bin/dart followLinks: true
exists: /home/dlohani/.local/bin/dart followLinks: true
exists: /usr/local/sbin/dart followLinks: true
exists: /usr/local/bin/dart followLinks: true
exists: /usr/sbin/dart followLinks: true
exists: /usr/bin/dart followLinks: true
exists: /sbin/dart followLinks: true
exists: /bin/dart followLinks: true
exists: /usr/games/dart followLinks: true
exists: /usr/local/games/dart followLinks: true
exists: /snap/bin/dart followLinks: true
exists: /home/dlohani/Android/Sdk/tools/dart followLinks: true
exists: /home/dlohani/Android/Sdk/platform-tools/dart followLinks: true
exists: /opt/flutter/bin/dart followLinks: true
exists: <path>/scripts followLinks: true
Process.start: cmdLine /opt/flutter/bin/pub get --no-precompile
Process.start: runInShell: false workingDir: <path>/scripts mode: normal cmd: /opt/flutter/bin/pub args: get, --no-precompile
exists: <path>/scripts followLinks: true
pub get exeception: /opt/flutter/bin/pub get --no-precompile 
exit: 2
reason: Could not find /opt/flutter/bin/pub on the path.
Decremented lock: 1
Decremented lock: 0
Releasing lock: <path>/scripts/.567683.2125011233325951.script.lock
Hardlock taken
delete:  <path>/scripts/.567683.2125011233325951.script.lock ask: false
exists: <path>/scripts/.567683.2125011233325951.script.lock followLinks: true
Hardlock released
DCliException: Instance of 'PubGetException' 
Stacktrace: named_lock.dart : NamedLock.withLock.<anonymous closure> : 127
zone.dart : runZonedGuarded : 1620
zone.dart : runZoned : 1547
named_lock.dart : NamedLock.withLock : 104
dart_project.dart : DartProject.warmup : 126
compile.dart : CompileCommand.compileScript : 108
compile.dart : CompileCommand.run : 65
command_line_runner.dart : CommandLineRunner.process : 86
entry_point.dart : EntryPoint._parseCmdLine : 40
entry_point.dart : EntryPoint.process : 34

Output of dcli doctor

DCli version      0.35.0                                                 

OS                linux                                                  
OS Version        Linux 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020
Path separator    /                                                      

dart version      2.10.4                                                 

dcli path         /opt/flutter/bin/dcli                                  
dart exe path     /opt/flutter/bin/dart                                  
dart path         /opt/flutter/bin/dart                                   which: /opt/flutter/bin/dart                           
Using 'dart compi

pub path          /opt/flutter/bin/pub                                    which: /opt/flutter/bin/cache/dart-sdk/bin/pub         
Pub cache         /<HOME>/.pub-cache                                     

Package Config    Not Passed                                             

PATH
                  /usr/local/go/bin                                      
                  /<HOME>/.npm/bin                                       
                  /<HOME>/Documents/projects/flutter/bin                 
                  /usr/local/go/bin                                      
                  /<HOME>/.npm/bin                                       
                  /<HOME>/Documents/projects/flutter/bin                 
                  /<HOME>/.local/bin                                     
                  /usr/local/sbin                                        
                  /usr/local/bin                                         
                  /usr/sbin                                              
                  /usr/bin                                               
                  /sbin                                                  
                  /bin                                                   
                  /usr/games                                             
                  /usr/local/games                                       
                  /snap/bin                                              
                  /<HOME>/Android/Sdk/tools                              
                  /<HOME>/Android/Sdk/platform-tools                     
                  /opt/flutter/bin                                       
                  /opt/flutter/.pub-cache/bin                            
                  /opt/flutter/bin/cache/dart-sdk/bin                    
                  /<HOME>/.pub-cache/bin                                 
                  /<HOME>/.dcli/bin                                      
                  /<HOME>/Android/Sdk/tools                              
                  /<HOME>/Android/Sdk/platform-tools                     
                  /opt/flutter/bin                                       
                  /opt/flutter/.pub-cache/bin                            
                  /opt/flutter/bin/cache/dart-sdk/bin                    
                  /<HOME>/.pub-cache/bin                                 
                  /<HOME>/.dcli/bin                                      

$SHELL            /usr/bin/zsh                                           
Detected SHELL    zsh                                                    
Shell Start Scrip Not Found                                              

Dart location(s)
                  /opt/flutter/bin/dart                                  

Permissions
HOME              rwxr-xr-x <user>:<user> /<HOME> 
.dcli             rwxrwxr-x <user>:<user> /<HOME>/.dcli 
cache             rwxrwxr-x <user>:<user> /<HOME>/.dcli/cache 
templates         rwxrwxr-x <user>:<user> /<HOME>/.dcli/templates 

@bsutton
Copy link
Collaborator

bsutton commented Dec 21, 2020

I've just published 0.37 which I now believe fixes the pub path issue.

I'm now using the path returned by which rather than assuming that pub is in the sdk directory.

@lohanidamodar
Copy link
Contributor Author

@bsutton awesome, 0.37 solves this issue for me. Great help. Thanks!

@lohanidamodar
Copy link
Contributor Author

If you are happy I will put up a link to your channel on the dcli documentation at https://bsutton.gitbook.io/dcli/

On Mon, 21 Dec 2020 at 11:15, Damodar Lohani @.***> wrote: @bsutton https://github.com/bsutton and thank you for willing to fix so soon, as I am making dart automation tutorials on My youtube channel https://youtube.com/reactbits, where I already have first episode https://www.youtube.com/watch?v=EgBJm3TgUao. I was inspired to make those because I love dcli. So in the next episode I want to demonstrate compile and install. If it's fixed early as possible that would be awesome — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#121 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OFTI6TBZRMPQLTMDVLSV2HTXANCNFSM4VDP2NXA .

Hi, sure I would love to have the link posted there.

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

2 participants