Open bainadeashish opened 3 years ago
@bainadeashish What is the value of of GIT_URL
? I suspect the issue is that the URL is incorrect.
# setup
docker run -it --rm condaforge/mambaforge bash
mamba create -n issue-23 r-base=4.0.2 r-devtools
conda activate issue-23
# This works fine
Rscript -e 'devtools::install_git("https://github.com/Rdatatable/data.table.git")'
# An incorrect URL leads to an error
Rscript -e 'devtools::install_git("https//github.com/")'
## Error: Failed to install 'unknown package' from Git:
## Error in 'git2r_remote_ls': unsupported URL protocol
## Execution halted
Environment (conda list
):
Details about conda
and system ( conda info
):
no value of GIT_URL is correct, same is working fine with cran devtools but fails in r-devtools conda. @jdblischak
no value of GIT_URL is correct, same is working fine with cran devtools but fails in r-devtools conda.
We need a minimal reproducible example to be able to troubleshoot the issue you are having. Could you please run the code below and report back whether or not it successfully runs for you?
conda create --yes -n test-install-git --override-channels -c conda-forge r-base=4.0.2 r-devtools
conda activate test-install-git
Rscript -e 'devtools::install_git("https://github.com/HenrikBengtsson/R.utils")'
conda deactivate
@jdblischak let me try & will update accordingly. Thanks alot
Its working fine for URL you mentioned but somehow its failing for below URL Step 24/40 : RUN Rscript -e 'devtools::install_git("https://gitlab+deploy-token-49:MVJMoJQbGThZbdzEb@GIT_REPO.git")' ---> Running in 8b5f6302861e WARNING: ignoring environment value of R_HOME Error: Failed to install 'unknown package' from Git: Error in 'git2r_remote_ls': malformed URL 'https://gitlab+deploy-token-49:MVJMoJQbGThZbdzEb'
Replaced actual repo name with GIT_REPO due to security issues.
Its working fine for URL you mentioned but somehow its failing for below URL
OK, great. Thanks for confirming. This is a good sign. It will work for the most standard use case of installing from a public repo.
Error in 'git2r_remote_ls': malformed URL 'https://gitlab+deploy-token-49:MVJMoJQbGThZbdzEb'
I don't have any experience with authenticating with a GitLab deploy token. This URL works with devtools installed from CRAN? If yes, my only guess is that there is some difference in the authentication features when installing libgit2. Can you try running git2r::libgit2_features()
with both your CRAN setup and in your conda environment? Are there are any differences in the enabled features?
Some other ideas to consider:
What happens if you try setting git = "external"
? This should use your system Git instead of git2r (which is where the error is coming from). If you don't have Git installed, you can run conda install git
.
If you need to use private repos on GitLab, I'd recommend generating a GitLab PAT, saving it in the environment variable GITHUB_PAT
, and then installing with install_gitlab()
There's nothing particularly special about install_git()
. If you're having trouble getting it to authenticate with your URL, you can clone it and then install it
git clone https://gitlab+deploy-token-49:MVJMoJQbGThZbdzEb@GIT_REPO.git
Rscript -e 'devtools::install("GIT_REPO")'
Issue: devtools::install_git fails for below cmd
Environment (
conda list
):Details about
conda
and system (conda info
):