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 525 forks source link

Paket Pack builds bad pakage when specifying relative target path external to package directory. #1472

Closed galaxystar closed 8 years ago

galaxystar commented 8 years ago

Paket 2.50.6.0, 3.0.0.40-alpha. Running on Mac.

When I use a target path that is external (and non absolute) to a directory outside of the /packages/group/ directory it results in duplicate files, where the duplicate files are at the wrong path.

I'm using relative paths because I want the install/update for some of my packages to be deployed somewhere other than the packages directory. I know it's an atypical approach but it should still be an approach that is supported.

When I list the files in the package using unzip -l mypackage.1.0.3.nupkg:

Archive:  mypackage.1.0.3.nupkg
  Length     Date   Time    Name
 --------    ----   ----    ----
    16545  02-12-16 17:26   ../../../Assets/Packages/mypackage/Editor/Users/buildcomputer/jenkins/nodes/unitySlave/workspace/<jenkins_job>/Assets/file1.cs   (WRONG!!!)
      262  02-12-16 17:26   ../../../Assets/Packages/mypackage/Editor/Users/buildcomputer/jenkins/nodes/unitySlave/workspace/<jenkins_job>/Assets/file1.cs.meta  (WRONG!!!)
    16545  02-12-16 17:26   ../../../Assets/Packages/mypackage/Editor/file1.cs   (CORRECT)
      262  02-12-16 17:26   ../../../Assets/Packages/mypackage/Editor/file1.cs.meta    (CORRECT)
      533  02-12-16 17:26   mypackage.nuspec
      669  02-12-16 17:26   package/services/metadata/core-properties/coreProp.psmdcp
      489  02-12-16 17:26   _rels/.rels
      541  02-12-16 17:26   [Content_Types].xml
 --------                   -------

A couple things to note:

  1. There are duplicates (file1.cs and file1.cs.meta) show up twice in two different paths. The wrong paths have been denoted above with (WRONG!!!!).
  2. The wrong files seem to contain a near absolute path, but does not actually contain the full path either. Namely, it's missing the "Editor" folder.

My project.template file

type file
copyright My Company 2016
id mypackage
version 1.0.3
authors 
    me
projectUrl 
    http://mypackage.com
description
    my description
files
    Assets/Editor/** ==> ../../../Assets/Packages/mypackage/Editor/
forki commented 8 years ago

I can't really reproduce, but please try latest version. I changed something that might be related

flowsprenger commented 8 years ago

globbing from 2.50.7 seems to be somewhat broken:

this is a reproducible case: https://gist.github.com/flowsprenger/8280a7f0f2cf5f64b8b1

it probably does not cover all cases, i see the paket.template being packaged too in the project i am currently working on, but i don't have a simple reproducible case as of now

forki commented 8 years ago

We changed pack in 2.50.9 - can you please try with that version?

flowsprenger commented 8 years ago

I did, the output is from 2.50.9. 2.50.6 is the last that works fine.

forki commented 8 years ago

so I revert 3fcac1d and await a repro from @galaxystar!?

flowsprenger commented 8 years ago

Sounds reasonable to me. Alternatively I can pin Paket's version again, seems we need a mechanism to do this over all our repos anyway.

forki commented 8 years ago

@flowsprenger please try latest

flowsprenger commented 8 years ago

@forki works again :)

forki commented 8 years ago

Would be great if you could contribute your repro as an integration test so that we don't break it again On Feb 15, 2016 12:00 PM, "Florian Sprenger" notifications@github.com wrote:

@forki https://github.com/forki works again :)

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/1472#issuecomment-184166739.

flowsprenger commented 8 years ago

@galaxystar since you seem to use unity, maybe its worth having a look at https://github.com/wooga/Paket.Unity3D/ which allows to install using paket.unity3.exe and paket.unity3d.reference files.

@forki alright, shall have a look at how to do that

forki commented 8 years ago

thx would be of great help

galaxystar commented 8 years ago

@forki I just tried 2.50.10 with the same (wrong) results. I have a temp work around (using zip -d to remove the files with the erroneous directory). It's not ideal, but it works in the short term for this special case.

@flowsprenger I looked into Paket.Unity3D. It seems to be abandoned. No forks, no changes in 6 months, 5 issues, most of which were unaddressed and their mono build seems to be failing. I'd prefer to stick with vanilla Paket as it seems to do everything I need it to and gives me the flexibility to swap packages in/out as I see fit (such as when switching platforms).

forki commented 8 years ago

I'm not near a pc for 2 weeks but if you can come up with a repro I'll try to address when I'm back. On Feb 16, 2016 23:22, "galaxystar" notifications@github.com wrote:

@forki https://github.com/forki I just tried 2.50.10 with the same (wrong) results. I have a temp work around (using zip -d to remove the files with the erroneous directory). It's not ideal, but it works in the short term for this special case.

@flowsprenger https://github.com/flowsprenger I looked into Paket.Unity3D. It seems to be abandoned. No forks, no changes in 6 months, 5 issues, most of which were unaddressed and their mono build seems to be failing. I'd prefer to stick with vanilla Paket as it seems to do everything I need it to and gives me the flexibility to swap packages in/out as I see fit (such as when switching platforms).

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/1472#issuecomment-184899027.

galaxystar commented 8 years ago

I just tried with 2.50.10 and it worked locally, but gave me problems on my build machine. I then went through the full installation process for Mac (downloaded repository and installed using the install script) and it worked correctly. I must have had some frankenstein installation through my manual installation process. Thanks for all the help, I really appreciate it!