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

Ignore _._ content files #193

Closed
agross opened this issue Sep 29, 2014 · 32 comments
Closed

Ignore _._ content files #193

agross opened this issue Sep 29, 2014 · 32 comments

Comments

@agross
Copy link
Contributor

agross commented Sep 29, 2014

Microsoft.Bcl has several content subfolders containing nothing but _._ files. NuGet seems to ignore these files when Install-Packageing them in VS.

(I couldn't find any documentation about these file names online, perhaps this is undocumented but supported behavior.)

@forki
Copy link
Member

forki commented Sep 29, 2014

related to #192 we need some kind of blacklisting

/cc @theimowski ideas?

@theimowski
Copy link
Member

guess the blacklist etc is included in the powershell scripts.. not sure, maybe something similiar to --interactive?

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

There's no install.ps1 nor anything special in the nuspec.

@forki
Copy link
Member

forki commented Sep 29, 2014

so it's magic in nuget.exe?

cool let's do the same magic

@theimowski
Copy link
Member

IIRC the . files were completely empty, probably a blacklist for 0-byte-files wouldn't be that bad?

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

Seems like magic to me :-) Actually, it's not that funny to think about it. It's one thing to have magic in a tool (NuGet), but questionable to not document it.

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

Let me see if NuGet handles 0-byte content files this way or just the _._ files. BRB

@forki
Copy link
Member

forki commented Sep 29, 2014

it's open source! open source needs no docs.

2014-09-29 17:28 GMT+02:00 Alexander Groß notifications@github.com:

Seems like magic to me :-) Actually, it's not that funny to think about
it. It's one thing to have magic in a tool (NuGet), but questionable to not
document it.


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

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

These content files are black magic actually. Can't find a way to have them added by NuGet/VS, 0-bytes or not.

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

OK, seems you cannot just mess with the nupkg. You need to create a new nupkg from a valid nuspec.

Here's what I've found: Only _._ is ignored, an empty .cs file gets added, even if it sits next to a _._.

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

_._ is ignored regardless of its size.

@forki
Copy link
Member

forki commented Sep 29, 2014

ok I wonder what these files do?

@forki
Copy link
Member

forki commented Sep 29, 2014

thinking

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

// Starting from nuget 2.0, we use a file with the special name '.' to represent an empty folder.
internal const string PackageEmptyFileName = ".";

(GH markdown swallows it underscores)

https://nuget.codeplex.com/SourceControl/latest#src/Core/Packages/Constants.cs

@ctaggart
Copy link
Contributor

I ran into this as well with Microsoft.Bcl.
image

empty directories for all :/
image

And then my .fsproj contains all this stuff I don't want:

  <ItemGroup>
    <Content Include="SqlServerTypes\Loader.cs">
      <Paket>True</Paket>
    </Content>
    <Content Include="SqlServerTypes\readme.htm">
      <Paket>True</Paket>
    </Content>
    <Content Include="monoandroid\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="monotouch\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="net45\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="portable-net45+win8+wp8+wpa81\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="portable-net45+win8+wpa81\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="portable-net451+win81\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="portable-net451+win81+wpa81\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="portable-win81+wp81+wpa81\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="sl4\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="sl5\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="win8\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="wp8\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="wpa81\_._">
      <Paket>True</Paket>
    </Content>
    <Content Include="web.config.transform">
      <Paket>True</Paket>
    </Content>
  </ItemGroup>

Loader.cs is from Microsoft.SqlServer.Types. The web.config.transform is from Microsoft.AspNet.WebAp.Core. In all cases, I don't want any of the content files.

@ctaggart
Copy link
Contributor

The first and most relevant link I found for nuget _._ is Support creating empty folders from .nuspec.

@forki
Copy link
Member

forki commented Sep 29, 2014

yes. we need to do this.

2014-09-29 21:55 GMT+02:00 Cameron Taggart notifications@github.com:

The first and most relevant link I found for nuget . is Support
creating empty folders from .nuspec
https://nuget.codeplex.com/workitem/2507.


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

@ctaggart
Copy link
Contributor

What are the use cases where adding content files automatically to the project is a good idea? I don't want any of them showing up in my projects automatically. With paket 0.4.9, they get added every time I do a paket install. :(

@forki
Copy link
Member

forki commented Sep 29, 2014

Asp.net related packages like jquery use this technique.

@ctaggart
Copy link
Contributor

I've never liked and choose not to use NuGet package manager for JavaScript files. It isn't flexible enough for custom install locations. UI devs often prefer using a different packages manager. GitHub dependencies may work better here as well.

I'd like to see content files not automatically added by default.

@forki
Copy link
Member

forki commented Sep 29, 2014

I'm pretty sure @agross agrees. ;-

I see two options:

  1. don't add content files at all
  2. find a strategy to opt out

I think 1) will kill adoption.

Any ideas for 2)?
On Sep 29, 2014 11:18 PM, "Cameron Taggart" notifications@github.com
wrote:

I've never liked and choose not to use NuGet package manager for
JavaScript files. It isn't flexible enough for custom install locations. UI
devs often prefer using a different packages manager. GitHub dependencies
http://fsprojects.github.io/Paket/github-dependencies.html may work
better here as well.

I'd like to see content files not automatically added by default.


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

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

We could use a global switch like we did with strict mode.

Alex

Alexander Groß
Tiny phone, tiny mail

On Mon, Sep 29, 2014 at 11:21 PM, Steffen Forkmann
notifications@github.com wrote:

I'm pretty sure @agross agrees. ;-
I see two options:

  1. don't add content files at all
  2. find a strategy to opt out
    I think 1) will kill adoption.
    Any ideas for 2)?
    On Sep 29, 2014 11:18 PM, "Cameron Taggart" notifications@github.com
    wrote:

I've never liked and choose not to use NuGet package manager for
JavaScript files. It isn't flexible enough for custom install locations. UI
devs often prefer using a different packages manager. GitHub dependencies
http://fsprojects.github.io/Paket/github-dependencies.html may work
better here as well.

I'd like to see content files not automatically added by default.


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


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

@ctaggart
Copy link
Contributor

OK. So like strict mode, with references strict in a paket.references file, may be add a content none option.

@agross
Copy link
Contributor Author

agross commented Sep 29, 2014

👍

@forki
Copy link
Member

forki commented Sep 29, 2014

I have nostrong opinion on this yet, that's why I have to ask: are you sure
you want this on solution level?

2014-09-29 23:40 GMT+02:00 Cameron Taggart notifications@github.com:

OK. So like strict mode
http://fsprojects.github.io/Paket/nuget-dependencies.html#Strict-references,
with references strict in a paket.references file, may be add a content
none option.


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

@ctaggart
Copy link
Contributor

Yes, I think it makes sense at the solution level. It feels right for references strict and content none to be at the same level.

@forki
Copy link
Member

forki commented Sep 29, 2014

ok let's do this.

@forki
Copy link
Member

forki commented Sep 29, 2014

#199 is for the content none issue.

This one is for blacklisting . files since the are ignored by nuget. Also up-for-grabs

@thinkbeforecoding
Copy link
Contributor

And could this be something like a .gitignore ? By giving glob path of content files to avoid to import ?

@forki
Copy link
Member

forki commented Sep 30, 2014

Yes that's what we figured. They try to selectively add a reference. If
the framework already supports the stuff they want to omit the reference.
On Sep 30, 2014 2:29 PM, "Jérémie Chassaing" notifications@github.com
wrote:

And could this be something like a .gitignore ? By giving glob path of
content files to avoid to import ?


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

@thinkbeforecoding
Copy link
Contributor

But more globally, it could be interesting to opt out from any content file by specifying glob path....

@forki
Copy link
Member

forki commented Sep 30, 2014

ahh you are referring to #199 - moved the comment there.

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

No branches or pull requests

5 participants