-
Notifications
You must be signed in to change notification settings - Fork 188
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
existence of cache file(.tern/) effects report output #1000
Comments
I first cleared the cache and then followed the Tern commands in order according to your directions. Regular Tern run comparison:
Scancode files:
Things are mostly what I would expect except for the following case:
By the way, I'll keep poking at this. |
Thanks @JustinWonjaePark for the clarification of differences. From what I see, Scancode is reporting the file and its metadata twice on the first run which is why the files are different. Tern then captures the file metadata only once in the cache and reports on it once when it loads from the cache. This is because Tern only stores one copy of a file in the cache when the I agree that Tern should not double report scancode data on a file in |
I agree with you @rnjudge. I've not seen missing metadata either. |
I will start to look at a fix so a fresh scancode run doesn't report the same package twice. When I run just scancode without Tern I get only one reported instance of the |
@JustinWonjaePark Thanks again for catching this very tricky bug. I found the issue and am submitting a fix. Then, planning to cut a new release with the fix included tomorrow. |
When running scancode with an empty cache, Tern was reporting the same file twice due to a logic bug in the add_file_data() function. This fix adds a flag to ensure that a file is only added to the layer object file list if it does not already exist there. Resolves tern-tools#1000 Signed-off-by: Rose Judge <rjudge@vmware.com>
When running scancode with an empty cache, Tern was reporting the same file twice due to a logic bug in the add_file_data() function. This fix adds a flag to ensure that a file is only added to the layer object file list if it does not already exist there. Resolves tern-tools#1000 Signed-off-by: Rose Judge <rjudge@vmware.com>
When running scancode with an empty cache, Tern was reporting the same file twice due to a logic bug in the add_file_data() function. This fix adds a flag to ensure that a file is only added to the layer object file list if it does not already exist there. Resolves #1000 Signed-off-by: Rose Judge <rjudge@vmware.com>
@rnjudge I am glad that it has been fixed. Thanks!! |
Describe the bug
Output of tern differs whether there exist cache files(.tern/) or not.
debian_buster_img#.json : created by command
tern report -f json -i debian:buster -o debian_buster_img#.json
debian_buster_img_scancode#.json : created by command
tern report -f json -x scancode -i debian:buster -o debian_buster_img_scancode#.json
To Reproduce
Steps to reproduce the behavior:
tern report -f json -i debian:buster -o debian_buster_img1.json
tern report -f json -i debian:buster -o debian_buster_img2.json
rm -rf ~/.tern/
tern report -f json -x scancode -i debian:buster -o debian_buster_img_scancode1.json
tern report -f json -x scancode -i debian:buster -o debian_buster_img_scancode2.json
tern report -f json -i debian:buster -o debian_buster_img3.json
tern report -f json -x scancode -i debian:buster -o debian_buster_img_scancode3.json
rm -rf ~/.tern/
tern report -f json -i debian:buster -o debian_buster_img4.json
rm -rf ~/.tern/
tern report -f json -x scancode -i debian:buster -o debian_buster_img_scancode4.json
Error in terminal
no error occurred
Expected behavior
Same command need to provide same output
Environment you are running Tern on
Enter all that apply
Tern at commit 273e3c8
Python 3.6.13
Docker version 19.03.13, build 4484c46d9d
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
The text was updated successfully, but these errors were encountered: