buckaroo icon indicating copy to clipboard operation
buckaroo copied to clipboard

adhoc git dependencies over *http* not working

Open nikhedonia opened this issue 6 years ago • 9 comments

works fine via ssh

nikhedonia avatar Feb 26 '19 21:02 nikhedonia

Recently tried this and struggling to get any dependencies not on the default github.com, bitbucket or gitlab extension to work. It doesent help that there doesent seem to be many examples online about pulling dependencies from hosted git and HTTP so the syntax is somewhat unclear so may be my fault but : buckaroo add github.com/buckaroo-pm/boost-thread@branch=master this doesent work if i change the url to a self hosted git repo, infact I get various syntax errors by changing from github.com to my own hosted url buckaroo add myservices.com/myrepo/examplepackage@branch=master the error i get is : Expecting: end of input, whitespace, '--verbose' or '@' in reference to the part "myrepo/examplepackage"

DeanHnter avatar Mar 02 '19 18:03 DeanHnter

Yes at the moment it is not documented and not available via the cli. You can explicitly define an adhoc dependency by editing the manifest:

[[location]]
name = "owner/project"
git = "git@url/to/git/repo.git"

[[dependency]]
package = "owner/project"
version = "branch=master"

Direct git dependencies are slower to resolve as we need to fetch commits before we can read the manifest. Github/Gitlab/Bitbucket have seperate apis to fetch files for a given commit.

nikhedonia avatar Mar 02 '19 20:03 nikhedonia

Issue for supporting this in the CLI: https://github.com/LoopPerfect/buckaroo/issues/328

njlr avatar Mar 02 '19 20:03 njlr

Would add the the reason we don't use the Git URL as the name is:

  1. This is not possible for HTTP, since we have n URLs per version
  2. It makes it clear how to specify alternative URLs (e.g. for Git SSH)
  3. It enables the URL to be changed without editing all of the downstream manifests
  4. It provides something more intentful (is that a word?!) to use in build scripts

However, this is up for discussion! :slightly_smiling_face:

njlr avatar Mar 02 '19 21:03 njlr

This is actually very understandable and helpful, thanks for the responses :) @njlr @nikhedonia , the only concern id raise is that maybe it should be in the documentation outlining usage as its a fairly common use-case to have repo's not on github etc particularly for private companies and may be a decisive factor in choosing a package manager for a cpp project for some people. If you think its worthwhile, I also I dont mind doing it but seems important that if its already available even not via the CLI its worth including a section on just to prevent people moving to other package manager when they otherwise wouldnt. Thanks again for the helpful responses :+1:

DeanHnter avatar Mar 03 '19 15:03 DeanHnter

Wiki page added here: https://github.com/LoopPerfect/buckaroo/wiki/Ad-hoc-Dependencies

njlr avatar Mar 04 '19 12:03 njlr

Thanks for the update, Much clearer now! I tried to follow those steps but when I add [[location]] in my buckaroo.toml I get parsing errors:

System.Exception: Could not read project manifest. Are you sure you are in the right directory? ---> System.Exception: Error parsing manifest: Unexpected type table at [email protected](String _arg1) in /home/travis/build/LoopPerfect/buckaroo/buckaroo/Tasks.fs:line 74 at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation1 ctxt, FSharpFunc2 userCode, b result1) at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc2 firstAction) --- End of inner exception stack trace --- at Buckaroo.Tasks.catchHandler@1-4(Exception _arg2) in /home/travis/build/LoopPerfect/buckaroo/buckaroo/Tasks.fs:line 77 at [email protected](Exception edi) in /home/travis/build/LoopPerfect/buckaroo/buckaroo/Tasks.fs:line 68 at Microsoft.FSharp.Control.AsyncPrimitives.CallFilterThenInvoke[T](AsyncActivation1 ctxt, FSharpFunc2 catchFilter, ExceptionDispatchInfo edi) at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc2 firstAction)

Is this regular or am I doing something incorrect?

The buckaroo.toml looks like this:

[[location]]
name = "d2191/Catch"
git = "git@localhost:d2191/Catch.git"

[[dependency]]
package = "d2191/Catch"
version = "branch=master"

DeanHnter avatar Mar 09 '19 09:03 DeanHnter

Should be:

[[location]]
package = "d2191/Catch" # <---------------- Here
git = "git@localhost:d2191/Catch.git"

[[dependency]]
package = "d2191/Catch"
version = "branch=master"

My mistake for copy-pasting without checking.

njlr avatar Mar 09 '19 13:03 njlr

I get this issue when trying to pull in repos from a private git that uses a custom port:

[git] info Fetching refs from ssh://[email protected]:1234/buckaroo/protobuf.git
[git] success Fetched 1 refs in 1.204
[solver] warning Unresolvable: protocolbuffers/protobuf@branch=master

Toml file looks like this:

[[location]]
package = "protocolbuffers/protobuf"
git = "ssh://[email protected]:1234/buckaroo/protobuf.git"

[[dependency]]
package = "protocolbuffers/protobuf"
version = "branch=master"

(Also as a side node, I had to fork protobuf because protoc from the supplied repos was crashing unless i changed compilation to cpp11 as protobuf does it in cmake)

Edit: Nevermind, its not because of the gitlab repo its because i have more than 1 ad-hoc dependency in my project it seems. Depending on how I order them in the toml file one of the dependencies cannot be resolved (which changes if i shuffle dependencies around in the toml file)... quite interesting...

ko1N avatar May 30 '19 15:05 ko1N