gentoo / dotnet

[MIRROR] Newer mono, .NET languages, and libraries
https://gitweb.gentoo.org/repo/proj/dotnet.git
78 stars 56 forks source link

Q: How to use travis-ci.com with gentoo? #95

Open ArsenShnurkov opened 9 years ago

ArsenShnurkov commented 9 years ago

For missing dependencies in clean environment?

I know, that it is used to run 'repoman -d', but what about individual packages?

cnd commented 9 years ago

to be honest didn't get question fully... travis just runs scripts as you run it in bash

ArsenShnurkov commented 9 years ago

Yes, you are right, here is the instructions for writing a build script for a single project: http://docs.travis-ci.com/user/customizing-the-build/

In addition to that, the build service have several features - like snapshots and content caching, which allows to implement incremental building of packages (i.e. one package at a time and without rebuilding all packages each run)

C# support for Travis-CI is community maintained. Open issues at https://github.com/travis-ci/travis-ci/issues/new and add the following line into the message:

cc @joshua-anderson @akoeplinger @nterry

it will draw their attention

Here is how to specify mono version: https://github.com/NLog/NLog/pull/968#issuecomment-148912561 (docs) https://github.com/NLog/NLog/pull/968#issuecomment-148913049 (facts)

ArsenShnurkov commented 8 years ago

https://www.linux.org.ru/forum/talks/12049841?cid=12050182

"Используется travis и есть autorepoman. Подробности лучше узнавать на #gentoo-qa, там много всего, с ходу и не расскажешь"

ArsenShnurkov commented 8 years ago

Add sudo: false to .travis.yml and you’re using docker - https://docs.travis-ci.com/user/migrating-from-legacy/ If you see "This job is running on container-based infrastructure" in your build log it means you are already running builds on our new container-based infrastructure.

some more links: https://github.com/mbonaci/mbo-storm/wiki/Integrate-Travis-CI-with-your-GitHub-repo "First go to https://travis-ci.org/ and sign in with your GitHub account."

https://docs.travis-ci.com/user/languages/csharp/ "Building a C# or F# Project"

https://docs.travis-ci.com/user/caching/ "Caching Dependencies and Directories" this is necessary for building packages with reusing other binary package from some repository

Travis CI fetches the cache for every build (fetch = copy from external storage to local build environment) Before the build, we check if a cached archive exists. If it does, we pull it down and unpack it to the specified locations.

You can cache arbitrary directories

cache:
  directories:
  - .autoconf
  - $HOME/.m2

Only modifications made to the cached directories from normal pushes are stored.

before_cache:

  - rm -f $HOME/.cache/pip/log/debug.log

this is called before uploading cache

web interface for clearing caches - https://travis-ci.org/OWNER/REPOSITORY/caches there is also a command-line tool which can be used from build scripts

Travis CI attempts to upload cache after the script, but before either after_success or after_failure is run. Note that the failure to upload the cache does not mark the job a failure. The caching tars up all the directories listed in the configuration and uploads them to S3 After the build we check for changes in the directory, create a new archive and upload the updated archive back to S3.

For what purposes caches can be used? to store stage4 for chroot build environment. Other packages can be downloaded from binhost in the build script.

both github and bitbucket allow to upload any number of files, if size of each is less than 2GB this is my proposiion to store portage binhost directory

The first problem is to determine, which package(s) to emerge from sources, and which packages should be used from binhost.

The second problem is the absence of root rights.

http://unix.stackexchange.com/questions/13937/installing-gentoo-packages-as-an-ordinary-user-non-root

http://proot.me/ PRoot is a user-space implementation of chroot, mount --bind, and binfmt_misc. This means that users don't need any privileges or setup to do things like using an arbitrary directory as the new root filesystem, making files accessible somewhere else in the filesystem hierarchy

fakechroot (sys-apps/fakechroot) http://stackoverflow.com/questions/3737008/how-to-run-a-command-in-a-chroot-jail-not-as-root-and-without-sudo

https://wiki.gentoo.org/wiki/Project:Prefix/Manual_Bootstrap ^^ this is how to build portage toolchain for Gentoo/Prefix from stage1 in any other linux

ArsenShnurkov commented 8 years ago

One more use case for travis-ci: we can build distribution tarballs with it and publish these tarballs on github (and/or sourceforge/bitbucket/etc)

The GNU standards mandate shipping generated files in tarballs, to reduce the build dependencies to a minimum of universally available tools. If you get raw source (from a version control system, for instance), the generated files won't be there. (q) http://unix.stackexchange.com/a/210/126486

This use case is different from building binary code of packages and differs from testing of binary packages.

see also https://github.com/gentoo/dotnet/issues/118#issuecomment-200033093

TheChymera commented 7 years ago

Привет @ArsenShnurkov - do you have a minimal .travis.yml example which sets up a Gentoo environment in which I can manage dependencies via Portage? Currently I am using the vanilla TravisCI package management features, and I am not at all impressed with apt-get.