Comments (7)
Yes, there should be several ways, depending on your use case. The recommended use case to create packages from source is to use the source()
method to specify the source code origin, something like:
def source(self):
self.run("git clone https://..../repo.git")
Then, uploading the conanfile.py
can be done without problems.
If the repository specified in the source()
method is private, only you or the people you give access to your source repo will be allowed to retrieve such source code and build binaries. Just upload your built binaries to conan.io, and you are done. If someone requests binaries from a configuration not provided by you, it might try to build from source and call that source()
method, and it will fail due to the lack of permissions. Is this what you need?
from conan.
Yes this is how i am using it right now . I was trying to figure out a way so that i don't even need to share the location of source repo .
user develops a library builds packages for the library using conan and uploads the generated packages only with required package info and not the build functionality to a central conan server . So now other users can just consume the package and they cannot rebuild the packages .
from conan.
It's a little tricky but:
- build your packages
- upload all (conan upload x/y@user/channel --all)
- Edit the conanfile and remove the source
- upload just the conanfile (conan upload x/y@user/channel) without --all option
All the packages will be available to the users but the recipe will be incomplete so no one will be able to build the packages or know its origin. It doesn't sound too much like open source...
from conan.
Yes thought of that . Thanks for helping out .
The tool is great to use and manage dependencies and having control over what reaches the end users would be good for sharing proprietary packages .
from conan.
What @lasote propose is a good option, but you should probably search and replace in all conanfile.py inside your home ~/.conan/data folder for the URLs you want to hide.
But there are other possibilities, that can automate the process:
- Request the remote repo URL in the
source()
method, something like:
def source(self):
print "Introduce repo URL"
url = raw_input()
self.run("git clone %s" % url)
In this way, you are absolutely sure that nobody except package creators can read the URL.
- You can also try to do a replace in file on the conanfile.py itself:
from conans import tools
def source(self):
self.run("git clone https://URL")
tools.replace_in_file("../export/conanfile.py", "https://URL", "Hidden URL")
tools.replace_in_file("conanfile.py", "https://URL", "Hidden URL")
I haven't tried these options, but this is one of the good things that the package recipe is python, you can do whatever you want in that file. Please tell me if you try any and have any problem.
from conan.
Hi @Prinkesh, did you tried any of these approaches? I wonder if they worked (I think the first one is especially simple and effective), or whether it is still necessary to look for better solutions. Otherwise, perhaps the issue could be closed by now.
from conan.
The first method works well . Thanks for help .
from conan.
Related Issues (20)
- [bug] Wrong paths to profiles in docker runner HOT 1
- [bug] conan inspect is not showing requirements HOT 4
- [question] How to validate Options of a Dependency Package in conan v1 HOT 10
- [question] Conan SSL Errors With Artifactory HOT 4
- [question] How to properly "evolve" lockfiles? HOT 12
- [question] Migrating custom generator + user_info to Conan 2.0 HOT 3
- [question] cpp_info in editable mode HOT 2
- Building Qt 6.5.3 fails using conan 2.1.0 and 2.5.0 HOT 5
- [question] Conan 'home' with CI/CD Runners HOT 3
- [question] How to access `package_folder` in an extension command with settings/profiles HOT 3
- conan not working properly when using GNUInstallDirs HOT 3
- [question] combination of several conan configurations HOT 2
- [bug] building QT 6.5.3 under WSL2, conan builds/installs a "cmake" that fails to run. HOT 3
- [bug] `conan list -r` do not list packages HOT 3
- [bug] Remote login variables not working in docker runner
- [bug] inconsistent `-f` options HOT 1
- [question] Adding test_package which automatically sets up environment for run-time linkage to tested reference HOT 6
- [question] How can I set config `conan config set core.upload:parallel 10` in conan v2? HOT 3
- [question] Dynamic rpath issue for transitive shared libraries HOT 3
- [question]How to enable jumping to the source files of dependencies in Visual Studio? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conan.