fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 520 forks source link

paket changes line endings and overrides FodyWeavers.xml using Costura.Fody #1427

Closed punker76 closed 6 years ago

punker76 commented 8 years ago

Found hopefully a small issue using paket with Fody and Costura.Fody.

paket update always overrides my FodyWeavers.xml

<?xml version="1.0" encoding="utf-8"?>
<Weavers>
  <Costura>
  </Costura>
</Weavers>

after updating the Costura tag is removed and the project doesn't compile.

also the line endings are changed hard to LF for

I'm using the paket version 2.47.1.0

forki commented 8 years ago

http://fsprojects.github.io/Paket/nuget-dependencies.html#No-content-option

did you try content:once ?

should be working in paket.references as well (will update docs)

forki commented 8 years ago

http://fsprojects.github.io/Paket/references-files.html#No-content-option done

punker76 commented 8 years ago

@forki Thanks, just tested it out, works only if I do this in the paket.dependencies file, it has no effect with the paket.references.

source https://www.nuget.org/api/v2/
framework >= net45

nuget Costura.Fody ~> 1.3.3.0 content: once
forki commented 8 years ago

Are you sure? Mhm will check later

forki commented 8 years ago

mhm integration tests in d9aab5d suggest in works from the ref file as well

punker76 commented 8 years ago

@forki Just make a retest with 2.47.2.0 and all works fine now, maybe I'm doing some wrong stuff...

wallymathieu commented 8 years ago

It looks like these tests broke when I submitted a pull request. I'm starting to look into porting the tests to avoid using xml transformation files by adding a test package (https://github.com/wallymathieu/Paket.TestPackage.Foody). The branch I'm working on is the following: https://github.com/wallymathieu/Paket/tree/1427_tests

derwasp commented 8 years ago

@forki @punker76 can you please reopen this? since the issue is still there

forki commented 8 years ago

@derwasp can you please give us a repro?

derwasp commented 8 years ago

@forki I just tried one more time with cleaned everything and it didn't happen. I swear it was not the first time I tried that. My apologies that it looks like my repo wasn't clean or something.

However, Fody also adds an import to .*proj file:

<Import Project="..\..\packages\Fody\build\$(__paket__Fody_targets).targets" Condition="Exists('..\..\packages\Fody\build\$(__paket__Fody_targets).targets')" Label="Paket" />

Which I modified to be triggered only in Release

  <Import Project="..\..\packages\Fody\build\$(__paket__Fody_targets).targets" Condition="Exists('..\..\packages\Fody\build\$(__paket__Fody_targets).targets') And '$(Configuration)' == 'Release'" Label="Paket" />

And this gets overwritten each time. Can you please tell me whether it is the same issue?

derwasp commented 8 years ago

For the next person like me: when you are putting content: once for the package, check whether this package is the actual package which adds the content. In this case: Fody.Costura depends on Fody. And Fody adds the content. If your paket.dependencies is not "simplified", then you will have both packages referenced there if you've migrated this from NuGet (like I did). And if you will add content: once for the Fody.Costura package, it will not help you. You should add this line to the package causing the issue. Or "simplify" the dependencies.

P.S. the issue with the import stays there ;)

forki commented 8 years ago

are you using content;once? can you provide a repro sample?

derwasp commented 8 years ago

Please try this:

git clone https://github.com/derwasp/Paket.Repro.git
cd Paket.Repro
paket install
git status

If you see a changed file after git status, then it reproduced.

derwasp commented 8 years ago

As for content:once, you can see here that it is set. Am I missing something?

punker76 commented 8 years ago

I have this line in paket.references and have no issues with it

Costura.Fody content: once

On 22 Jul 2016 8:07 p.m., "Denys Zhuravel" notifications@github.com wrote:

As for content:once, you can see here https://github.com/derwasp/Paket.Repro/blob/master/paket.dependencies#L4 that it is set. Am I missing something?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket/issues/1427#issuecomment-234614827, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoL_x3K9Hu9Cd0Q2LkCPujypVWmB8Caks5qYQbegaJpZM4HK_uB .

SimonCropp commented 6 years ago

moving forward fody will no longer be in control of the fodyweavers.xml. as such this issue is redundant