tern
tern copied to clipboard
Report result with same command is not constant
Describe the bug
When you run tern with Scancode extension repeatedly,
small parts of the results are different from each other.
To Reproduce Steps to reproduce the behavior:
- pull fossology/fossology:3.10.0
- Run command
tern report -f json -x scancode -i debian:buster -o debian_buster_img_scancode.json
Error in terminal no error occurred
Expected behavior The report on a same docker image should be same.
Environment you are running Tern on 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
Thanks for the issue @JustinWonjaePark -- Is the parts of the code that are differing file-related output from Scancode or package metadata from Tern? If the differences are file related it's possible this could be a Scancode bug, but I'll need to take a closer look.
Can you also confirm which version of scancode you have installed?
Hello @rnjudge , I am sorry for late response. The version of scancode that I use is 21.3.31
@rnjudge , it actually looks part that returned from Scancode. (copyright and license information by files)
@JustinWonjaePark it looks like this is an issue with scancode then? or is it specific to Tern? Tern simply captures scancode output and reports on it. Are the differences you're seeing after back to back runs on the same image or running with a fresh cache for the same image? I can try to reproduce but a little confused by your steps that say to pull fossology image and then run a tern+scancode report for debian:buster
. Can you clarify what you did to produce this error?
It might be issue with the scancode that I run with tern. I'd like to check if scancode provides inconstant result when it is ran independently, but I was not sure what does tern pass to scancode exactly. @rnjudge, can you tell me what to scan to with scancode without tern?
@JustinWonjaePark Here are the steps to run scancode without Tern:
-
tern -k report -i debian:buster
. The-k
option keeps the containers mounted filesystem so you can run scancode on it independently of Tern. - Find the mounted filesystem by running
ls ~/.tern/temp/
. The directory under~/temp
for me and the debian:buster image wase63992559353a522e62a73bc137fd023ee97e1226b96947df8e00e73d1a9d627
. Whatever the directory there is, use that. - Run scancode on the mounted filesystem (you'll need to switch your username).
sudo /home/rjudge/ternenv/bin/scancode -ilpcu --quiet --timeout 300 -n 4 --json - /home/rjudge/.tern/temp/e63992559353a522e62a73bc137fd023ee97e1226b96947df8e00e73d1a9d627/contents
The output of scancode will print directly to the terminal.
Hi @JustinWonjaePark any followup from your investigation?
Closing due to lack of response. Feel free to re-open if you're still hitting this issue.