Received: from yocto-www.yoctoproject.org (yocto-www.yoctoproject.org [140.211.169.56]) by mx.groups.io with SMTP id smtpd.web09.1183.1574442228384538619 for ; Fri, 22 Nov 2019 09:03:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=neutral (domain: crashcourse.ca, ip: 140.211.169.56, mailfrom: rpjday@crashcourse.ca) Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 27A6EE00E42; Fri, 22 Nov 2019 09:03:48 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no * trust * [199.212.143.9 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * 1.0 FORGED_SPF_HELO FORGED_SPF_HELO Received: from northernsuncreative.com (cpanel4.indieserve.net [199.212.143.9]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 9A7BDE007D4 for ; Fri, 22 Nov 2019 09:03:47 -0800 (PST) Received: from [216.208.232.130] (port=33516 helo=localhost.localdomain) by cpanel4.indieserve.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iYCLR-000784-M3 for yocto@yoctoproject.org; Fri, 22 Nov 2019 12:03:46 -0500 Date: Fri, 22 Nov 2019 12:03:44 -0500 (EST) From: "rpjday@crashcourse.ca" X-X-Sender: rpjday@localhost.localdomain To: Yocto discussion list Subject: Re: repost: how to create a SPDX "notice file" from a build? In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-0.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel4.indieserve.net X-AntiAbuse: Original Domain - yoctoproject.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - crashcourse.ca X-Get-Message-Sender-Via: cpanel4.indieserve.net: authenticated_id: rpjday+crashcourse.ca/only user confirmed/virtual account not confirmed X-Authenticated-Sender: cpanel4.indieserve.net: rpjday@crashcourse.ca X-Source: X-Source-Args: X-Source-Dir: Content-Type: text/plain; charset=US-ASCII On Fri, 22 Nov 2019, Robert P. J. Day wrote: > i asked about this a couple months ago but didn't see any replies, > so i'll ask again with a little more detail. > > colleague wants to, from YP (actually petalinux but should be > irrelevant), some sort of SPDX "notice file", along the lines of what > can be generated by black duck. it doesn't need to be identical, but > it would be useful to at least have a first pass that people can look > at and say what they want tweaked. > > is there an example of how to (using the spdx.bbclass class file, i > assume) do something like this? thanks. a lilttle more progress, and then an error -- i installed fossology on my ubuntu 18.04 dev box, then added INHERIT += "spdx" to local.conf, and tried to build a simple qemuarmx86-64, and very quickly had a number of native packages fail with: //////////// start ////////// DEBUG: Executing python function do_spdx ERROR: Error executing a python function in exec_python_func() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: 0001: *** 0002:do_spdx(d) 0003: File: '/home/rpjday/oe/dist/layers/poky/meta/classes/spdx.bbclass', lineno: 83, function: do_spdx 0079: foss_full_spdx = d.getVar('FOSS_FULL_SPDX') == "true" or False 0080: foss_command = "wget %s --post-file=%s %s"\ 0081: % (foss_flags, info['tar_file'], foss_server) 0082: *** 0083: foss_result = run_fossology(foss_command, foss_full_spdx) 0084: if foss_result is not None: 0085: (foss_package_info, foss_file_info, foss_license_info) = foss_result 0086: spdx_file_info = create_spdx_doc(local_file_info, foss_file_info) 0087: ## write to cache File: '/home/rpjday/oe/dist/layers/poky/meta/classes/spdx.bbclass', lineno: 230, function: run_fossology 0226: # Package info 0227: package_info = {} 0228: if full_spdx: 0229: # All mandatory, only one occurrence *** 0230: package_info['PackageCopyrightText'] = re.findall('PackageCopyrightText: (.*?)', foss_output, re.S)[0] 0231: package_info['PackageLicenseDeclared'] = re.findall('PackageLicenseDeclared: (.*)', foss_output)[0] 0232: package_info['PackageLicenseConcluded'] = re.findall('PackageLicenseConcluded: (.*)', foss_output)[0] 0233: # These may be more than one 0234: package_info['PackageLicenseInfoFromFiles'] = re.findall('PackageLicenseInfoFromFiles: (.*)', foss_output) Exception: IndexError: list index out of range ERROR: list index out of range DEBUG: Python function do_spdx finished ERROR: Function failed: do_spdx /////////// end ///////// i have absolutely no idea what to think of this, and am open to suggestions. does anyone have a working scenario to simply demonstrate the usage of spdx.bbclass? rday -- ======================================================================== Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ========================================================================