Bug 1408146 - s2i build fails when project contains nuget package that contains source code
Summary: s2i build fails when project contains nuget package that contains source code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: dotNET
Classification: Red Hat
Component: rh-dotnetcore10-container
Version: 1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ga
: 1.1
Assignee: Severin Gehwolf
QA Contact: jiri vanek
Les Williams
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-22 10:05 UTC by Tom Deseyn
Modified: 2017-03-20 08:25 UTC (History)
6 users (show)

Fixed In Version: rh-dotnetcore10-docker-1.0-13
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-20 08:25:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github redhat-developer s2i-dotnetcore issues 28 0 None None None 2017-03-13 14:21:25 UTC
Red Hat Product Errata RHBA-2017:0560 0 normal SHIPPED_LIVE updated dotNET container images 2017-03-20 12:34:48 UTC

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


Note You need to log in before you can comment on or make changes to this bug.