[OE-core] [PATCH] cmake: Export SSH_AUTH_SOCK for cmake at configure

Christopher Larson kergoth at gmail.com
Fri May 25 15:34:16 UTC 2018


We should probably investigate if it's possible to shift those into
do_fetch eventually. Contacting upstream during do_configure is not kosher.

On Fri, May 25, 2018 at 5:52 AM Niko Mauno <niko.mauno at vaisala.com> wrote:

> Update cmake_do_configure() to export a set SSH_AUTH_SOCK variable
> before calling cmake.
>
> Otherwise, if cmake call during cmake_do_configure() resorts to
> ExternalProject directive containing a GIT_REPOSITORY entry, and git
> authentication scheme is based on SSH agent forwarding, it fails
> followingly
>
>   | Cloning into 'foo'...
>   | Permission denied (publickey).
>   | fatal: Could not read from remote repository.
>   |
>   | Please make sure you have the correct access rights
>   | and the repository exists.
>   |
>   | ...
>   |
>   | CMake Error at .../tmp/foo-gitclone.cmake:66 (message):
>   |   Failed to clone repository: 'ssh://...
>
> Signed-off-by: Niko Mauno <niko.mauno at vaisala.com>
> ---
>  meta/classes/cmake.bbclass | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index fcfd5dda4f..82d36be8ff 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -137,6 +137,11 @@ cmake_do_configure() {
>                 oecmake_sitefile=
>         fi
>
> +       # Allow cmake to perform eg. git clone in context where
> authentication relies on SSH agent forwarding
> +       if [ "${SSH_AUTH_SOCK}" ] ; then
> +               export SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
> +       fi
> +
>         cmake \
>           ${OECMAKE_GENERATOR_ARGS} \
>           $oecmake_sitefile \
> --
> 2.11.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180525/85f4d281/attachment-0002.html>


More information about the Openembedded-core mailing list