public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] strange ebuild problem
@ 2020-11-20 15:44 Helmut Jarausch
  2020-11-20 16:50 ` Mickaël Bucas
  0 siblings, 1 reply; 3+ messages in thread
From: Helmut Jarausch @ 2020-11-20 15:44 UTC (permalink / raw
  To: gentoo-user

Hi,
I have an ebuild containing

inherit git-r3

and

src_compile() {

	./build_all.sh
}

The script build_all.sh contains

[ -d csources ] || git clone --depth 1  
https://github.com/nim-lang/csources.git


When I try to build I get the strange error
fatal: unable to access 'https://github.com/nim-lang/csources.git/':  
Could not resolve host: github.com

But when I exec
git clone --depth 1 https://github.com/nim-lang/csources.git
in an xterm (i.e. without using 'ebuild') it succeeds.

What's going on here?

Many thanks for a hint,
Helmut


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] strange ebuild problem
  2020-11-20 15:44 [gentoo-user] strange ebuild problem Helmut Jarausch
@ 2020-11-20 16:50 ` Mickaël Bucas
  2020-11-20 19:47   ` Helmut Jarausch
  0 siblings, 1 reply; 3+ messages in thread
From: Mickaël Bucas @ 2020-11-20 16:50 UTC (permalink / raw
  To: Gentoo

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]

Le ven. 20 nov. 2020 à 16:44, Helmut Jarausch <jarausch@skynet.be> a écrit :

> Hi,
> I have an ebuild containing
>
> inherit git-r3
>
> and
>
> src_compile() {
>
>         ./build_all.sh
> }
>
> The script build_all.sh contains
>
> [ -d csources ] || git clone --depth 1
> https://github.com/nim-lang/csources.git
>
>
> When I try to build I get the strange error
> fatal: unable to access 'https://github.com/nim-lang/csources.git/':
> Could not resolve host: github.com
>
> But when I exec
> git clone --depth 1 https://github.com/nim-lang/csources.git
> in an xterm (i.e. without using 'ebuild') it succeeds.
>
> What's going on here?
>
> Many thanks for a hint,
> Helmut
>

Hi Helmut

I believe this is a consequence of the sandboxing of ebuilds.

When I had the same problem with an ebuild trying to download many things
from the Maven repository, I added the following lines inside the ebuild:
# To enable Maven access to https://repo.maven.apache.org/maven2
RESTRICT="network-sandbox"

It is described (shortly) in "man 5 ebuild"
This is forbidden in the Portage tree, but is allowed in your own overlay.

Best regards
Mickaël Bucas

[-- Attachment #2: Type: text/html, Size: 2235 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] strange ebuild problem
  2020-11-20 16:50 ` Mickaël Bucas
@ 2020-11-20 19:47   ` Helmut Jarausch
  0 siblings, 0 replies; 3+ messages in thread
From: Helmut Jarausch @ 2020-11-20 19:47 UTC (permalink / raw
  To: gentoo-user

On 11/20/2020 05:50:11 PM, Mickaël Bucas wrote:
> Le  ven. 20 nov. 2020    16:44, Helmut Jarausch  
> <_\bj_\ba_\br_\ba_\bu_\bs_\bc_\bh_\b@_\bs_\bk_\by_\bn_\be_\bt_\b._\bb_\be> a ©crit  :
>      Hi,
>      I have an ebuild containing
> 
>      inherit git-r3
> 
>      and
> 
>      src_compile() {
> 
>              ./build_all.sh
>      }
> 
>      The script build_all.sh contains
> 
>      [ -d csources ] || git clone --depth 1  
>       
> _\bh_\bt_\bt_\bp_\bs_\b:_\b/_\b/_\bg_\bi_\bt_\bh_\bu_\bb_\b._\bc_\bo_\bm_\b/_\bn_\bi_\bm_\b-_\bl_\ba_\bn_\bg_\b/_\bc_\bs_\bo_\bu_\br_\bc_\be_\bs_\b._\bg_\bi_\bt
> 
> 
>      When I try to build I get the strange error
>      fatal: unable to access  
> '_\bh_\bt_\bt_\bp_\bs_\b:_\b/_\b/_\bg_\bi_\bt_\bh_\bu_\bb_\b._\bc_\bo_\bm_\b/_\bn_\bi_\bm_\b-_\bl_\ba_\bn_\bg_\b/_\bc_\bs_\bo_\bu_\br_\bc_\be_\bs_\b._\bg_\bi_\bt_\b/':
>       
>      Could not resolve host: _\bg_\bi_\bt_\bh_\bu_\bb_\b._\bc_\bo_\bm
> 
>      But when I exec
>      git clone --depth 1  
> _\bh_\bt_\bt_\bp_\bs_\b:_\b/_\b/_\bg_\bi_\bt_\bh_\bu_\bb_\b._\bc_\bo_\bm_\b/_\bn_\bi_\bm_\b-_\bl_\ba_\bn_\bg_\b/_\bc_\bs_\bo_\bu_\br_\bc_\be_\bs_\b._\bg_\bi_\bt
>      in an xterm (i.e. without using 'ebuild') it succeeds.
> 
>      What's going on here?
> 
>      Many thanks for a hint,
>      Helmut
> 
> Hi Helmut
> 
> I believe this is a consequence of the sandboxing of ebuilds.
> 
> When I had the same problem with an ebuild trying to download many  
> things from
> the Maven repository, I added the following lines inside the ebuild:
> # To enable Maven access to  
> _\bh_\bt_\bt_\bp_\bs_\b:_\b/_\b/_\br_\be_\bp_\bo_\b._\bm_\ba_\bv_\be_\bn_\b._\ba_\bp_\ba_\bc_\bh_\be_\b._\bo_\br_\bg_\b/_\bm_\ba_\bv_\be_\bn_\b2
> RESTRICT="network-sandbox"
> 
> It is described (shortly) in "man 5 ebuild"
> This is forbidden in the Portage tree, but is allowed in your own  
> overlay.
> 
> Best regards
> Micka l Bucas


Many, many thanks Micka. I'd never thought of that.

Stay healthy,
Helmut



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-20 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-20 15:44 [gentoo-user] strange ebuild problem Helmut Jarausch
2020-11-20 16:50 ` Mickaël Bucas
2020-11-20 19:47   ` Helmut Jarausch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox