Does snapcraft Remote-build blocks outside request?

I have scripts that do staff from the internet for example wget to download files into my project.

Using snapcraft locally is working and the links to download the files are ok.

But when I use snapcraft Remote-build I am getting

Could not resolve URL “https://TheUrlThatIUsed…”

Does snapcraft Remote-build blocks outside request?.

Actual examples of the errors:
This is one:

It looks like pub.dartlang.org is having some trouble.
Pub will wait for a while before trying to connect again.
Could not resolve URL “https://pub.dartlang.org”.

This is other one:
Command: wget https://storage.googleapis.com/dart-archive/channels/stable/release/2.9.2/sdk/dartsdk-linux-arm-release.zip

Resolving storage.googleapis.com (storage.googleapis.com)… failed: Name or service not known.
wget: unable to resolve host address ‘storage.googleapis.com

I have found this post about “launchpad builds are limited to 120 minutes of network connectivity”, could it be the same cause?, and if that so, is there a fix for that?.

Moving the steps requiring network access to the start of the build should work.

It is currently like this:

parts:
  smart-home:
    plugin: dump
    source: .
    override-build: |

      sudo scripts/bashScripts/nativeExecutableMaker.sh  # Downloading dart-sdk for the correct architecture.

      cd scripts/bashScripts/
      ./compileAllCFiles.sh # Have to be executed when working directory is this file location
      cd ../..

      git clone https://github.com/guyluz11/WiringNP.git
      cd WiringNP/
      chmod 755 build
      ./build
      cd ..

      rm -r SmartDeviceDart

      snapcraftctl build

As you can see it is the first line in override-build part (./..../nativeExecutableMaker.sh) and before the snapcraftctl build line.
If this is the “start of the build” than it does not work, if it is not where should I put it?.

The actual problem is that you run the script over sudo, which doesn’t preserve the proxy-related environment variables to allow network access.

As the build is already run as root dropping the sudo call should work.

Refer: Launchpad build fails with "Could not resolve 'dl.bintray.com'"

3 Likes