Errors when using pack_install with cplint package

I tried to use the pack_install command to install the cplint package and got the errors below. How can I solve this?

1 ?- pack_install(cplint).
% Contacting server at http://www.swi-prolog.org/pack/query ... ok
Install cplint@4.5.0 from GIT at https://github.com/friguzzi/cplint.git Y/n? 
yERROR: fatal: unable to access 'https://github.com/friguzzi/cplint.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
% Cloning into 'c:/users/robert/appdata/roaming/swi-prolog/pack/cplint'...
ERROR: Process "process(path(git),[clone,https://github.com/friguzzi/cplint.git,c:/users/robert/appdata/roaming/swi-prolog/pack/cplint])": exit status: 128
ERROR: In:
ERROR:   [13] throw(error(process_error(...,...),_23122))
ERROR:   [11] prolog_pack:pack_install_from_url(https,'https://github.com/friguzzi/cplint.git','c:/users/robert/appdata/roaming/swi-prolog/pack',cplint,[git(true),...|...]) at c:/program files/swipl/library/prolog_pack.pl:908
ERROR:    [7] <user>
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

My guess is that your git version is too old and/or the TLS support it too old/not properly configured to access github. Try the command below and make sure you get this working using the git program found on %PATH%.

git clone  https://github.com/friguzzi/cplint.git
1 Like

That’s an odd thing. I do all my GitHub work from a Cygwin (Linux emulator for Windows) console window using the command line interface. I never use Git via Windows directly, so I’m not sure how SWI-Prolog is accessing Git from I’m guessing it is using a Shell command? To simplify things, what would I update (i.e. - download and install) to update the Git on Windows that is access via a shell comand? I’m looking for the product name so I know how to search for it.

I don’t know. It searches %%PATH%% for git.exe and uses process_create/3 to run git. You can also go the the pack directory and do the clone yourself. If nothing needs to be build you are done with simply cloning and restarting Prolog to make it find the new pack. If there are things to rebuild, restart Prolog and run

?- pack_rebuild(mypack).

To find the pack directory :slight_smile:

?- absolute_file_name(pack(.), Dir, [file_type(directory), access(write),solutions(all)]).
1 Like

Thanks. I’ll have a look now that I know what file to look for (git.exe). I’ll check the version.

102 ?- absolute_file_name(path(git), Git, [access(execute)]).
Git = '/bin/git'.

I think the version for Windows also considers the .exe extension.

I get this error when I run that command:

1 ?- absolute_file_name(path(git), Git, [access(execute)]).
Git = '/bin/git'ERROR: source_sink `path(git)' does not exist
ERROR: In:
ERROR:   [11] throw(error(existence_error(source_sink,...),_27108))
ERROR:    [7] <user>
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

It appears you do need the full name:

?- absolute_file_name(path(cmd), Cmd, [access(execute)]).
ERROR: source_sink `path(cmd)' does not exist
ERROR: In:
ERROR:   [11] throw(error(existence_error(source_sink,...),_5052))
ERROR:    [7] <user>
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

But …

?- absolute_file_name(path('cmd.exe'), Cmd, [access(execute)]).
Cmd = 'c:/windows/system32/cmd.exe'.