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

De-vendor pre-built binaries #1152

Merged
merged 11 commits into from
Aug 15, 2018
Merged

Conversation

pombredanne
Copy link
Member

This is a fix for #469
It add a location provider plugin mechanism such that path to binaries can be provided by such plugins.

A plugin can then either provide a path to a bundled binary or point to a system installed-binary. This later approach would work well for distro packaging #487 (including for Guix #288 and FreeBSD #1147 and help deal with some distro specific issues more easily such as #443 )

The plugins that provide locations to binaries are found here: https://github.com/nexB/scancode-toolkit/tree/0b121e834e831f97954a3a42d19fe08868dc31a0/plugins

Each provide a few paths such as there https://github.com/nexB/scancode-toolkit/blob/0b121e834e831f97954a3a42d19fe08868dc31a0/plugins/extractcode-7z-manylinux1_x86_64/src/extractcode_7z/__init__.py#L40 .... and these could easily be replaced by system paths or links or anything.

@pgiffuni @miwi-fbsd and @mat813 : ping too to get feedback if this can be something that will work for you for https://reviews.freebsd.org/D16484

@dvc94ch this would likely help you on Guix.

Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
@codecov
Copy link

codecov bot commented Aug 10, 2018

Codecov Report

Merging #1152 into develop will decrease coverage by <.01%.
The diff coverage is 82.96%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1152      +/-   ##
===========================================
- Coverage    84.09%   84.08%   -0.01%     
===========================================
  Files          113      114       +1     
  Lines        12448    12455       +7     
===========================================
+ Hits         10468    10473       +5     
- Misses        1980     1982       +2
Impacted Files Coverage Δ
src/scancode/plugin_license_policy.py 95% <ø> (-0.24%) ⬇️
src/typecode/contenttype.py 86.35% <ø> (-0.05%) ⬇️
src/extractcode/libarchive2.py 95.04% <100%> (+0.18%) ⬆️
src/typecode/magic2.py 92.92% <100%> (+0.33%) ⬆️
src/plugincode/__init__.py 82.5% <100%> (+0.35%) ⬆️
src/commoncode/command.py 84.74% <76%> (+1.21%) ⬆️
src/extractcode/sevenzip.py 84.02% <78.94%> (-1.07%) ⬇️
src/plugincode/location_provider.py 81.42% <81.42%> (ø)
src/licensedcode/cache.py 95.79% <0%> (+1.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d814a5...e60e92b. Read the comment docs.

Implement this in extractcode and typecode to provide 7zip, libarchive
and libmagic through plugins instead of using vendored binaries in the
core scancode

Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
- Some binaries initially committed were not correct for a given
architecture. Also several provide location were not correct and have
been updated.

- All location keys are also inlined in plugins code to avoid recursive
imports

- Extra consistency checks are done on provided locations (they must
exist)

The version reported in p7zip plugins and ABOUT files was 9.20.1 but
it is 9.38.1: this has been fixed.

In sevenzip CLI calls, the empty password arg is now last on the CLI
args to avoid any ambiguity with the file being extracted.

The overall command execute2 logging has been aslo updated.

Signed-off-by: Philippe Ombredanne <[email protected]>
@pombredanne pombredanne force-pushed the 469-location-provider-plugin branch from 1ce0f9d to e60e92b Compare August 10, 2018 11:50
@pombredanne pombredanne merged commit e60e92b into develop Aug 15, 2018
@pombredanne pombredanne deleted the 469-location-provider-plugin branch August 15, 2018 13:42
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.

1 participant