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

[feature][updated] Add support working with GitHub #7289

Closed
1 task done
redradist opened this issue Jul 1, 2020 · 12 comments
Closed
1 task done

[feature][updated] Add support working with GitHub #7289

redradist opened this issue Jul 1, 2020 · 12 comments

Comments

@redradist
Copy link
Contributor

redradist commented Jul 1, 2020

It would be nice to be able build from GitHub release page (if sources provided) or get binaries if it is available and properly structured with meta information (compiler, architecture) ... because GitHub release page is already like Bintray and it could be used directly without need of other services

Update

Also one possibility is to just compile from sources if repository has conanfile.py recipe.
Syntax could be the following:

[requires]
nlohmann_json/3.9.1
icc/1.0.0 { git = "git@github.com:redradist/Inter-Component-Communication.git" }
@memsharded
Copy link
Member

Hi @redradist

I am sorry, but this is not possible. Not only Conan communicates with its own api to services, but there are many core things in Conan that cannot be implemented: the separation but complete connection between package recipes and package binaries, representation of different users and channels, resolution of version ranges, resolution of package revisions, searching for recipes, searching for binaries...

@redradist
Copy link
Contributor Author

Hi @redradist

I am sorry, but this is not possible. Not only Conan communicates with its own api to services, but there are many core things in Conan that cannot be implemented: the separation but complete connection between package recipes and package binaries, representation of different users and channels, resolution of version ranges, resolution of package revisions, searching for recipes, searching for binaries...

@memsharded Only issue I see is the searching ... But it could be fixed by adding to conaninfo.txt additional repository url, that is all
All other stuff: Developer will have to wrap the binary package with meta information

@redradist
Copy link
Contributor Author

redradist commented Oct 2, 2021

@memsharded This feature could be implemented in much simpler way.
Consider the following approach:

[requires]
nlohmann_json/3.9.1
icc/1.0.0 { git = "git@github.com:redradist/Inter-Component-Communication.git" }

Then user type the command to install all dependencies in conanfile.txt:

conan install <path_to_conanfile>/conanfile.txt

Then conan will perform the following actions:

  1. Conan see first dependency and download it from conancenter if it is available as binary otherwise run recipe for building this package on client machine
  2. Conan see the second dependency reference to github repository. Conan search in root directory for conanfile.py recipe and if it found it then run this recipe to build package on client machine

As for me second step is very feasible because conan already can build the package from recipe

@madebr @prince-chrismc Could you take a look at this last my proposal ?

@madebr
Copy link
Contributor

madebr commented Oct 2, 2021

This seems like a nice feature.
I would borrow/copy/steak@ pip's behavior, using the protocol to determine the way to fetch the recipe.
That way, the recipe can be git, ftp, file, ...

@redradist
Copy link
Contributor Author

redradist commented Oct 2, 2021

@madebr

This seems like a nice feature. I would borrow/copy/steak@ pip's behavior, using the protocol to determine the way to fetch the recipe. That way, the recipe can be git, ftp, file, ...

Yeah and also it will eliminate hard time adding your own recipe to conan-center-index.
If user want that other will find they package already pre-build and in common place like conan-center it will create recipe and publish it in conan-center-index otherwise just create its own recipe in repo

@redradist
Copy link
Contributor Author

redradist commented Oct 2, 2021

@madebr One question out of this scope of the current issue ...
Is there a plans to simplify process of adding your own recipe in conan-center ? For example like it is done in crate.io or npm ?

@redradist
Copy link
Contributor Author

redradist commented Oct 2, 2021

@memsharded @madebr @prince-chrismc
Also this works nice with private github repository with conanfile.py ;)
Lets do it ?

@prince-chrismc
Copy link
Contributor

prince-chrismc commented Oct 2, 2021

Yeah and also it will eliminate hard time adding your own recipe to conan-center-index

Who says you need to contribute your recipe? Obviously if it's an open source project why not contribute back to the world but Conan absolutely works with private repositories.


This is great idea but given my past job roles and experiences it can lead to some huge security gaps which I'd rather just no have to deal with!

Let's just point out SolarWinds and things like https://snyk.io/blog/npm-security-malicious-code-in-oss-npm-packages/ which happens way too often.

I love Golang system since it takes ZERO effort... just make sure the .go files are available on the internet... or even intranet and then you can do magic

import my-private-git.local/core/logging

I am not well versed in Rust and it's cargo/crates... but looking at the docs its very similar to npm https://doc.rust-lang.org/cargo/reference/publishing.html... basic project structure gets upload and ran locally 🤷

Next up none of the aforementioned services offer up binaries! Which is why Conan is amazing... I do not need to be setup to compile openssl I can just download and code...
Golang and Rust will rebuild the source code of the package into your binary by default. The distribution is not at all the same... in Node.JS we have native modules that are C pre-compiled binaries but those are a nasty mess of post install hell which are death in corporate IT and NGFWs

@redradist
Copy link
Contributor Author

redradist commented Oct 2, 2021

@prince-chrismc

Yeah and also it will eliminate hard time adding your own recipe to conan-center-index

Who says you need to contribute your recipe? Obviously if it's an open source project why not contribute back to the world but Conan absolutely works with private repositories.

This is great idea but given my past job roles and experiences it can lead to some huge security gaps which I'd rather just no have to deal with!

It could be the security issue, but the same could be with conan, not all analyze each aspect of libary and it could lead to have conan package in conan-center that are malicious ...
Anyway user is an end-point and it decides to get package from github, if it not get it from conan it will download it manually and build it ... My point is the this is feature that help to automatize installation of dependency and each tool could be used for malicious purposes

@redradist redradist changed the title [feature] Add support working with GitHub [feature][updated] Add support working with GitHub Oct 3, 2021
@redradist
Copy link
Contributor Author

@madebr @prince-chrismc @memsharded I've started working on prototype #9718

@redradist
Copy link
Contributor Author

@memsharded Even thought you do not like this solution, I've created it as separate package:
https://github.com/redradist/conanex
https://pypi.org/project/conanex

@madebr @prince-chrismc I hope you at least will appreciate it
Also I created discussion on reddit https://www.reddit.com/r/cpp/comments/ucoyjs/conanex_conan_extended

@redradist
Copy link
Contributor Author

redradist commented Dec 16, 2023

@memsharded @madebr @prince-chrismc After release Conan 2.0, I think it is time to go back for discussion adding feature from conanex to main conan

Lets discuss it again !!
Any thoughts on it ?

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

4 participants