Skip to content

mbed-cli defaults to hg for github URLs when they do not end with .git #785

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
bremoran opened this issue Nov 9, 2018 · 9 comments
Open

Comments

@bremoran
Copy link
Contributor

bremoran commented Nov 9, 2018

mbed-cli appears so process .lib files in such a way that are assumed to be hg URLs unless there is a .git extension. For github URLs, this is unnecessary.

@theotherjimmy
Copy link
Contributor

I take it this is trivial to reproduce: just remove a .git and watch mbed-cli run hg?

@bremoran
Copy link
Contributor Author

bremoran commented Nov 9, 2018

It appears to be, but I only noticed because I didn't have hg installed.

@ciarmcom
Copy link
Member

ciarmcom commented Nov 9, 2018

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-151

@Josaphat
Copy link

I've run into an issue that appears to be related.

When trying to follow the quick start guide, all of the following commands:

$ mbed import https://github.com/ARMmbed/mbed-os-example-blinky
$ mbed import git@github.com/ARMmbed/mbed-os-example-blinky
$ mbed import --protocol git git@github.com/ARMmbed/mbed-os-example-blinky
$ mbed import --protocol git git@github.com/ARMmbed/mbed-os-example-blinky.git

resulted in basically the same error:

[mbed] ERROR: Could not execute "hg clone --config progress.assume-tty=true https://github.com/ARMmbed/mbed-os-example-blinky /home/jos/Documents/mbed-experiment/mbed-os-example-blinky" in "/home/jos/Documents/mbed-experiment".
       You can verify that it's installed and accessible from your current path by executing "hg".

The problem disappeared when I installed mercurial. I'm on Arch Linux and installed mbed-cli using pip3.

The full output of one of the commands is here (all were essentially the same):

jos@ares ~/Documents/mbed-experiment % mbed import git@github.com/ARMmbed/mbed-os-example-blinky                                                                                                                                          :(
[mbed] WARNING: If you're using Python 3 with Mbed OS 5.8 and earlier versions, Python errors will occur when compiling, testing and exporting                                                                                                
---                                                                   
[mbed] Working path "/home/jos/Documents/mbed-experiment" (directory)                                                                                
[mbed] Program path "/home/jos/Documents/mbed-experiment"                                                                                                                                                                            
[mbed] Importing program "mbed-os-example-blinky" from "ssh://git@github.com/ARMmbed/mbed-os-example-blinky" at latest revision in the current branch                                                                                         
[mbed] ERROR: Could not execute "hg clone --config progress.assume-tty=true ssh://git@github.com/ARMmbed/mbed-os-example-blinky /home/jos/Documents/mbed-experiment/mbed-os-example-blinky" in "/home/jos/Documents/mbed-experiment".
       You can verify that it's installed and accessible from your current path by executing "hg".                                                                                                                                            
---                                                                                                                                                                                                                                           
[mbed] WARNING: Using Python 3 with Mbed OS 5.8 and earlier can cause errors with compiling, testing and exporting                                                                                                                            
---

@screamerbg screamerbg self-assigned this Nov 14, 2018
@kevinong0108
Copy link

#810
This patch can resolve this issue (maybe python 3.x only), but I have no time to fix push request check fail...

@adbridge
Copy link
Contributor

adbridge commented Nov 1, 2019

Apologies, this was closed in error by the automated bot - re-opening.

@ciarmcom
Copy link
Member

Internal Jira reference: https://jira.arm.com/browse/IOTBTOOL-470

@remcycles
Copy link

I also got the [mbed] ERROR: Could not execute "hg clone --config... error when running mbed new program in a Python3 virtualenv, but not in a Python2 virtualenv. I guess the warning should be heeded.

[mbed] WARNING: If you're using Python 3 with Mbed OS 5.8 and earlier versions, Python errors will occur when compiling, testing and exporting                                                                                                

@amq
Copy link

amq commented Mar 18, 2020

Would be great if mbed detected github.com and defaulted to git in such case.

Upd: actually, looks like it defaults to hg even if the url ends with .git, also even if cache is used where the tool could clearly see that it's a git repo.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

9 participants