Mailing List Archive

git command within an ebuild fails - why?
Hi,
I'd like to write an ebuild for installing nim-9999.
Within "src_compile"
a shell script is executed which tries to invoke

git clone -q --depth 1 -b master
https://github.com/nim-lang/csources_v1.git csources_v1

This fails with "Could not resolve host: github.com"

When I excute the git command above within the source directory it just
works.
So, what's different when executing it within the ebuild.
Does "inherit git-r3" redefine something.

Many thanks for hint,
Helmut
Re: git command within an ebuild fails - why? [ In reply to ]
On 2022-09-23 18:17+0200 Helmut Jarausch <jarausch@skynet.be> wrote:

> Hi,
> I'd like to write an ebuild for installing nim-9999.
> Within "src_compile"
> a shell script is executed which tries to invoke
>
> git clone -q --depth 1 -b master
> https://github.com/nim-lang/csources_v1.git csources_v1
>
> This fails with "Could not resolve host: github.com"
>
> When I excute the git command above within the source directory it
> just works.
> So, what's different when executing it within the ebuild.
> Does "inherit git-r3" redefine something.
>
> Many thanks for hint,
> Helmut
>

Network access is disabled in ebuild phase functions by
FEATURES="network-sandbox". You can disable that by adding
RESTRICT="network-sandbox"
to your ebuild, but it's better to fix the build script instead.

I see stefantalpalaru has a solution for this:
<https://github.com/stefantalpalaru/gentoo-overlay/blob/master/dev-lang/nim/nim-9999-r13.ebuild#L29>

Kind regards, tastytea
Re: git command within an ebuild fails - why? [ In reply to ]
Many thanks!!!
Helmut


On 09/23/2022 06:54:08 PM, tastytea wrote:
> On 2022-09-23 18:17+0200 Helmut Jarausch <jarausch@skynet.be> wrote:
>
> > Hi,
> > I'd like to write an ebuild for installing nim-9999.
> > Within "src_compile"
> > a shell script is executed which tries to invoke
> >
> > git clone -q --depth 1 -b master
> > https://github.com/nim-lang/csources_v1.git csources_v1
> >
> > This fails with "Could not resolve host: github.com"
> >
> > When I excute the git command above within the source directory it
> > just works.
> > So, what's different when executing it within the ebuild.
> > Does "inherit git-r3" redefine something.
> >
> > Many thanks for hint,
> > Helmut
> >
>
> Network access is disabled in ebuild phase functions by
> FEATURES="network-sandbox". You can disable that by adding
> RESTRICT="network-sandbox"
> to your ebuild, but it's better to fix the build script instead.
>
> I see stefantalpalaru has a solution for this:
> <https://github.com/stefantalpalaru/gentoo-overlay/blob/master/dev-lang/nim/nim-9999-r13.ebuild#L29>
>
> Kind regards, tastytea
>
>