-
Notifications
You must be signed in to change notification settings - Fork 95
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
Ignore large data files and bump scancode-toolkit #1508
Conversation
Ignore scanning large data files which are larger than 1 MB to avoid crashing scans on memory spikes. Also rollback #1504 Reference: aboutcode-org/scancode-toolkit#3711 Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Also remove platform constraints from rust-inspector and go-inspector. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
Looking good!
we will need some tests later. |
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
Instead of hardcoded values, SKIP_DATA_FILE_SIZE
should be a SCIO setting, similar to SCANCODEIO_SCAN_FILE_TIMEOUT
, off by default. Also, I don't think the SKIP_DATA_FILE_EXTENSIONS
is relevant.
I would suggest adding a SCANCODEIO_SCAN_MAX_FILE_SIZE
, default to None. This is the least intrusive way and will stay useful in the future.
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
df23fbf
to
0ebe84b
Compare
@tdruez I've added a |
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.
This looks good, ready to merge once the couple small issues are addressed.
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
IMHO we should have a scancod-config entry for this parameter, otherwise this requires changing the installation settings. This could be a follow up issue.
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
0a8c86a
to
eb7157e
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
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.
@AyanSinhaMahapatra The code looks good.
We are missing a changelog entry and to update the https://scancodeio.readthedocs.io/en/latest/project-configuration.html with the new setting.
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1e38e3e
to
48977c5
Compare
Thanks for the reviews @tdruez and @pombredanne, all addressed and ready now! |
@AyanSinhaMahapatra Looks great, thanks! |
This PR:
scancode-toolkit
to the latest releasev32.3.2
SCANCODEIO_SCAN_MAX_FILE_SIZE
and a project settingsscan_max_file_size
to skip scanning files above a certain file size (in bytes) as a temporary fix for multi-gigabyte memory-spikes when processing large files scancode-toolkit#3711