Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 589554 - dev-util/monodevelop-6.0.0.4761 bundles a copy of libgit2 and fails multilib-strict
Summary: dev-util/monodevelop-6.0.0.4761 bundles a copy of libgit2 and fails multilib-...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: dotnet project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-23 23:12 UTC by Mike Auty (RETIRED)
Modified: 2016-12-31 13:59 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Auty (RETIRED) gentoo-dev 2016-07-23 23:12:51 UTC
It appears that the monodevelop-6 bundles its own copy of libgit2 (it's unclear if there are any custom modifications) that monodevelop-5.9.5.9 did not include.  It seems to build and install this even with USE="-git".

The ebuild also writes all AddIns into /usr/lib/ rather than /usr/lib32 or /usr/lib64/.  The dlls appear to be 32bit, which I assume isn't too much of a problem, since no other program should try to pull in .dll files.  However, it also writes the so files, which are 64-bit and portage therefore picks up on in the multilib-strict FEATURE, and complains that they're not in /usr/lib64/.  More details on mutlilib-strict are available at [1].

Ideally, this should build against the locally installed libgit2, but failing that, it needs the extra copy of libgit2 installing in the appropriate /usr/lib{32,64} directory, and any references in DLLs updating to point there also...

Please let me know if you need any further information.  5:)  Happy to include all the standard build logs etc, if they'd be useful?

[1] https://devmanual.gentoo.org/archs/amd64/

Files matching a file type that is not allowed:
   usr/lib/monodevelop/AddIns/VersionControl/libgit2-e8b8948.so
   usr/lib/monodevelop/AddIns/VersionControl/libgit2-e8b8948.so.23
   usr/lib/monodevelop/AddIns/VersionControl/libgit2-e8b8948.so.0.23.0
 * ERROR: dev-util/monodevelop-6.0.0.4761::gentoo failed:
 *   multilib-strict check failed!
 * 
 * Call stack:
 *   misc-functions.sh, line 603:  Called install_qa_check
 *   misc-functions.sh, line 217:  Called source 'install_symlink_html_docs'
 *   80multilib-strict, line  47:  Called multilib_strict_check
 *   80multilib-strict, line  43:  Called die
 * The specific snippet of code:
 *   		[[ ${abort} == yes ]] && die "multilib-strict check failed!"
 * 
 * If you need support, post the output of `emerge --info '=dev-util/monodevelop-6.0.0.4761::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-util/monodevelop-6.0.0.4761::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-util/monodevelop-6.0.0.4761/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-util/monodevelop-6.0.0.4761/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-util/monodevelop-6.0.0.4761/image'
 * S: '/var/tmp/portage/dev-util/monodevelop-6.0.0.4761/work/monodevelop-6.0'
Comment 1 Arsen Shnurkov 2016-07-23 23:29:11 UTC
> monodevelop-6 bundles its own copy of libgit2
> (it's unclear if there are any custom modifications)

It's packaged into LibGit2Sharp.NativeBinaries.nupkg
which is downloaded from
https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries
and declared to be build with
https://github.com/libgit2/libgit2sharp.nativebinaries
Comment 2 Mike Auty (RETIRED) gentoo-dev 2016-07-24 21:13:23 UTC
(In reply to Arsen Shnurkov from comment #1)
> > monodevelop-6 bundles its own copy of libgit2
> > (it's unclear if there are any custom modifications)
> 
> It's packaged into LibGit2Sharp.NativeBinaries.nupkg
> which is downloaded from
> https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries
> and declared to be build with
> https://github.com/libgit2/libgit2sharp.nativebinaries

So the monodevelop tarball includes a copy of libgit2, which according to monodevelop's github repo (both for the version in portage and also for master):

https://github.com/mono/monodevelop/tree/monodevelop-6.0.0.4761/main/external/

links off to the following repo:

https://github.com/mono/libgit2/

which is a fork of libgit2, and last had commits 11 months ago.  It's unclear if this repo has had any changes from the original libgit2 repo, but it's clear it hasn't had any updates (including security updates) in nearly a year.
Comment 3 Arsen Shnurkov 2016-07-27 01:29:49 UTC
I bumped the ebuild for LibGit2:
https://github.com/gentoo/dotnet/pull/206/files

There was no ebuild for LibGit2Sharp, so i decide to try to write it
https://github.com/gentoo/dotnet/compare/master...ArsenShnurkov:libgit2sharp

I found that LibGit2Sharp project itself depend on "NativeBinaries" package:

./LibGit2Sharp/packages.config:  <package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net4" allowedVersions="[1.0.129]" />

now i don't know - is it better to package NativeBinaries, or it is better to understood how it works and write a replacement patch which will do the same work without additional package
Comment 4 Arsen Shnurkov 2016-07-27 01:44:18 UTC
the main purpose of file LibGit2Sharp.NativeBinaries.props 
see
https://github.com/libgit2/libgit2sharp.nativebinaries/blob/master/nuget.package/build/LibGit2Sharp.NativeBinaries.props

is to copy libgit2.so file into output dir:

        <None Condition="Exists('$(MSBuildThisFileDirectory)\..\libgit2\linux\x86_64\libgit2-381caf5.so')" Include="$(MSBuildThisFileDirectory)\..\libgit2\linux\x86_64\libgit2-381caf5.so">
            <Link>lib\linux\x86_64\libgit2-381caf5.so</Link>
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>

and to set correspondence in https://github.com/libgit2/libgit2sharp.nativebinaries/blob/master/nuget.package/libgit2/LibGit2Sharp.dll.config

both actions are not necessary in gentoo, because library is installed globally and controlled by portage.

So, I decide to remove reference to NativeBinaries from LibGit2Sharp.csproj
Comment 5 Arsen Shnurkov 2016-07-27 02:45:59 UTC
@nulltoken already tried to package LibGit2Sharp way year ago  (but it's unclear for me for which package manager):
https://travis-ci.org/libgit2/libgit2sharp/jobs/63710116

CSC: error CS2001: Source file `Core/NativeDllName.cs' could not be found

this file should be generated by
https://github.com/libgit2/libgit2sharp/blob/master/LibGit2Sharp/NativeDllName.targets

but it's line
https://github.com/libgit2/libgit2sharp/blob/3615df921ded6e58b08bc438645d9291804f5db1/LibGit2Sharp/NativeDllName.targets#L17
<GenerateNativeDllNameTask InputHashFile="@(EmbeddedResource)" Condition=" '%(Filename)%(Extension)' == 'libgit2_filename.txt' " OutputFile="$(NativeDllNamePath)" />

requires file libgit2_filename.txt to be present

and this file comes from 
https://github.com/libgit2/libgit2sharp.nativebinaries/blob/master/nuget.package/libgit2/libgit2_filename.txt

and the file "libgit2_filename.txt" was added into main project as resource here
https://github.com/libgit2/libgit2sharp.nativebinaries/blob/b059d8b5671bceed04f133b4c9bbd38871505f75/nuget.package/build/LibGit2Sharp.NativeBinaries.props#L4

NativeBinaries package dependency was just removed from build (see comment above)

so we need something like
echo "/usr/lib64/libgit2.so" >libgit2_filename.txt
and modify the patch to .csproj - add line similar to
<EmbeddedResource Include="libgit2_filename.txt" />
Comment 6 Arsen Shnurkov 2016-07-27 05:00:29 UTC
libgit2sharp ebuild PR:
https://github.com/gentoo/dotnet/pull/207

so now you can use it to compile your version of monodevelop
Comment 7 Mike Auty (RETIRED) gentoo-dev 2016-07-27 15:30:30 UTC
Hi Arsen,

Thanks very much for the work you've done!  5:)  I've tested it, and Libgit2Sharp from the dotnet repo does compile without errors (although it installs files in /usr/local/nuget) however it appears that the version of monodevelop in the dotnet repo still compiles its own copy of libgit2 and attempts to install it.

Also hardcoding the path as /usr/lib64/libgit2.so comes with two issues: firstly figuring out the correct path (since prefix users don't necessarily install into /usr) and secondly making sure that the dependency matches the version of libgit2 that monodevelop was expecting.  Unfortunately since libgit2 is still in development, they've done something a bit daft and symlinked libgit2.so.0.24.0 to libgit2.so.24 (rather than libgit2.so.0) at install time.  However, it's probably still better to link to libgit2.so.24 than simply libgit2.so (since libgit2.so.25 might break Libgit2Sharp when it gets upgraded)...

I don't really use monodevelop with git, so whether Libgit2sharp works or not isn't something that directly affects me, but monodevelop still attempting to install libgit2 libraries does.  5:\

Lemme know when you've got more tests I can run, I'm happy to help as much as I can to get this resolved!  5:)
Comment 8 Mike Auty (RETIRED) gentoo-dev 2016-08-29 13:15:45 UTC
Just a note, the in-tree version is still failing multilib-strict, and still preventing installs on systems with that feature enabled.  Any progress on this?
Comment 9 Pacho Ramos gentoo-dev 2016-11-17 11:02:08 UTC
We also need to kill the completely obsolete stable version (that also needs the old splitted gnome-sharp building and I wonder if it is even working with mono-4)
Comment 10 Pacho Ramos gentoo-dev 2016-12-31 13:59:45 UTC
dropped