Cannot setup mixed framework correctly #1523

Closed
acmore opened this Issue Mar 17, 2016 · 22 comments

Comments

Projects
None yet
2 participants
@acmore

acmore commented Mar 17, 2016

Hi,

I am using Paket version 2.52.8.0 to maintain the packages for a solution with mixed framework(.net & native) projects. Paket doesn't setup the project file well for native projects.

Here is the paket.dependencies:

framework: native

source https://www.nuget.org/api/v2
nuget boost_filesystem-vc140
nuget boost_system-vc140

and paket.references

boost_filesystem-vc140 framework: native
boost_system-vc140 framework: native

It works perfect for this setting. The dependent project is added to the project file correctly. The project file is like this:

 <Import Project="..\packages\boost\build\$(__paket__boost_targets).targets" Condition="Exists('..\packages\boost\build\$(__paket__boost_targets).targets')" Label="Paket" />
  <Import Project="..\packages\boost_filesystem-vc140\build\$(__paket__boost_filesystem-vc140_targets).targets" Condition="Exists('..\packages\boost_filesystem-vc140\build\$(__paket__boost_filesystem-vc140_targets).targets')" Label="Paket" />
  <Import Project="..\packages\boost_system-vc140\build\$(__paket__boost_system-vc140_targets).targets" Condition="Exists('..\packages\boost_system-vc140\build\$(__paket__boost_system-vc140_targets).targets')" Label="Paket" />

However, when I changed framework to net452 in paket.dependencies, it did not add the dependency boost to the project file.

  <Import Project="..\packages\boost_filesystem-vc140\build\$(__paket__boost_filesystem-vc140_targets).targets" Condition="Exists('..\packages\boost_filesystem-vc140\build\$(__paket__boost_filesystem-vc140_targets).targets')" Label="Paket" />
  <Import Project="..\packages\boost_system-vc140\build\$(__paket__boost_system-vc140_targets).targets" Condition="Exists('..\packages\boost_system-vc140\build\$(__paket__boost_system-vc140_targets).targets')" Label="Paket" />

So the build is broken because cannot find the boost package. And most of the packages used in my solution is .net packages, and due to some reason, we don't want to separate the paket.dependencies. Any idea about this issue?

Here is the project for testing this issue.
TestPaket.zip

@forki forki added the bug label Mar 17, 2016

@forki forki closed this in 1f98a40 Mar 17, 2016

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 17, 2016

Member

Your deps file should look like this:

framework: native, net452

source https://www.nuget.org/api/v2
nuget boost_filesystem-vc140
nuget boost_system-vc140

you need to specify both native and net452 since otherwise the resolver would not check all dependencies.

That said there was still a bug and it's fixed in latest.
So please change your dependencies file, upgrade paket and try again.

Member

forki commented Mar 17, 2016

Your deps file should look like this:

framework: native, net452

source https://www.nuget.org/api/v2
nuget boost_filesystem-vc140
nuget boost_system-vc140

you need to specify both native and net452 since otherwise the resolver would not check all dependencies.

That said there was still a bug and it's fixed in latest.
So please change your dependencies file, upgrade paket and try again.

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 17, 2016

Thanks for the fix!

I found another problem after add native to framework.

For some .net package, before adding native, the choose item is like this:

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
      <ItemGroup>
        <Reference Include="nunit.framework">
          <HintPath>..\packages\NUnit\lib\nunit.framework.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

After I added native to framework, it looks like this:

  <Choose>
    <When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2') Or (true) Or ('$(Configuration)|$(Platform)'=='Debug|Win32') Or ('$(Configuration)|$(Platform)'=='Debug|arm') Or ('$(Configuration)|$(Platform)'=='Debug|x64') Or ('$(Configuration)|$(Platform)'=='Release|Win32') Or ('$(Configuration)|$(Platform)'=='Release|x64') Or ('$(Configuration)|$(Platform)'=='Release|arm')">
      <ItemGroup>
        <Reference Include="nunit.framework">
          <HintPath>..\packages\NUnit\lib\nunit.framework.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

Seems that the condition is always true since there is (true) inside the condition.

Could you help look at this issue again?

Here is the project for testing.
TestPaket.zip

acmore commented Mar 17, 2016

Thanks for the fix!

I found another problem after add native to framework.

For some .net package, before adding native, the choose item is like this:

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2'">
      <ItemGroup>
        <Reference Include="nunit.framework">
          <HintPath>..\packages\NUnit\lib\nunit.framework.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

After I added native to framework, it looks like this:

  <Choose>
    <When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2') Or (true) Or ('$(Configuration)|$(Platform)'=='Debug|Win32') Or ('$(Configuration)|$(Platform)'=='Debug|arm') Or ('$(Configuration)|$(Platform)'=='Debug|x64') Or ('$(Configuration)|$(Platform)'=='Release|Win32') Or ('$(Configuration)|$(Platform)'=='Release|x64') Or ('$(Configuration)|$(Platform)'=='Release|arm')">
      <ItemGroup>
        <Reference Include="nunit.framework">
          <HintPath>..\packages\NUnit\lib\nunit.framework.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

Seems that the condition is always true since there is (true) inside the condition.

Could you help look at this issue again?

Here is the project for testing.
TestPaket.zip

@forki forki reopened this Mar 17, 2016

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 17, 2016

Member

yes that true thingy is a bug.

But one question: do you expect nunit.framework.dll to be installed for native?

Member

forki commented Mar 17, 2016

yes that true thingy is a bug.

But one question: do you expect nunit.framework.dll to be installed for native?

forki added a commit that referenced this issue Mar 17, 2016

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 17, 2016

Member

ok that true thingy is gone.

Member

forki commented Mar 17, 2016

ok that true thingy is gone.

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 17, 2016

@forki We dont expect nunit.framework.dll to be installed for native. The previous example is for a c# project.

acmore commented Mar 17, 2016

@forki We dont expect nunit.framework.dll to be installed for native. The previous example is for a c# project.

forki added a commit that referenced this issue Mar 17, 2016

forki added a commit that referenced this issue Mar 17, 2016

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 17, 2016

@forki thanks for your fix!

acmore commented Mar 17, 2016

@forki thanks for your fix!

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 17, 2016

Member

Is it already enough to make it work for you?
On Mar 17, 2016 10:08 PM, "acmore" notifications@github.com wrote:

@forki https://github.com/forki thanks for your fix!


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

Member

forki commented Mar 17, 2016

Is it already enough to make it work for you?
On Mar 17, 2016 10:08 PM, "acmore" notifications@github.com wrote:

@forki https://github.com/forki thanks for your fix!


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

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 17, 2016

I think so. So it will work for both native and .net packages?

acmore commented Mar 17, 2016

I think so. So it will work for both native and .net packages?

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 17, 2016

Member

Just let me know if you find other issues. I want to make it work with
native.
On Mar 17, 2016 10:52 PM, "acmore" notifications@github.com wrote:

I think so. So it will work for both native and .net packages?


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

Member

forki commented Mar 17, 2016

Just let me know if you find other issues. I want to make it work with
native.
On Mar 17, 2016 10:52 PM, "acmore" notifications@github.com wrote:

I think so. So it will work for both native and .net packages?


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

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 18, 2016

@forki I am not sure why it will add Or ('$(Configuration)|$(Platform)'=='Debug|Win32') Or ('$(Configuration)|$(Platform)'=='Debug|arm') Or ('$(Configuration)|$(Platform)'=='Debug|x64') Or ('$(Configuration)|$(Platform)'=='Release|Win32') Or ('$(Configuration)|$(Platform)'=='Release|x64') Or ('$(Configuration)|$(Platform)'=='Release|arm')" to a .net framework?

  <Choose>
    <When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2') Or ('$(Configuration)|$(Platform)'=='Debug|Win32') Or ('$(Configuration)|$(Platform)'=='Debug|arm') Or ('$(Configuration)|$(Platform)'=='Debug|x64') Or ('$(Configuration)|$(Platform)'=='Release|Win32') Or ('$(Configuration)|$(Platform)'=='Release|x64') Or ('$(Configuration)|$(Platform)'=='Release|arm')">
      <ItemGroup>
        <Reference Include="nunit.framework">
          <HintPath>..\packages\NUnit\lib\nunit.framework.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

acmore commented Mar 18, 2016

@forki I am not sure why it will add Or ('$(Configuration)|$(Platform)'=='Debug|Win32') Or ('$(Configuration)|$(Platform)'=='Debug|arm') Or ('$(Configuration)|$(Platform)'=='Debug|x64') Or ('$(Configuration)|$(Platform)'=='Release|Win32') Or ('$(Configuration)|$(Platform)'=='Release|x64') Or ('$(Configuration)|$(Platform)'=='Release|arm')" to a .net framework?

  <Choose>
    <When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5.2') Or ('$(Configuration)|$(Platform)'=='Debug|Win32') Or ('$(Configuration)|$(Platform)'=='Debug|arm') Or ('$(Configuration)|$(Platform)'=='Debug|x64') Or ('$(Configuration)|$(Platform)'=='Release|Win32') Or ('$(Configuration)|$(Platform)'=='Release|x64') Or ('$(Configuration)|$(Platform)'=='Release|arm')">
      <ItemGroup>
        <Reference Include="nunit.framework">
          <HintPath>..\packages\NUnit\lib\nunit.framework.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 18, 2016

Member

Yeah that's not really correct. Needs some work...
On Mar 18, 2016 17:55, "acmore" notifications@github.com wrote:

@forki https://github.com/forki I am not sure why it will add Or
('$(Configuration)|$(Platform)'=='Debug|Win32') Or
('$(Configuration)|$(Platform)'=='Debug|arm') Or
('$(Configuration)|$(Platform)'=='Debug|x64') Or
('$(Configuration)|$(Platform)'=='Release|Win32') Or
('$(Configuration)|$(Platform)'=='Release|x64') Or
('$(Configuration)|$(Platform)'=='Release|arm')" to a .net framework?

..\packages\NUnit\lib\nunit.framework.dll True True


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

Member

forki commented Mar 18, 2016

Yeah that's not really correct. Needs some work...
On Mar 18, 2016 17:55, "acmore" notifications@github.com wrote:

@forki https://github.com/forki I am not sure why it will add Or
('$(Configuration)|$(Platform)'=='Debug|Win32') Or
('$(Configuration)|$(Platform)'=='Debug|arm') Or
('$(Configuration)|$(Platform)'=='Debug|x64') Or
('$(Configuration)|$(Platform)'=='Release|Win32') Or
('$(Configuration)|$(Platform)'=='Release|x64') Or
('$(Configuration)|$(Platform)'=='Release|arm')" to a .net framework?

..\packages\NUnit\lib\nunit.framework.dll True True


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

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 18, 2016

Hmm, are you going to fix it?

acmore commented Mar 18, 2016

Hmm, are you going to fix it?

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 18, 2016

Member

Sure, but is it currently breaking you?
On Mar 18, 2016 18:00, "acmore" notifications@github.com wrote:

Hmm, are you going to fix it?


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

Member

forki commented Mar 18, 2016

Sure, but is it currently breaking you?
On Mar 18, 2016 18:00, "acmore" notifications@github.com wrote:

Hmm, are you going to fix it?


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

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 18, 2016

Member

I already had a fix, but that made trouble elsewhere so I reverted that.
On Mar 18, 2016 18:02, sforkmann@gmail.com wrote:

Sure, but is it currently breaking you?
On Mar 18, 2016 18:00, "acmore" notifications@github.com wrote:

Hmm, are you going to fix it?


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#1523 (comment)

Member

forki commented Mar 18, 2016

I already had a fix, but that made trouble elsewhere so I reverted that.
On Mar 18, 2016 18:02, sforkmann@gmail.com wrote:

Sure, but is it currently breaking you?
On Mar 18, 2016 18:00, "acmore" notifications@github.com wrote:

Hmm, are you going to fix it?


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#1523 (comment)

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 18, 2016

it's not breaking me though. We have a lot of projects, so we don't want to change a lot, lol

acmore commented Mar 18, 2016

it's not breaking me though. We have a lot of projects, so we don't want to change a lot, lol

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 18, 2016

Member

Ah I now understand what you mean. It's the diff in existing projects
that's worrying you.

I think I will revisit this over the weekend...
On Mar 18, 2016 18:08, "acmore" notifications@github.com wrote:

it's not breaking me though. We have a lot of projects, so we don't want
to change a lot, lol


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

Member

forki commented Mar 18, 2016

Ah I now understand what you mean. It's the diff in existing projects
that's worrying you.

I think I will revisit this over the weekend...
On Mar 18, 2016 18:08, "acmore" notifications@github.com wrote:

it's not breaking me though. We have a lot of projects, so we don't want
to change a lot, lol


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

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 18, 2016

Thanks a lot:)

acmore commented Mar 18, 2016

Thanks a lot:)

@forki forki closed this in 569abf6 Mar 19, 2016

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 19, 2016

Member

done. please give it a try

Member

forki commented Mar 19, 2016

done. please give it a try

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 21, 2016

Hi @forki, seems that this version will remove the boost dependency again. The test project I attached works well, but not in our production projects. Could you help to take a look?

acmore commented Mar 21, 2016

Hi @forki, seems that this version will remove the boost dependency again. The test project I attached works well, but not in our production projects. Could you help to take a look?

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 21, 2016

Member

mhm integration tests are still green.
can you spot a difference?

Member

forki commented Mar 21, 2016

mhm integration tests are still green.
can you spot a difference?

@acmore

This comment has been minimized.

Show comment
Hide comment
@acmore

acmore Mar 22, 2016

Thanks @forki , it should be fine now.

acmore commented Mar 22, 2016

Thanks @forki , it should be fine now.

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 22, 2016

Member

?

Member

forki commented Mar 22, 2016

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment