question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] scm Attribute fails to clone commit

See original GitHub issue

I feel like this is very related to https://github.com/conan-io/conan/issues/5587 “scm Attribute fails to clone tag” but in our case we are using version 1.19.2. which according to the note in #5587 “Conan 1.18.1 has been released with the fix for this issue!” should contain the fix.

Our old conanfile that worked in v1.16.1 did:

    scm = {"type": "git",
           "url": url,  # location of source to build
           "revision": commitAtVersion}

But now after upgrading to v1.19.2 it failed to check out any sources on our build servers. But if we comment out the scm section and add:

    # Testing: don't use scm in case it's broken https://github.com/conan-io/conan/issues/5587
    def source(self):
        git = tools.Git()
        os.remove("debian/changelog")
        #git.clone(self.url, branch=self.commitAtVersion)
        git.clone(self.url, branch="master")
        git.checkout(self.commitAtVersion)

then it works also in v1.19.2

Our commitAtVersion was a git commit string of the form e.g. 8aa1740b

Environment Details (include every applicable attribute)

  • Operating System+version: Windows Server 2012 R2
  • Compiler+version: VS2015
  • Conan version: 1.19.2
  • Python version: N/A conan exe installer

Steps to reproduce (Include if Applicable)

Update code from 1.16 to 1.19 and rebuild an existing recipe that uses the scm plugin while requesting a specific git commit.

Logs (Executed commands with output) (Include/Attach if Applicable)

(Sadly) silent fail of the git clone to actually check out any files, build fails shortly afterwards as it can’t find required .sln file to build:

pal/1.41.0@PORT/stable: Configuring sources in E:\nX\nX_nightlybuild\workspace\Conan_pipeline\.co\14e36c\1
pal/1.41.0@PORT/stable: Getting sources from url: 'git@bbgithub.dev.bloomberg.com:nx/pal.git'
[...]
The following files were specified on the command line:
	vstudio/pal/pal.sln
These files could not be found and will not be loaded.Microsoft (R) Build Engine version 14.0.25420.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelmaguirecommented, Nov 28, 2019

With @lasote 's added verbose logging for the scm operation and his helpful analysis via email, we’ve established that the issue has to do with a wrapper script we had on our Jenkins server used to invoke git with the correct credentials, that unfortunately wasn’t properly returning the %error_level% returned from the git invocation.

I hope we didn’t waste too much of your time – I think the newly added optional verbose logging of the scm plugin operation will help everyone in the future.

0reactions
lasotecommented, Nov 20, 2019

Thanks! Looking forward to the results.

would it be possible to ask for a 1.20.5 that has default “Shallow”=False" restored?

We need to understand first the error. Then if we change the default we will need to discuss in which version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git-clone Documentation - Git
No checkout of HEAD is performed after the clone is complete. --[no-]reject-shallow. Fail if the source repository is a shallow repository. The clone....
Read more >
Attributes — conan 1.53.0 documentation
In case of git, by default conan will try to perform shallow clone of the repository, and will fallback to the full clone...
Read more >
Git PullRequest job failed. Couldn't find any revision to build ...
In SCM: 1) select Git 2) Name: origin 3) Refspec: +refs/pull/*:refs/remotes/origin/pr/* 4) Branches to build : leave blank. This solved the above error....
Read more >
Bitbucket Server is unable to create the merge diff for pull ...
To resolve this in a one off manner, manually delete these lock files from the file system of the server. The path in...
Read more >
Maven Release plugin – release:prepare - Apache Maven
User property is: scmReleaseCommitComment . <scmShallowClone>, boolean, -, When cloning a repository if it should be a shallow clone or a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found