GithubHelp home page GithubHelp logo

Comments (7)

memsharded avatar memsharded commented on September 5, 2024

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.

Prinkesh avatar Prinkesh commented on September 5, 2024

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.

lasote avatar lasote commented on September 5, 2024

It's a little tricky but:

  1. build your packages
  2. upload all (conan upload x/y@user/channel --all)
  3. Edit the conanfile and remove the source
  4. 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.

Prinkesh avatar Prinkesh commented on September 5, 2024

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.

memsharded avatar memsharded commented on September 5, 2024

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.

memsharded avatar memsharded commented on September 5, 2024

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.

Prinkesh avatar Prinkesh commented on September 5, 2024

The first method works well . Thanks for help .

from conan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.