linode-cli icon indicating copy to clipboard operation
linode-cli copied to clipboard

`make build` fails: cp: cannot stat 'data-2': No such file or directory

Open themightychris opened this issue 6 years ago • 5 comments

On the current master (b49c6302d836d8e64ba0605e8cd7c88cd8eb1969) I get this on make build:

rm -f linodecli/data-*                                                                                                                                       
rm -f linode-cli.sh                                                                                                                                          
rm -f dist/*                                                                                                                                                 
python -m linodecli bake https://developers.linode.com/api/v4/openapi.yaml --skip-config                                                                     
No spec baked.  Please bake by calling this script as follows:                                                                                               
  python3 gen_cli.py bake /path/to/spec                                                                                                                      
Baking...                                                                                                                                                    
Warning: Resolved empty node for {'type': 'object'} in [{'$ref': '#/components/schemas/IPAddress'}, {'type': 'object'}]                                      
Baking bash completions...                                                                                                                                   
Writing file...                                                                                                                                              
Done.                                                                                                                                                        
python3 -m linodecli bake https://developers.linode.com/api/v4/openapi.yaml --skip-config                                                                    
No spec baked.  Please bake by calling this script as follows:                                                                                               
  python3 gen_cli.py bake /path/to/spec                                                                                                                      
Baking...                                                                                                                                                    
Warning: Resolved empty node for {'type': 'object'} in [{'$ref': '#/components/schemas/IPAddress'}, {'type': 'object'}]                                      
Baking bash completions...                                                                                                                                   
Writing file...                                                                                                                                              
Done.                                                                                                                                                        
cp data-2 linodecli/                                                                                                                                         
cp: cannot stat 'data-2': No such file or directory                                                                                                          
make: *** [Makefile:23: build] Error 1    

asciicast

themightychris avatar Dec 06 '18 21:12 themightychris

The build process requires both python2 and python3, and expects python to be python2. I've seen this error before if python --version returns 3.x. Try modifying this line of the Makefile to say python2 instead of python - although I'm hesitant to commit this change because many systems don't have a python2 by default (ideally the Makefile will detect what pythons are available and give reasonable errors if it can't build).

Dorthu avatar Dec 07 '18 12:12 Dorthu

What if it sniffed the versions of python, python2, and python3 and then set $PYTHON2 and $PYTHON3 for use in the rest of the Makefile?

themightychris avatar Dec 07 '18 15:12 themightychris

yeah, I think that's what needs to happen. @asauber also encountered this when attempting to build with python pointed to python3 - I'm going to get on this shortly.

Dorthu avatar Dec 10 '18 14:12 Dorthu

FYI, I wrote a habitat plan to work me around this: https://bldr.habitat.sh/#/pkgs/jarvus/linode-cli/latest

So on any Linux box now you can run:

# install hab CLI
curl -s https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh | sudo bash

# install linode-cli and binlink it
hab pkg install -b jarvus/linode-cli

# profit!
linode-cli k8s-alpha create 

python, kubectl, and terraform binaries all get pulled and put into env by habitat

themightychris avatar Dec 11 '18 00:12 themightychris

I had a copy of the Makefile that removed all ambiguity, but it got lost in my stash. I'll add a to-do item for myself to put up a PR.

asauber avatar Mar 13 '19 19:03 asauber

Closing this issue as Python 2 support has been dropped in v5.25.0.

lgarber-akamai avatar Nov 08 '22 17:11 lgarber-akamai