Conan: Question: What is the best way to get git hash used to created a package ?

Created on 13 Aug 2019  路  4Comments  路  Source: conan-io/conan

Hello,

What is the best approach to get git hash from a conan package ?
My current approach is to generate the hash myself in a file and export it with the recipe.

Is there a way maybe to extend conaninfo.txt ? (this is useful to check the git hash in artifactory)

Thanks,
Walid

question

Most helpful comment

Have you used the scm feature? With auto revision it hardcodes the git hash into the recipe on export. So you can, for example, use conan get to get it I guess.

All 4 comments

Have you used the scm feature? With auto revision it hardcodes the git hash into the recipe on export. So you can, for example, use conan get to get it I guess.

@Minimonium yes I did, but no luck, here is what my recipe looks like

class MyPackageConan():
    scm = {
        'type': 'git',
        'url': 'https://bitbucket.org/xxx/yyy.git',
        'revision': 'auto'
    }
    ....

ohh wait! that actually work, and it edit my conanfile.py!
Thanks

@boussaffawalid gald you found the solution and thanks @Minimonium for the support! I am closing the issue as resolved. Please feel free to open other issues for more questions or feedback 馃槃

Was this page helpful?
0 / 5 - 0 ratings