Unable to download content during build

146 views
Skip to first unread message

Michael Goffioul

unread,
Oct 16, 2019, 2:22:46 AM10/16/19
to Android Building
I have several custom modules that download content (if not already present) during build, with wget. This uses additional rules in the corresponding Android.mk files. These used to work in Pie, but in Q the rule fail with "Name or service not found". Running the exact same command outside the build system runs fine. Can somebody describe the mechanism at play here, and maybe points to source files where the restriction is implemented?

Thanks,
Michael.

Wesolowski, Krzysztof

unread,
Oct 16, 2019, 12:58:24 PM10/16/19
to android-...@googlegroups.com
It's blocked by sandboxing of build system, isolating that only repo content is used. Probably wget or external connections are blocked.


From: android-...@googlegroups.com <android-...@googlegroups.com> on behalf of Michael Goffioul <michael....@gmail.com>
Sent: Tuesday, October 15, 2019 9:58:18 PM
To: Android Building <android-...@googlegroups.com>
Subject: [android-building] Unable to download content during build
 
I have several custom modules that download content (if not already present) during build, with wget. This uses additional rules in the corresponding Android.mk files. These used to work in Pie, but in Q the rule fail with "Name or service not found". Running the exact same command outside the build system runs fine. Can somebody describe the mechanism at play here, and maybe points to source files where the restriction is implemented?

Thanks,
Michael.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/403e25aa-3db5-499a-a7f7-e05814b66fa6%40googlegroups.com.

Michael Goffioul

unread,
Oct 16, 2019, 1:15:29 PM10/16/19
to android-...@googlegroups.com
Thanks, I figured it must be somehow block. What I would like to understand is _how_ this is achieved technically.


Colin Cross

unread,
Oct 16, 2019, 1:33:49 PM10/16/19
to android-...@googlegroups.com
Network connections are blocked using nsjail by default, as they break build hermeticity.  https://android.googlesource.com/platform/build/soong/+/master/ui/build/sandbox_linux.go#161 is where it is enforced, you can disable it by setting BUILD_BROKEN_USES_NETWORK := true in your BoardConfig.mk.

Reply all
Reply to author
Forward
0 new messages