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

Package vendor new feature #16073

Merged
merged 21 commits into from
Jun 5, 2024
Merged

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Apr 12, 2024

Changelog: Feature: New vendor=True package creation and build isolation strategy
Docs: conan-io/docs#3756

Close #13171

@memsharded memsharded changed the title wip Repackage strategy Apr 12, 2024
@memsharded memsharded changed the title Repackage strategy Package bundle new feature May 31, 2024
@memsharded memsharded added this to the 2.4.0 milestone May 31, 2024
@memsharded memsharded marked this pull request as ready for review May 31, 2024 18:44
@RubenRBS RubenRBS self-requested a review June 2, 2024 19:01
conans/model/conf.py Outdated Show resolved Hide resolved
@czoido czoido self-requested a review June 3, 2024 16:35
@memsharded memsharded changed the title Package bundle new feature Package vendor new feature Jun 3, 2024
Copy link
Member

@RubenRBS RubenRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Some minor super minor minor suggestions

conans/client/graph/graph.py Outdated Show resolved Hide resolved
conans/client/graph/graph_binaries.py Show resolved Hide resolved
memsharded and others added 2 commits June 4, 2024 16:28
Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
@db4
Copy link
Contributor

db4 commented Jun 6, 2024

@memsharded I must be too late but the docs for these changes weren't available until recently. Looking into them I see that your approach is to remove all dependencies from the graph completely. I'm not sure it's a great idea. Even repackaged binaries may depend on each other; think of a dll that depends on some internal static libraries (which we would like to hide via repackaging) but requires another repackaged dll to run. Maybe a global vendor=True attribute is OK for someone, but I'm afraid there are too many cases where it won't fit.

@memsharded
Copy link
Member Author

Of course. This is an advanced feature that must be used with lots of care.

But it is also the result of a large demand, see the ticket #13171, and how many tickets it has linked. A very popular use case is to distribute final products to other organizations, via Conan packages.

Organizations have the need to "repackage" or fully isolate dependencies sometimes. They are already doing it via a more manual process like using a deployer to collect all dependencies and then a conan export-pkg to repackage them. The risks these packages they are creating will have are exactly the same as the new vendor feature, but they have to do a large effort to implement it.

When we fully document it, we will make sure to clarify the risks and the cautions that users must have. Of course there are many cases that it won't be possible, this feature is intended for some particular use cases, and abuse is always possible, but we will try our best to warn against it. Still the users are responsibles, it is not great that many of them have to do a tedious and manual work for something that Conan can provide built-in.

@db4
Copy link
Contributor

db4 commented Jun 6, 2024

So it's mainly intended for packaging self-contained applications. It's understandable (due to relative simplicity), but personally I would also like to be able to package (exclude from the graph) specific requirements. Something like

def requirements(self):
    self.requires("dep/1.0", bundle=True)

@memsharded
Copy link
Member Author

self.requires("dep/1.0", bundle=True)

I see what you mean, but what would be exactly the use case of this? Why vendoring only some dependencies, but not others?
The use case that we are focusing one is the demanded one, for example an organization that is creating an SDK that is built from several other Conan packages, and they want to share with another organization without them having to depend on the transitive packages used to create the SDK package.

@db4
Copy link
Contributor

db4 commented Jun 6, 2024

I'd like to bundle an application, but it in turn consists of some modules (dlls). These modules depend on each other. I need to keep these top-level dependencies but hide implementation details (static lib dependencies). I think I'm not alone but of course cannot predict how many users anticipate this feature.

@memsharded
Copy link
Member Author

I'd like to bundle an application, but it in turn consists of some modules (dlls). These modules depend on each other. I need to keep these top-level dependencies but hide implementation details (static lib dependencies). I think I'm not alone but of course cannot predict how many users anticipate this feature.

But what if the DLLs have transitive dependencies themselves, would you also make the dlls fully vendor their transitive static libraries in turn, adding a vendor=True in every DLL package recipe? This sounds a bit difficult to maintain. The idea is that the dlls would also be vendored with the application, in a single package without any dependencies. If you are making visible and transitive the shared libraries that will also make visible and transitive all their transitive dependencies (headers, static libraries), but just vendor the static libraries that are direct dependencies of the application, then it doesn't sound like you are vendoring much, and vendoring just those static libraries will have almost no benefit? What would be the advantage of doing that?

@db4
Copy link
Contributor

db4 commented Jun 6, 2024

Actually, I would like to vendor everything except a small set of top-level dlls (that nonetheless depend on each other). The whole application is quite big, bundling everything together and making a new package on any change is impractical e.g. in terms of size (hundreds of megabytes in my case). Fine-grained vendoring would allow updating just one module for end users; I think it's much more convenient.

@memsharded
Copy link
Member Author

Understood.

I think this is something that we can consider, lets wait to get more feedback from the feature, some real world usage from more users, and lets take this idea for the following iterations. I am not saying this is impossible, just that better go step by step, learn a bit more about the current proposal and iterate from there. Thanks for the feedback!

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

Successfully merging this pull request may close these issues.

[feature] Consider the re-package concept
5 participants