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

paket.reference to recognizing github packages in paket.lock file #3064

Open
gdennie opened this issue Feb 22, 2018 · 10 comments
Open

paket.reference to recognizing github packages in paket.lock file #3064

gdennie opened this issue Feb 22, 2018 · 10 comments

Comments

@gdennie
Copy link
Contributor

gdennie commented Feb 22, 2018

Description

The paket.dependencies file is:

source https://www.nuget.org/api/v2

github fsprojects/Argu

Repro steps

  1. Create a F# Windows console application using VS 2015/17 Community Edition (OS: Windows 2008 R2)
  2. Perform paket init
  3. Create paket.dependencies file with the following contents:
source https://www.nuget.org/api/v2

github fsprojects/Argu
  1. Create paket.references file in project with contents:
    Argu
  2. Perform paket update (or paket install) from VS menu or commandline

Expected behavior

Argu would now exist as a reference within the project containing the aforementioned paket.reference file.

Actual behavior

The following error message is display (and is not completely represented in VS Error List when install or update is performed from VS' paket menu):

Paket failed with
-> Installation Errors :
    - <...full path to project...>\paket.references uses NuGet package Argu, but it was not found in the paket.lock file in group Main.

Known workarounds

clone the projects and manually link them into your solutions...ignoring paket.

@panesofglass
Copy link
Contributor

I think this is related to the GitHub changes. Even after working around the paket download issue, my builds were still breaking on AppVeyor with an error that the file was not found. At least, I think this is related. If not, I'm happy to open a new issue.

@forki
Copy link
Member

forki commented Feb 24, 2018

@panesofglass with the new bootstrapper?

@panesofglass
Copy link
Contributor

@forki yes.

@forki
Copy link
Member

forki commented Feb 27, 2018

@gdennie I looked at this. What makes you think this would work? you are referencing a github project - not a nuget package. Is this a feature request?

@gdennie
Copy link
Contributor Author

gdennie commented Feb 27, 2018

@forki I reviewed the documentation again, GitHub dependencies. At the time I somehow thought that paket allowed the import of github hosted libraries similar to how it treated nuget. Upon review, that is not the case. The documentation in this area could use some work.

Thanks for your attention.
George.

@forki
Copy link
Member

forki commented Feb 28, 2018

Did you look at https://fsprojects.github.io/Paket/git-dependencies.html#Using-Git-repositories-as-NuGet-source - with git dependencies you can let paket build the nupkgs for you.

Also please send improvements to the docs that clarify the problem

@gdennie
Copy link
Contributor Author

gdennie commented Mar 1, 2018

Either I did not notice that or did not recognize it as the defacto solution that it is. The fact that github packages must be built is an obvious but understated distinction from nuget that could use a bit more fanfare.

If time permits, I'll see what I can improve in the documentation.

Thanks again.

@dustinlacewell
Copy link

Hi. I'm fairly new to .NET Core tooling in general and I'm confused about the above discussion. Can someone clarify what the intended use-case is for including git repositories within the paket.dependencies file, if not to somehow reference it in the paket.references file?

Do I need to go through the process of making a NuGet package out of my project before it can be used as a dependency managed by paket? Thanks for any insights!

@njlr
Copy link

njlr commented Jul 27, 2020

Hi. I'm fairly new to .NET Core tooling in general and I'm confused about the above discussion. Can someone clarify what the intended use-case is for including git repositories within the paket.dependencies file, if not to somehow reference it in the paket.references file?

Do I need to go through the process of making a NuGet package out of my project before it can be used as a dependency managed by paket? Thanks for any insights!

I am not a Paket expert, but my understanding is that the Paket GitHub dependencies can only be a single file that is fetched from GitHub. So, if your library is just one .fs file then you do not need to go via NuGet, but if it is more complex than that then you will need to publish.

See the instructions here for how to reference a single file from GitHub using Paket: https://github.com/xyncro/aether#installation

Another option is to use GitHub packages, which might be more convenient for you since you are already using GitHub.

I opened this issue about referencing whole GitHub projects.

@shukriadams
Copy link

The use case here is that Paket would allow DotNet to be used in the same way that NPM empowered NodeJS - we can create a complex ecosystem of interrelated packages that exist as source code only, and which are built at import time, instead of per package. This is one of NPM's greatest strengths - it makes code reuse at the package level trivial.

hesxenon added a commit to hesxenon/Paket that referenced this issue Dec 31, 2022
with fsprojects#3756 and fsprojects#3064 it is quite clear, that the documentation around adding git repositories as a (usable) dependency isn't all that clear. Which is a pity, because the actual process isn't all that hard and also quite sensible-ish.

This change aims to slightly improve the docs and shed some light on this topic because - basically - all that is missing is some basic knowledge about how namespace/package resolution works in fsharp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants