Firstyear / obs-service-cargo

OBS Source Service and utilities for Rust software packaging
Mozilla Public License 2.0
15 stars 9 forks source link

Support an option to specify the tarball name for multi-vendor projects #61

Closed marcosbc closed 7 months ago

marcosbc commented 8 months ago

Originally, this project allowed the use of the --tag option to add a custom suffix to the vendor.tar.gz file. But this option has been deprecated since the rewrite in Rust, and the reason was described in https://github.com/openSUSE/obs-service-cargo_vendor/issues/59#issuecomment-1815674824.

However, we are building a project with multiple vendor files, and the tag option was useful for us before to add some extra context to the "vendor.tar.gz" generated file. If not, we would end up with a generic "vendor.tar.zst" file in addition to any other vendor files generated by our project, and it is confusing to understand what type of vendoring files it refers to (until you inspect its file contents).

It would be great if we could have some way to specify a custom filename for the generated "vendor.tar.gz" file, be it with the --tag option or another feature.

uncomfyhalomacro commented 8 months ago

\cc @Firstyear , what do you think?

Firstyear commented 8 months ago

However, we are building a project with multiple vendor files, and the tag option was useful for us before to add some extra context to the "vendor.tar.gz" generated file. If not, we would end up with a generic "vendor.tar.zst" file in addition to any other vendor files generated by our project, and it is confusing to understand what type of vendoring files it refers to (until you inspect its file contents).

Is there really a true, pressing, technical reason you need split vendor files? Having them "all in one" means that you have everything you need, in one place, and it means we benefit from better compression and deduplication.

I think I'd rather not re-add tagging unless there is a specific project where it hard requires multiple vendor archives to perform a successful build.

marcosbc commented 8 months ago

We are finding this with InfluxDB, which requires a Go vendor archive for the main app (written in Go), and a Cargo vendor archive for the libflux library (written in Rust). There are also some other required vendor archives for some of the pinned libraries.

In other cases, we have also seen some apps that require vendor archives for its Go and NPM dependencies, so it is not an uncommon situation i would say.

In these cases, having the ability to customize the tarball name, makes it easier to differentiate the contents (and origin) of each tarball.

Firstyear commented 7 months ago

Okay, given that there are other vendor tar's in a project, I think this is okay. I'll re-add it.

uncomfyhalomacro commented 7 months ago

@marcosbc I will make a new release soon after I update the readme and how we should do multi vendor :)

marcosbc commented 7 months ago

Thank you very much!

uncomfyhalomacro commented 7 months ago

@marcosbc released. we have a new section in the README https://github.com/openSUSE/obs-service-cargo_vendor?tab=readme-ov-file#how-to-do-multiple-vendors.

Please test out the new build at https://build.opensuse.org/package/show/devel:languages:rust/obs-service-cargo

❤️

marcosbc commented 7 months ago

It worked great, thank you! 🚀