Bug 1408146

Summary: s2i build fails when project contains nuget package that contains source code
Product: dotNET Reporter: Tom Deseyn <tdeseyn>
Component: rh-dotnetcore10-containerAssignee: Severin Gehwolf <sgehwolf>
Status: CLOSED ERRATA QA Contact: jiri vanek <jvanek>
Severity: unspecified Docs Contact: Les Williams <lwilliam>
Priority: unspecified    
Version: 1.0CC: bgollahe, dbhole, kanderso, lzachar, omajid, zzambers
Target Milestone: ga   
Target Release: 1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rh-dotnetcore10-docker-1.0-13 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-20 08:25:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Deseyn 2016-12-22 10:05:56 UTC
redhat-developer/s2i-aspnet-musicstore-ex doesn't build on openshift.

```
/opt/app-root/src/.nuget/packages/Pomelo.JsonObject/1.1.0/src/Pomelo.JsonObject/System/JsonObject.cs(4,29): error CS0436: The type 'JsonObject<T>' in '/opt/app-root/src/.nuget/packages/Pomelo.JsonObject/1.1.0/src/Pomelo.JsonObject/System/JsonObject`1.cs' conflicts with the imported type 'JsonObject<T>' in 'Pomelo.JsonObject, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in '/opt/app-root/src/.nuget/packages/Pomelo.JsonObject/1.1.0/src/Pomelo.JsonObject/System/JsonObject`1.cs'.
```

The referenced Pomelo.JsonObject contains dlls and source code. Because the .nuget folder is under the project folder, the compiler thinks it should also compile this code. Then it ends up with duplicate types: one from the dll and one from the source code.

The .nuget folder gets put there because the Dockerfile sets HOME=/opt/app-root/src. HOME and src must be distinct folders.

Comment 1 Omair Majid 2016-12-22 16:51:28 UTC
This is a variant of bug 1384151. We can fix nupkgs shipped with .NET Core itself, but we have no control over those downloaded from nuget.org.

I suspect we have to modify things so that $HOME is not the same as the source root (/opt/app-root/src) and is not under the source root.

Comment 2 Tom Deseyn 2016-12-22 16:54:56 UTC
> I suspect we have to modify things so that $HOME is not the same as the source
> root (/opt/app-root/src) and is not under the source root.

Exactly!

Comment 3 Severin Gehwolf 2016-12-22 16:56:14 UTC
(In reply to Omair Majid from comment #1)
> I suspect we have to modify things so that $HOME is not the same as the
> source root (/opt/app-root/src) and is not under the source root.

Agreed. I was meaning to create an upstream issue for this.

Comment 6 zzambers 2017-03-15 18:34:16 UTC
Testsuite passed for both 1.0.4 and 1.1.1

1.0.4
https://bugzilla.redhat.com/show_bug.cgi?id=1430300#c4

1.1.1
https://bugzilla.redhat.com/show_bug.cgi?id=1430310#c4

Comment 8 errata-xmlrpc 2017-03-20 08:25:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0560