Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major bug: Paket adds native references to .vcxproj file as if they are managed references (assemblies) #1658

Closed
konste opened this issue May 3, 2016 · 11 comments

Comments

@konste
Copy link
Contributor

konste commented May 3, 2016

In paket.dependencies we have
framework: native
content: none
redirects: off
source https://www.nuget.org/api/v2/
nuget boost_date_time-vc140 1.60.0.0
nuget boost_filesystem-vc140 1.60.0.0
nuget boost_system-vc140 1.60.0.0

And in paket.references same packages also designated as native:
cpprestsdk.v140.winxp.msvcstl.static.rt-dyn framework: native
boost_filesystem-vc140 framework: native
boost_date_time-vc140 framework: native
boost_system-vc140 framework: native

When Packet Install executes it adds references to .vcxproj file, but does it like that:

<When Condition="'$(Platform)'=='Win32'">
      <ItemGroup>
        <Reference Include="boost_date_time-vc140-mt-1_60">
          <HintPath>..\..\packages\boost_date_time-vc140\lib\native\address-model-32\lib\boost_date_time-vc140-mt-1_60.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="boost_date_time-vc140-mt-gd-1_60">
          <HintPath>..\..\packages\boost_date_time-vc140\lib\native\address-model-32\lib\boost_date_time-vc140-mt-gd-1_60.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>

What is wrong in that fragment is that Reference element should instead be NativeReference or it confuses build system badly as it expect References to be proper .NET assemblies.

Should be relatively easy and straightforward fix, but it is blocking use from further development with Paket.

Konstantin

@forki
Copy link
Member

forki commented May 3, 2016

Can you please come up with a small repro that has this issue and a csproj
that is fixed.

BTW: it's not a major bug it's just not really supported, yet. ;-) but I
will do my best to help you with that.
On May 3, 2016 9:55 PM, "Konstantin Erman" [email protected] wrote:

In paket.dependencies we have
framework: native
content: none
redirects: off
source https://www.nuget.org/api/v2/
nuget boost_date_time-vc140 1.60.0.0
nuget boost_filesystem-vc140 1.60.0.0
nuget boost_system-vc140 1.60.0.0

And in paket.references same packages also designated as native:
cpprestsdk.v140.winxp.msvcstl.static.rt-dyn framework: native
boost_filesystem-vc140 framework: native
boost_date_time-vc140 framework: native
boost_system-vc140 framework: native

When Packet Install executes it adds references to .vcxproj file, but does
it like that:

....\packages\boost_date_time-vc140\lib\native\address-model-32\lib\boost_date_time-vc140-mt-1_60.dll True True ....\packages\boost_date_time-vc140\lib\native\address-model-32\lib\boost_date_time-vc140-mt-gd-1_60.dll True True

What is wrong in that fragment is that Reference element should instead be
NativeReference or it confuses build system badly as it expect References
to be proper .NET assemblies.

Should be relatively easy and straightforward fix, but it is blocking use
from further development with Paket.

Konstantin


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1658

@konste
Copy link
Contributor Author

konste commented May 3, 2016

Ok, working on it.

From: Steffen Forkmann [mailto:[email protected]]
Sent: Tuesday, May 3, 2016 2:08 PM
To: fsprojects/Paket [email protected]
Cc: Konstantin Erman [email protected]; Author [email protected]
Subject: Re: [fsprojects/Paket] Major bug: Paket adds native references to .vcxproj file as if they are managed references (assemblies) (#1658)

Can you please come up with a small repro that has this issue and a csproj
that is fixed.

BTW: it's not a major bug it's just not really supported, yet. ;-) but I
will do my best to help you with that.
On May 3, 2016 9:55 PM, "Konstantin Erman" <[email protected]mailto:[email protected]> wrote:

In paket.dependencies we have
framework: native
content: none
redirects: off
source https://www.nuget.org/api/v2/
nuget boost_date_time-vc140 1.60.0.0
nuget boost_filesystem-vc140 1.60.0.0
nuget boost_system-vc140 1.60.0.0

And in paket.references same packages also designated as native:
cpprestsdk.v140.winxp.msvcstl.static.rt-dyn framework: native
boost_filesystem-vc140 framework: native
boost_date_time-vc140 framework: native
boost_system-vc140 framework: native

When Packet Install executes it adds references to .vcxproj file, but does
it like that:

....\packages\boost_date_time-vc140\lib\native\address-model-32\lib\boost_date_time-vc140-mt-1_60.dll True True ....\packages\boost_date_time-vc140\lib\native\address-model-32\lib\boost_date_time-vc140-mt-gd-1_60.dll True True

What is wrong in that fragment is that Reference element should instead be
NativeReference or it confuses build system badly as it expect References
to be proper .NET assemblies.

Should be relatively easy and straightforward fix, but it is blocking use
from further development with Paket.

Konstantin


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1658


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHubhttps://github.com//issues/1658#issuecomment-216664912

@konste
Copy link
Contributor Author

konste commented May 3, 2016

Trivial example is here: https://goo.gl/5Uxjjx
It is empty C++ project with a couple boost packages added with Paket.
When you build it you get warnings
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'boost_filesystem-vc140-mt-1_60.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
That's exactly because Paket used Reference instead of NativeReference for native er-r... reference :)

@forki
Copy link
Member

forki commented May 4, 2016

image

does this look correct?

@konste
Copy link
Contributor Author

konste commented May 4, 2016

If it compiles - it is probably fine! Frankly I also don't have a ton of experience with native NuGet packages. Playing by the ear. :)

@forki
Copy link
Member

forki commented May 4, 2016

I don't know if it compiles - I'm missing some C++ build tools. I will just release this in v3 channel so you can test.

@konste
Copy link
Contributor Author

konste commented May 4, 2016

Is there a build for me to try?

@forki
Copy link
Member

forki commented May 4, 2016

I wish. Deutsche Telekom killed my Internet and tethering did not work...

I will let you know
On May 4, 2016 19:11, "Konstantin Erman" [email protected] wrote:

Is there a build for me to try?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#1658 (comment)

@forki
Copy link
Member

forki commented May 4, 2016

push succeeded please test latest paket 3.0 beta version. thx

@konste
Copy link
Contributor Author

konste commented May 4, 2016

It does the right thing, but I cannot test it beyond the very first project, because #1657 is in the way. I have provided a small repro for that issue.

@forki
Copy link
Member

forki commented May 4, 2016

yeah. hopefully I can take a look tomorrow. Developing a package manager without good internet connection is no fun.

@forki forki closed this as completed in dcdcd46 May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants