-
Notifications
You must be signed in to change notification settings - Fork 79
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
Download and patch Vectorscan sources instead of vendoring them #151
Download and patch Vectorscan sources instead of vendoring them #151
Conversation
The Docker image builds just fine on Debian, but I have no idea why the Alpine version stopped working out of the blue.
My best bet by looking at the error is the assumption that libraries responsible for handling |
I'll take a look at it later. In my experience, that sort of failure is business as usual when dealing with C++ dependencies... |
Just as a sanity check, I changed the code to download the ZIP file and extract it using let response = reqwest::blocking::get(format!("https://github.com/VectorCamp/vectorscan/archive/refs/tags/vectorscan/{VERSION}.zip")).expect("Could not download Vectorscan source files");
let bytes = response.bytes().expect("Could not read Vectorscan zip file");
zip_extract::extract(Cursor::new(bytes), &vectorscan_src_dir, true).expect("Could not extract Vectorscan source files"); Unfortunately, it ended up being even worse as it couldn't find more libraries (with me attempting to download those):
|
Yes, this behavior is odd. One would expect that extracting a tarball and applying the patches would give the same behavior as the current vendored approach, as the vectorscan source directory trees should be the same in either case. I will take a closer look at this PR this week. |
2d1fafc
to
60da0d0
Compare
- Re-create the vectorscan.patch patchfile using `diff -ruN` - In build.rs, use the `patch` program instead of the `git2` dependency - In build.rs, use a checked-in copy of the vectorscan tarball instead of downloading it from GitHub - In build.rs, extract the tarball to `OUT_DIR` instead of `CARGO_MANIFEST_DIR`
277d512
to
d53c85e
Compare
As we discussed internally, I implemented a solution of downloading Vectorscan sources when missing and applying a patch file with our custom changes instead of permanently storing the patched version in the repository. Implements #71.
It works by downloading Vectorscan sources from GitHub archives, decompressing, and unarchiving to disk. Then, it applies our custom
.patch
file. At the end of each phase, it writes relevant data into a.version
file to keep track of completed changes so they don't need to be repeated on each build. I'm aware it's pretty simple validation, but it works pretty well.