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

Cannot setup mixed framework correctly #1523

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

Cannot setup mixed framework correctly #1523

acmore opened this issue Mar 17, 2016 · 22 comments
Labels

Comments

@acmore
Copy link

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 as completed in 1f98a40 Mar 17, 2016
@forki
Copy link
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
Copy link
Author

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
Copy link
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
Copy link
Member

forki commented Mar 17, 2016

ok that true thingy is gone.

@acmore
Copy link
Author

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
Copy link
Author

acmore commented Mar 17, 2016

@forki thanks for your fix!

@forki
Copy link
Member

forki commented Mar 17, 2016

Is it already enough to make it work for you?
On Mar 17, 2016 10:08 PM, "acmore" [email protected] 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
Copy link
Author

acmore commented Mar 17, 2016

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

@forki
Copy link
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" [email protected] 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
Copy link
Author

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
Copy link
Member

forki commented Mar 18, 2016

Yeah that's not really correct. Needs some work...
On Mar 18, 2016 17:55, "acmore" [email protected] 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
Copy link
Author

acmore commented Mar 18, 2016

Hmm, are you going to fix it?

@forki
Copy link
Member

forki commented Mar 18, 2016

Sure, but is it currently breaking you?
On Mar 18, 2016 18:00, "acmore" [email protected] 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
Copy link
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, [email protected] wrote:

Sure, but is it currently breaking you?
On Mar 18, 2016 18:00, "acmore" [email protected] 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
Copy link
Author

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
Copy link
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" [email protected] 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
Copy link
Author

acmore commented Mar 18, 2016

Thanks a lot:)

@forki forki closed this as completed in 569abf6 Mar 19, 2016
@forki
Copy link
Member

forki commented Mar 19, 2016

done. please give it a try

@acmore
Copy link
Author

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
Copy link
Member

forki commented Mar 21, 2016

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

@acmore
Copy link
Author

acmore commented Mar 22, 2016

Thanks @forki , it should be fine now.

@forki
Copy link
Member

forki commented Mar 22, 2016

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants