Tag Archives: freebsd

FreeBSD: graphics/dri build failed

Have just installed FreeBSD 10.0-RELEASE. Build of graphics/dri port failed with the compilation error. The same problem and solution described here:

In file included from i830_context.c:28:
In file included from ./i830_context.h:31:
../../../../../src/mesa/drivers/dri/intel/intel_context.h:249:4: error: unknown type name 'drm_intel_context'
   drm_intel_context *hw_ctx;
   ^
1 error generated.

Post by gustopn » 14 Nov 2013, 11:45

And for those of you, who do not want to have a X without Intel KMS support, you need to remove /usr/local/include/intel_bufmgr.h in order for DRI to compile. The problem is that it looks for intel_bufmgr.h but in the wrong version; /usr/local/include/libdrm/intel_bufmgr.h is the right/new one.

As a final solution consider renaming the /usr/local/include/intel_bufmgr.h file.

Enjoy!

FreeBSD: MonoDevelop to run NUnit tests

I have spent some hours to figure out why MonoDevelop (4.0.9, bsd-sharp) is unable to run NUnit tests on FreeBSD.
The symptom: the MonoDevelop IDE tries to run the tests and after some time interval shows that no tests were run and there are no test results.

Here is the listing of the test result (test-results directory of the test project):

<?xml version="1.0" encoding="utf-8"?>
<TestRecord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Results>
    <UnitTestResult>
      <TestDate>2013-07-23T09:08:56</TestDate>
      <Status>Failure</Status>
      <Passed>0</Passed>
      <Errors>0</Errors>
      <Failures>0</Failures>
      <Inconclusive>0</Inconclusive>
      <NotRunnable>0</NotRunnable>
      <Skipped>0</Skipped>
      <Ignored>0</Ignored>
      <Time />
      <Message>Couldn't create a remote process.</Message>
      <StackTrace>  at MonoDevelop.Core.Execution.ProcessHostController.CreateInstance (System.String assemblyPath, System.String typeName, System.String[] addins, IList`1 userAssemblyPaths) [0x00064] in /usr/tmp/usr/ports/devel/monodevelop/work/monodevelop-4.0.9/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessHostController.cs:225 
  at (wrapper remoting-invoke-with-check) MonoDevelop.Core.Execution.ProcessHostController:CreateInstance (string,string,string[],System.Collections.Generic.IList`1&lt;string&gt;)
  at MonoDevelop.Core.Execution.ProcessService.CreateExternalProcessObject (System.Type type, IExecutionHandler executionHandler, IList`1 userAssemblyPaths) [0x0002f] in /usr/tmp/usr/ports/devel/monodevelop/work/monodevelop-4.0.9/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs:343 
  at MonoDevelop.NUnit.NUnitAssemblyTestSuite.RunUnitTest (MonoDevelop.NUnit.UnitTest test, System.String suiteName, System.String pathName, System.String testName, MonoDevelop.NUnit.TestContext testContext) [0x0003e] in /usr/tmp/usr/ports/devel/monodevelop/work/monodevelop-4.0.9/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs:387 
  at MonoDevelop.NUnit.NUnitAssemblyTestSuite.OnRun (MonoDevelop.NUnit.TestContext testContext) [0x00001] in /usr/tmp/usr/ports/devel/monodevelop/work/monodevelop-4.0.9/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs:356 
  at MonoDevelop.NUnit.UnitTest.Run (MonoDevelop.NUnit.TestContext testContext) [0x0001e] in /usr/tmp/usr/ports/devel/monodevelop/work/monodevelop-4.0.9/src/addins/NUnit/Services/UnitTest.cs:361 </StackTrace>
    </UnitTestResult>
  </Results>
  <Tests />
</TestRecord>

Furthermore, attempt to run the tests manually leads to the following output:

$ nunit-console HelloTests.dll -xmlConsole
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment - 
   OS Version: Unix 9.1.4.0
  CLR Version: 2.0.50727.1433 ( 3.1.2 (tarball Tue Jul 23 19:49:13 UTC 2013) )

Unhandled Exception:
System.ArgumentOutOfRangeException: Index is less than 0 or more than or equal to the list count.
Parameter name: index
0
  at System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException (System.String name, System.Object actual, System.String message) [0x00000] in /usr/tmp/usr/ports/lang/mono/work/mono-3.1.2/mcs/class/corlib/System.Collections/ArrayList.cs:3244 
  at System.Collections.ArrayList.get_Item (Int32 index) [0x00013] in /usr/tmp/usr/ports/lang/mono/work/mono-3.1.2/mcs/class/corlib/System.Collections/ArrayList.cs:2635 
  at System.Diagnostics.ProcessModuleCollection.get_Item (Int32 index) [0x00000] in /usr/tmp/usr/ports/lang/mono/work/mono-3.1.2/mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs:64 
  at System.Diagnostics.Process.get_MainModule () [0x00000] in /usr/tmp/usr/ports/lang/mono/work/mono-3.1.2/mcs/class/System/System.Diagnostics/Process.cs:228 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_MainModule ()
  at NUnit.Util.DomainManager.CreateDomain (NUnit.Core.TestPackage package) [0x0019f] in /usr/tmp/usr/ports/lang/mono/work/mono-3.1.2/mcs/nunit24/ClientUtilities/util/Services/DomainManager.cs:105 
  at NUnit.Util.TestDomain.Load (NUnit.Core.TestPackage package) [0x00011] in /usr/tmp/usr/ports/lang/mono/work/mono-3.1.2/mcs/nunit24/ClientUtilities/util/TestDomain.cs:52

Analysis:

System.Diagnostics.Process class implementation for Linux-based operating system uses procfs (/proc).
procfs is not enabled for FreeBSD by default.

Solution:

Mount procfs using /etc/fstab (reboot to apply):

proc /proc procfs rw 0 0

or mount procfs right now (without reboot):

mount -t procfs proc /proc

Since now MonoDevelop runs NUnit tests slightly!
Enjoy!

P.S. The same issue found here: FreeBSD, Mono y FireBird .Net Provider.

FreeBSD, QtCreator: debugging helper missing

After installing QtCreator on FreeBSD 9.1, I’ve tried debugging a simple Qt GUI application.
I set a breakpoint and started debugging. I’ve got the message:

> Debugging Helper Missing

> The debugger could not load the debugging helper library.

> The debugging helper is used to nicely format the values of some Qt and Standard Library data types. It must be compiled for each used Qt version separately. In the Qt Creator Build and Run preferences page, select a Qt version, expand the Details section and click Build All.

##Root cause:

– As stated [here](http://blog.qt.digia.com/blog/2010/04/22/peek-and-poke-vol-3/) Qt Creator’s helpers are **Python based**.
– [Python support has been introduced into gdb since gdb 7](http://docs.python.org/devguide/gdb.html#gdb-7-and-later).
– The default version of gdb (/usr/bin/gdb) is gdb 6.*. This version does not have Python support. To check it:

$ gdb
$ (gdb) python print “Hello, World!”

It must print “Hello, World!” if there is Python support.

##Solution:

1. Install [devel/gdb](http://www.freshports.org/devel/gdb). It is installed to /usr/local/bin/gdb. Also, try the Python check for this version of gdb as described above.
2. Run QtCreator, go Tools => Options => Build & Run => Kits => Debugger, use Manage… button.

Use the following settings:
– Engine: GDB Engine
– Binary: /usr/local/bin/gdb

After completing these steps, QtCreator stops at breakpoints just fine.