TeamCity NUnitLauncher running on Linux (mono) gives "Corlib not in sync with this runtime" error - linux

Running a TeamCity build agent to run NUnit tests on Ubuntu 14.04 LTC with the latest build of mono appears to have some dependency issues that I cant for the life of me solve.
I have followed the following installation steps
Mono Installation Steps for 4.0.1
Team City Build Agent
When the TC Build Agent starts the NUnit step, it simply fails, and looking at the logs shows it executes
/usr/bin/mono-sgen /home/ubuntu/buildAgent/plugins/dotnetPlugin/bin/JetBrains.BuildServer.NUnitLauncher.exe
which promptly returns with
Corlib not in sync with this runtime: expected corlib version 117, found 111.
Loaded from: /usr/lib/mono/4.0/mscorlib.dll
Download a newer corlib or a newer runtime at http://www.mono-project.com/download.
Is there any possible way to get this to work? I have tried removing all the pieces and re-installing again and even installing a older version of mono build but to no avail.
The TC connection appears to work and I can manually invoke and call mono on its own and even nunit-console however this .exe build provided by TC seems to have be stumped as linux non-expert.
Please save me from dependency hell!!
Edit: I ended up just solving my problem by installing nunit-console and enabling the XML Report processing build feature rather than play around with the corelib files and break something else.

This is a Mono bug, see https://bugzilla.xamarin.com/show_bug.cgi?id=34675.
The problem is that Mono moved to providing the 4.0 assemblies, including mscorlib.dll, only in form of reference assemblies. They contain only metadata and are intended for the compiler. Normally applications just use the newest version automatically.
The loader code in Mono however wasn't updated to bind forward an explicit runtime version of v4.0.20506 or v4.0.30128 which TeamCity is using in their .exe.config files to the latest version. The runtime instead tries to load mscorlib.dll from the 4.0 directory and bails as the version is too old (it's from the time the reference assemblies were generated).
As a workaround, you can edit <build agent
installdir>/plugins/dotnetPlugin/bin/JetBrains.BuildServer.NUnitLauncher.exe.config (and other .exe.config files)
and remove the following lines:
<supportedRuntime version="v4.0.20506"/>
<supportedRuntime version="v4.0.30128"/>
This might stop working once TeamCity decides to update the plugin though.

Replacing the mscorlib version is only asking for trouble - i.e. TypeLoadException's and friends are waiting around the corner to get you.
What I did was replace the Teamcity build step with a manual invocation of the TC NunitLauncher, but forcing it to use Mono 4.5:
mono --runtime=4.5 /Applications/buildAgent/plugins/dotnetPlugin/bin/JetBrains.BuildServer.NUnitLauncher.exe v4.0 MSIL NUnit-2.6.3 $(find **/bin/Release/*Tests.dll | paste -sd ";" -)
The invocation uses some shell trickery to find all assemblies I'm interested in using a wildcard, but other than that should be straightforward to understand.
It would be nice if Mono fixed their broken 4.0 runtime. Anyone already reported it on https://bugzilla.xamarin.com/ ?

This is how I worked around it : (note my mono is in /opt/mono)
$ cd /opt/mono/lib/mono
$ sudo mv 4.0 __4.0
$ sudo ln -s 4.5 4.0
i.e get rid of the 4.0 folder and symlink the 4.5 to be 4.0
This is something of a hack but it got me up and running until a proper fix surfaces!
Steve

I had this problem on my Raspberry Pi after compiling 4.0.2 but it was loading from /4.5/
This got me going:
sudo mv /usr/lib/mono/4.5/mscorlib.dll /usr/lib/mono/4.5/_old_mscorlib.dll
sudo cp /opt/mono-4.0.2/lib/mono/4.5/mscorlib.dll /usr/lib/mono/4.5

Related

How to reconfigure a project

ALL,
I have a project on GitHub which is an application I'm still developing.
On Linux I'm using Anjuta as an IDE to generate the Makefile and build it.
The problem I'm facing is that I just build myself a newer machine with the newer set of autotools and now the project fails to build because its Makefile is set to use the older version.
In particular make complains about using aclocal version 1.15 and the newer box have aclocal version 1.16.
What would be the process of making the code build I presume I need to run some kind of reconfiguration tool to make the configure aware of the upgrade. I just don't know how and what.
Also, if someone can help on what files needs to be in the source control so that every single time I update everything will be regenerated automatically.
TIA!!

vscode crashes on Arch linux when opening file/folder

Installation vscode
I'm running Arch Linux (Manjaro) and installed vscode with:
sudo pacman -S code
but then a simple .NET core program resulted in
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
It seems like the official Microsoft build should be obtained via the snap store:
sudo snap install code --classic
And the program looks normal. I can install plug-ins, create a new file et cetera.
Problem
However, I cannot open any files or projects. Doing so results in vscode crashing. I read that code --disable-gpu could solve this problem, but doesn't do so for me.
Any ideas
what may cause this crash?
or how to get the pacman vscode working?
Logs
$ code --verbose
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
(code:33833): GdkPixbuf-WARNING **: 22:59:19.817: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
[33863:1104/225919.911481:ERROR:appcenter_api.cc(52)] expecting appcenter url prefix
[main 2020-11-04T21:59:19.960Z] Sending env to running instance...
[main 2020-11-04T21:59:20.041Z] Sent env to running instance. Terminating...
[main 2020-11-04T21:59:20.041Z] Lifecycle#kill()
where the recommended gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache results in bash: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache: No such file or directory
I'm running Arch Linux (Manjaro) and installed vscode with:
sudo pacman -S code
but then a simple .NET core program resulted in
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
I had the same issue trying to get the debugger to work and I spent hours on finding the reason for this. What I found out is that the debugger only works with officially signed Microsoft binaries of VSCode. So you have to make a distinction here:
The package code contains the open source version of visual studio code, a build wich anyone can make using the provided sources by Microsoft. The program which you get here is therefore not signed by MS!
The package visual-studio-code-bin provided by the AUR contains a officially signed version by MS. If you use this package, the debugger works as expected.
I do not know wether snap - which I personally never used at all - provides this kind of package, so I can not tell anything about that, but using the said package from the user repository solved the problem for me reliably.
Try this one (which I installed just yesterday under the recent manjaro distribution and it worked fine) and see if this solves your problem with opening files and folders.

Unable to find msbuild after building Mono 6.10 on linux

Yeah there's a need for me to build MS project on Linux.
I've download Mono from their offical website and built on Ubuntu 16. But when I want to use msbuild ,I found this tool didn't exist.
After my "make && make install", the folder of msbuild in Mono is:
hololqq#hololqq-virtual-machine:/opt/mono/lib/mono/msbuild$ ls
Current
Compare to the Mono installed by using apt-get , the folder should be:
hololqq#hololqq-virtual-machine:/usr/lib/mono/msbuild$ ls
15.0 Current
It's strange because the document : https://www.mono-project.com/docs/about-mono/releases/6.10.0/ has said that they just update msbuild:
19662 - [2019-12] Bump msbuild to track mono-2019-12
So I'm confused with this situation. Is anything else I forget while building? Or just the source codes of Mono didn't contain msbuild? Appericiate for your any suggestion.
PS:I have used monodevelop and xbuild. And monodevelop isn't easy to build from source code, and xbuild has some bugs while compiling VS peojects.
Update:
Finally still has no useful way. I use xbuild instead(it has a bug that you need to run it twice, because the first build won't success).

Intellij IDEA 2017.2 can't add openjk 9 on Linux Mint 18

I am using Intellij IDEA 2017.2.5 on Linux Mint 18.2 and trying to add new openjdk-9 SDK but IDEA does not accept openjdk 9 as valid JDK:
I have installed all of my SDKs using apt-get from ppa standard repositories.
This is my update-alternatives --config java/javac output:
Although Intellij declared it would support JDK 9 here, but it seems it is not yet fully compatible with at least opensdk-9.
Maybe refactoring SDK directory and removing 'jre' folder misleads the IDEA to find the SDK 9 home folder.
Any idea why Intellij IDEA claims 'The selected directory is not a valid home for JDK' ?
“ Ubuntu PPA for OpenJDK” currently has very old build of openjdk-9(9~b115-1ubuntu1).
So the IDEA does not recognize it as a valid SDK.
I removed current installed version:
sudo apt-get remove '^openjdk-9.*'
Then I have downloaded newer .deb build(9~b181) files including jre,jre-headless,... from launchpad build archive.
sudo dpkg -i openjdk-9-jre-headless_9_b181-4_amd64.deb
openjdk-9-jre_9_b181-4_amd64.deb
openjdk-9-jdk-headless_9_b181-4_amd64.deb
openjdk-9-jdk_9_b181-4_amd64.deb
Just Execute the above command at a single line, line breaks are for better readability.
Ignore any error complaining about:
"Package libpng16-16 is not installed."
Next execute the following:
sudo apt-get install -f
Now after installing this build of openjdk-9 the IDEA is happy with SDK home.
Thanks #y.bedrov for his useful comment.
Update:
However this solution enables you to declare openjdk-9 in the mentioned IDEA version(2017-2) but you are not able to compile any class within the IDEA itself.
You can only compile your application with elder jdk and run it with openjdk-9. There is an other issue which indicates this here.
In the newer IDEA versions(I have tested 2017.3) this build of openjdk is not allowed to be used as new SDK any more, see this issue.
The short reason is an issue in Debian package which contains incorrectly compiled lib/jrt-fs.jar file.
See this Answer for more information

Node JS ./configure + make fails unable to remap python lib-dynload/itertools.dll to same address as parent

This might be more of a CYGWIN question than a Nodejs but here goes.
I installed Cygwin yesterday and on the packages selection I just clicked next as it looked like most were pre-selected, and then today read this guide http://boxysystems.com/index.php/step-by-step-instructions-to-install-nodejs-on-windows/ on installing nodejs.
The ./configure had an error that it was unable to remap python lib-dynload/itertools.dll to same address as parent. As the process still completed I tried the make command, but it fails on the same error.
So, I opened cygwin setup.exe and this time I clicked the source checkbox for all the Python packages. But still get the same error. Should I now go to Cygwin and check all the source packages for the Make packages, delete it and reinstall from scratch using the above guide. Or something else?
Any help gratefull received/
Use the official 0.5.x windows build from http://nodejs.org/#download - you just have to download a .exe file and you can start it.
Versions 0.5.X have problems with Cygwin and because of developing clean Windows version Cygwin environment is now unsupported. Stable version 0.4.12 builds on Cygwin with no problems. If you want to use node.js unstable 0.5.X branch on Windows use windows build at official node.js site.
check this out:
https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)
Update Sept 1, 2011 -- as of today, v0.5.5 does not build on Cygwin (errors on make). Use v.0.5.4 (ie. follow instructions below and use "git checkout v0.5.4".
https://github.com/joyent/node/wiki/API-changes-between-v0.4-and-v0.6
Cygwin build is no longer supported. Use native windows builds instead.

Resources