-
Notifications
You must be signed in to change notification settings - Fork 86
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
deps: add support for vendor
and use local vendor
for deps
#123
Conversation
This should also allow us to build with |
Oof, github nearly crashes my browser on this PR, lol. Taking a look from the command-line... |
@flouthoc I'm showing the new I think what you have here will work fine in CI (I checked, the "build" task runs a Assuming there's no Unless you have any easy ideas, this LGTM. I would suggest rebasing though to verify it works with the new dedicated VM images (merged a few hours ago). |
Ahh ha! The major culprets appear to be:
|
Yeah, there's a TON of binary archive files, e.g. |
I'm in favor for actually doing this in CI, and/or have it the default in |
Sure I'll try checking if we have a crate for
They are sub-dependency of another crate it seems we don't have lot of control over other crates dependency except to carry them afaik. :\ |
This strikes me as both impractical (distributing/managing this repo. code) and dangerous (who knows what's in those binaries). Is there a way we can carry the source for them instead? There's a message on https://lib.rs/crates/winapi-x86_64-pc-windows-gnu which says "Please don’t use this crate directly, depend on winapi instead." (in case that means something to you). |
Why do we depend on windows code? Netavark is and should only be compiled on linux. I think we should clean our dependencies first before we vendor unnecessary stuff. |
It looks like there is no solution for this problem yet, cargo will always pull in dependencies for all platforms: rust-lang/cargo#7058 |
@cevich As @Luap99 suggested We still need some files otherwise Made this change in a latest commit. |
Ahh this is much better now, thanks.
LGTM |
Please do this in one commit, by removing the files in an extra commit you now include these huge binary files in the git history forever. |
8359b76
to
81159c1
Compare
Well it is still over 50 MB but I guess we cannot get it much smaller. Does dependabot work with the vendor dir? |
|
@cevich the winapi is a dependency of the faccess crate. The faccess crate does have it listed as a windows only dependency, but I'm not sure if we can specify something like The other option would be to get rid of faccess dep and replace it with stdlib calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing some old things in .cirrus.yml
, please rebase. Also, the new task should alias the cache attributes, not re-anchor them. It's also important to reference all tasks as dependencies for the success
task. So, something like this (I didn't not check it):
diff --git a/.cirrus.yml b/.cirrus.yml
index 9bb4b76..277ee0b 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -97,21 +97,9 @@ verify_vendor_task:
alias: "verify_vendor"
depends_on:
- "build"
- # From this point forward, all cache's become read-only - meaning
- # any changes made in this task aren't re-uploaded to the cache.
- # This avoids some flapping between tasks, along with the upload time.
- pkg_cache: &ro_pkg_cache # TODO: Remove when packages included in static VM images
- <<: *pkg_cache
- reupload_on_changes: false
- cargo_cache: &ro_cargo_cache
- <<: *cargo_cache
- reupload_on_changes: false
- targets_cache: &ro_targets_cache
- <<: *targets_cache
- reupload_on_changes: false
- bin_cache: &ro_bin_cache
- <<: *bin_cache
- reupload_on_changes: false
+ cargo_cache: *ro_cargo_cache
+ targets_cache: *ro_targets_cache
+ bin_cache: *ro_bin_cache
setup_script: *setup
main_script: *main
@@ -165,6 +153,7 @@ success_task:
depends_on:
- "build"
- "validate"
+ - "verify_vendor"
- "unit"
- "integration"
- "meta"
8c08574
to
76d73fc
Compare
76d73fc
to
eb1f222
Compare
eb1f222
to
31b6566
Compare
31b6566
to
950203e
Compare
@cevich @Luap99 Well I don't think we need a I think |
950203e
to
5d97c3f
Compare
Oh, great news! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cevich, flouthoc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM but can you rebase to pick up the lates dep update from #133 |
5d97c3f
to
c1057a5
Compare
While releasing netavark binary lot of platform does not allows build process to pull `deps` from upstream repo. Vendor and ship dependency locally in a `vendor` directory and point `cargo` to use local vendored `deps`. Signed-off-by: Aditya Rajan <arajan@redhat.com>
`docs` phony is not yet functional and leaves error for `make` so remove it until its implemented Signed-off-by: Aditya Rajan <arajan@redhat.com>
Signed-off-by: Aditya Rajan <arajan@redhat.com>
c1057a5
to
836cc7d
Compare
/lgtm |
Thanks for taking the initiative @flouthoc and for seeing this through to merge. I appreciate it. |
While releasing netavark binary lot of platform does not allows build
process to pull
deps
from upstream repo.Vendor and ship dependency locally in a
vendor
directory and pointcargo
to use local vendoreddeps
.Automatically uses vendor while doing
make build
ormake
See: #115