How can I get Mono 2.11+ installed on Travis-CI? - mono

I build my C# project on Travis-CI like this:
# .travis.yml
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq mono-devel gtk-sharp2
install:
- xbuild Source/Pash.sln
Travis uses Precise (Ubuntu 12.04 LTS) which seems like a good choice for them, but it includes Mono 12.10. My C# project hits a bug in Mono 2.10. The bug appears to be fixed in Mono 2.11+.
I read that Ubuntu is slow to pick up new builds of Mono because so much depends on it, and it can break so much. That's fine, but for Travis dependencies aren't really a problem - the machine goes away at the end of the build!
I have considered
compiling a new Mono in .travis.yml but I don't want to put that much burden on the Travis servers.
Building a MCS (Mono C# compiler) with just this fix.
Downloading and installing a newer Mono from somewhere (where?)
Checking a recent Mono in to my GIT repo.
Suggestions?

If you're going to use something higher than what standard distro packages provide, I recommend you to go all the way and not use unstable 2.11.x series, but official/beta 3.x ones.
So, grab yourself some preview Debian/Ubuntu 3.0.6 packages from this PPA:
http://www.meebey.net/posts/mono_3.0_preview_debian_ubuntu_packages/

The best way I've found to get a full up to date mono environment is to use an OS X travis profile
language: objective-c
before_install:
# Make sure mono is installed,
- wget http://download.mono-project.com/archive/3.0.10/macos-10-x86/MonoFramework-MDK-3.0.10.macos10.xamarin.x86.dmg
- hdid MonoFramework-MDK-3.0.10.macos10.xamarin.x86.dmg
- sudo installer -pkg "/Volumes/Mono Framework MDK 3.0.10/MonoFramework-MDK-3.0.10.macos10.xamarin.x86.pkg" -target /
install:
- xbuild Source/Pash.sln

Related

how to update meson version in flatpak builder

I'm trying to work on a gnome project (Aisleriot). It requires meson, so I installed it using
sudo apt install meson
That installed version 0.61.2. Unfortunately, the project requires version >= 0.62.0. Next, I ran the following command:
sudo apt-get install python3 python3-pip python3-setuptools python3-wheel ninja-build
Now meson is at version 0.64.0. Unfortunately, when I run Builder
flatpak run org.gnome.Builder
and load my project, it still uses meson version 0.61.2. Why is it using this earlier version and how do I tell Builder to use the system version instead?
There is a similar question from 4 years ago, but it talks about a build settings panel, which I couldn't find. Does the build settings panel still exist and how do I display it?

How to use software built from source and installed with brew in the same project?

I am trying to get my head around package managers. I recently installed llvm in macOS using
brew install llvm
I installed python3.8 using pyenv and CMake latest release from https://cmake.org/download/. Brew displayed this message after the installation:
==> Dependencies
Build: cmake ✘, python#3.8 ✘
Required: libffi ✔
I have 2 questions:
Should I be concerned that I did not install CMake nor python3.8 using brew? I would like to know before replacing my previous CMake and python3.8 installations with those offered by brew.
Is there a way to use pakages/software installed with brew and without it in the same project and not make everything a mess? If there is, how can I learn to do it?
I am a physics major so my knowledge in these topics is not as good as I would like to.
Thanks for the help!

Install Older Version of Mono

Today my Ubuntu updated Mono to 4.2.1.102. It will not allow a certain program I absolutely need to run. How can I down-grade it to 4.0.5.1? I have tried...
sudo apt-get install mono-complete=4.0.5.1
That doesn't work.
Edit your /etc/apt/sources.list.d/mono-xamarin.list and change:
deb http://download.mono-project.com/repo/debian wheezy main
to:
deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1 main
That will pin it to version 4.0.5.1.
FYI: Make sure that you do not have any alpha/beta repos for mono in any of your /etc/apt/sources/list.d/xxxxx.list files.
Basic Steps to Downgrade:
sudo apt-get remove mono-complete
# Edit your mono-xamarin.list and pin it to the version of your choice.
sudo apt-get update
sudo apt-get install mono-complete
Accessing older releases If for some reason you want to pin an older
version of Mono rather than updating to the latest, you can modify the
Debian repository to “wheezy/snapshots/X.XX.X” instead of “wheezy”.
For example, “wheezy/snapshots/3.10.0” will lock you to that version.
These snapshots will cease receiving updates as soon as the next major
Mono version gets uploaded - for example, as soon as Mono 3.12 gets
uploaded, 3.10 will never receive updates.
On RPM distributions, force the package version in your package
manager - all older versions are published in the YUM metadata and
should be available.
Ref: http://www.mono-project.com/docs/getting-started/install/linux/#accessing-older-releases
Ref: Versions available:
http://download.mono-project.com/repo/debian/pool/main/m/mono/
If, like me, you followed the official guide: https://www.mono-project.com/download/stable/ then you would have added an apt key and created
/etc/apt/sources.list.d/mono-official-stable.list
You can keep the key, but remove the file above using sudo rm -r /etc/apt/sources.list.d/mono-official-stable.list
Then make sure you follow the best answer above by editing the mono-xamarin.list file for the version you want and remove the version of mono you have.
Then apt update, then install mono-complete. An easy way to know you are correctly downloading and compiling a different version is that apt will prompt you asking if you want to download the files, and the size will be different.
Hope this helps someone, this last step made it work for me.
My system is Ubuntu 18.04.

Update Mono via CentOS

Hello i have CentOS and im trying my damnedest to update Mono i have version 1.2.4 at the moment some how, and im trying to compile something via xbuild and it isn't working im thinking because im using to old a version of mono.
Please BEFORE you link me ANY guide, if it links to the ftp.novell directory it no longer works, that directory is all scrapped. So i dont even know where to get a proper tarball for it now because on their site it only shows opensuse and such? Not CentOS like there used to be.
Can anyone help me with this :\
What version of CentOS are you using? 4?
The instructions below were tested on CentOS 5.9. They will also work fine on the latest CentOS version (6.4 as of this writing) and I imagine they would work with older versions as well.
Head over to /usr/src as root
su
cd /usr/src
Ensure GCC and friends are installed (to build the Mono source code)
yum install gcc gcc-c++ bison
Grab and unpack the Mono source code
wget http://download.mono-project.com/sources/mono/mono-3.0.7.tar.bz2
tar -xvjf mono-3.0.7.tar.bz2
Build and install Mono
cd mono-3.0.7
./configure --prefix=/usr
make && make install
Verify that you have a working Mono installation with mono --version and mcs --version
Build the GDI+ compatibility layer (required for System.Drawing)
yum install glib2-devel libX11-devel pixman-devel fontconfig-devel freetype-devel libexif-devel libjpeg-devel glib2-devel libtif-devel libpng-devel giflib-devel
cd /usr/src
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2
tar -xvjf libgdiplus-2.10.tar.bz2

Install Mono on Centos 5.5 using YUM

How do I install the Mono 2.6.7 runtime on CentOS 5.5 using YUM?
I know how to build Mono from the source. However, according to the page Getting Started With Mono Tools it is possible to install the binaries directly. I'd prefer to install the binaries to avoid having to install all the development pre-requisites on a server with little disk space.
Am I supposed to add a new repository description to YUM? I tried doing that, but I must have done it wrong, because "yum list mono-core" still says the old version (1.2.4-2.el5.centos).
And, why are the .rpm's called "mono-addon-" on the release server? It's a bit confusing. It sounds like the .rpm's are an add-on to Mono. I guess they mean they are an "add-on" to the server(?).
I figured it out.
Create a new repository configuration file
cd /etc/yum.repos.d
vi mono.repo
Add the following lines to the file
[Mono]
name=Mono Stack (RHEL_5)
type=rpm-md
baseurl=http://ftp.novell.com/pub/mono/download-stable/RHEL_5/
gpgcheck=1
gpgkey=http://ftp.novell.com/pub/mono/download-stable/RHEL_5/repodata/repomd.xml.key
enabled=1
Update the YUM cache to be on the safe side
yum clean all
Install the Mono server stack
yum install monotools-addon-server
The installed binaries will end up in "/opt/novell/mono/bin".
You should issue the following command to set up your shell environment so that it finds Mono, mcs and the other Mono tools
source /opt/novell/mono/bin/mono-addon-environment.sh
Verify the version
mono --version
Mono JIT compiler version 2.6.7 (tarball Mon Jul 19 18:28:58 UTC 2010)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC and Parallel Mark)
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
If you want the Mono environment to be permanent you can issue the following command.
cp /opt/novell/mono/bin/mono-addon-environment.sh /etc/profile.d
Happy Mono'ing!!!
In addition to octonion's post, if, like me, you want to use Apache mod_mono, you need to ensure you install the correct version of mod_mono by running the following, and it will get the right one:
yum install mod_mono-addon
Don't just issue yum install mod_mono. It may install mod_mono 1.2 version from the CentOS extras repository and not what you're actually after.
As a reference, I was getting the following error in /var/log/httpd/error_log when running the incorrect mod_mono version:
Root directory: /
mod_mono and xsp have different versions. Expected '9', got 6
System.InvalidOperationException: mod_mono and xsp have different versions. Expected '9', got 6
It is a silly, but easy mistake to make if you new to this like me.