-
Notifications
You must be signed in to change notification settings - Fork 952
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
Packaging issues #412
Comments
I will try to address everything mentioned here. 0. Basic things
1. Retdec-support is huge
2. Dependencies are fetched at build-time
3. Dependency versions are very specific
4. Dependencies are forked
5. Dependencies are built from source
|
Thank you for your reply, I'm glad to see that you take the issues seriously even though they are not top priority. TL/DR: solving (3) would go a long way and (2) and (4) basically wouldn't matter anymore from a packaging perspective.
Since the non-compiled signatures are relatively small, would it be reasonable to work with those and compile them to a cache on the fly? That should significantly cut down on the space overhead but also only take additional time on first use.
I think distributing text YARA and building it during the regular build process would be better practice than shipping the compiled results in either case. But if all rules are compiled on first use that would be no real space improvement. As I suggested before, would it be possible to compile them as-needed?
Maybe. In that case there would need to be some way to notify the user when he gets sub-optimal results because of missing signatures so that he knows he has to install those.
Whatever the "fetch phase" produces has to be compared against a known hash. So basically the rule is that we can do anything that will be 100% binary reproducible. If the whole configure step would be binary reproducible it would be possible, although a bit of a hack. I don't know much about cmake -- is it not possible to seperate fetching the dependencies from the configure phase?
That would have all the disadvantages of both solutions wouldn't it? I thought the difficulty in maintaining such a repository is the main reason for using cmake instead of submodules in the first place?
That would really be the greatest help. If the build system would use traditional autoconf-style configure checks of the dependencies (dep x can be found and has feature y / is at least version z), it wouldn't really matter very much how dependencies are fetched. Mabe a
and then error. That would solve a lot.
This would be great and should also ease the maintenance burdon on the retdec team in the long run.
The runtime solution would be perfect. The buildtime solution would improve matters but would still require having two seperate yara packages.
Yes. |
Packaging issues
I just updated the nixos retdec package from version 3.0 to 3.2. That was not a pleasant experience, which is probably why it remained outdated for so long. I don't know if distribution packaging is a priority for this project, but in case it is I will outline the problems here.
Retdec-support is huge
Only 127M compressed but 4G uncompressed. That takes up space on our mirror server but, more importantly, on every users computer. We currently remove the PE static code patterns (3G) by default and only install these when explicitly requested by the user. I've opened avast/retdec-support#3 for that.
Dependencies are fetched at build-time
This is by far the biggest issue. NixOS and many other distros separate the build in two distinct phases: one to fetch the sources, one to build. The build phase is executed in a sandbox that does not have internet access. There are various reasons for that, including:
Since the retdec build process fetches its dependencies at build time, a lot of patching is required. We have to fetch all the dependencies ourselves and then patch every CMakeLists file to use those local versions instead. Since that essentially duplicates parts of the build system, it makes a lot of manual adjustments during upgrades necessary.
I've started discussing this at #279.
Dependency versions are very specific
All dependencies are fetched by commit-hash. That makes it very difficult for distros since they usually try to ship one version of every package and share those dependencies. It is generally impossible to judge the true intentions behind the build hash:
Is it "we need at least this version since we depend on feature x" or "newer versions break the api" or "we need exactly version 2.3"?
This and the lack of a central file that collects the necessary dependency versions makes it painful to adjust the dependency versions on an upgrade.
Dependencies are forked
Capstone and yara are forked. Can the changes not be upstreamed?
Dependencies are built from source
While a distro would ideally build all the dependencies themselves and then build retdec based on those pre-compiled dependencies, retdec instead insists on building everything itself. The exception to this is openssl, which is only built if it cannot be found on the system. That should be the case for all dependencies.
The text was updated successfully, but these errors were encountered: