Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitelist PPA for faster builds #34

Open
talex5 opened this issue Apr 7, 2015 · 7 comments
Open

Whitelist PPA for faster builds #34

talex5 opened this issue Apr 7, 2015 · 7 comments

Comments

@talex5
Copy link
Contributor

talex5 commented Apr 7, 2015

According to http://docs.travis-ci.com/user/apt/ we can ask for the opam PPA and packages to be whitelisted, which would allow building with sudo: false, which is apparently much faster.

@samoht
Copy link
Member

samoht commented Apr 14, 2015

This is related to #32. To be honest I have not yet encountered both issues, so I'm not sure what to do.

@talex5
Copy link
Contributor Author

talex5 commented Apr 15, 2015

Any new repositories created today require a sudo: required line. Existing repositories are slowing being included in this scheme, starting from the most recently created and working backwards. Eventually, everything will need to be updated.

@samoht
Copy link
Member

samoht commented Apr 15, 2015

ha ok, thanks for the explanation. We still need sudo to install the depexts though, so I'll merge #32 first.

@bluddy
Copy link

bluddy commented Apr 20, 2015

I've asked to have both avsm/ppa and opam added to the whitelist, so both are now available and we can now run travis without sudo.

@samoht
Copy link
Member

samoht commented Apr 24, 2015

@bluddy thanks! unfortunately by default we don't know which packages to whitelist in the .travis.yml file, as this is detected at runtime using opam depext. Not sure if we can solve this properly.

@bluddy
Copy link

bluddy commented Apr 24, 2015

Ah ok. I hadn't bothered to look up opam depext before. You also can't install anything with apt - everything has to be done through travis' new API in the yaml file - so there's no way it'll work unless travis comes up with a more dynamic API.

@stephengroat
Copy link

stephengroat commented Mar 7, 2017

would something like this work? I haven't worked out the bash 100% (variable scoping), but it allows dpkg to test if a package is installed. if not, then it tries to run the sudo apt commands needed. still need to figure out how to get multiple, potentially conflicting, packages installed

this way, you could use the sudo: false infra if you take the time to list the packages in travis

pkgs=
for pkg in ocaml ocaml-base ocaml-native-compilers ocaml-compiler-libs\
ocaml-interp ocaml-base-nox ocaml-nox camlp4 camlp4-extra
do
  if ! dpkg -l $pkg | grep -Eq 'ii *'$pkg' *'$(full_version $pkg $OCAML_VERSION)
  then
    pkgs="$(full_apt_version $pkg $OCAML_VERSION) $pkgs"
  fi
done
for pkg in jq opam
do
  if ! dpkg -l $pkg; then
    pkgs="$pkg $pkgs"
  fi
done
if [ ! -z $pkgs ]; then
  sudo add-apt-repository --yes ppa:${ppa}
  sudo apt-get update -qq
  sudo apt-get install -y $pkgs
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants