Skip to contentSkip to conversation

archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass

PATCH In review Robert Yang 2 participants 6 messages May 15, 2020

lore
Share & tools
lore
#0 lore raw

cover archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass

The following changes since commit ce6c50ea68c34e02b487d54fdd9288e04833cdef:

wayland: fix condition for strndup detection (2020-05-14 14:13:50 +0100)

are available in the Git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/archiver2
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/archiver2

Robert Yang (1):
archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable
copyleft_filter.bbclass

 meta/classes/archiver.bbclass | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass

Set it to 0 can make it archive all the used sources during the build, nothing will be filtered out, this is useful when we want to archive all the sources.

This equals to:
COPYLEFT_LICENSE_INCLUDE = "*"
COPYLEFT_LICENSE_EXCLUDE = ""

But there are a lot of settings in copyleft_filter.bbclass, so it may not work when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will make it more reliable.

The default value is 1, has no impact by default.

---
 meta/classes/archiver.bbclass | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
meta/classes/archiver.bbclass +10 -7
index 48b4913a9f..f4e3478cd0 100644
@@ -44,6 +44,9 @@
 COPYLEFT_RECIPE_TYPES ?= 'target native nativesdk cross crosssdk cross-canadian'
 inherit copyleft_filter
 
+# Set this to 0 will archive all used sources in the build
+ENABLE_COPYLEFT_FILTER ?= "1"
+
 ARCHIVER_MODE[srpm] ?= "0"
 ARCHIVER_MODE[src] ?= "patched"
 ARCHIVER_MODE[diff] ?= "0"
@@ -81,13 +84,13 @@ python () {
                 pn = p
                 break
 
-    included, reason = copyleft_should_include(d)
-    if not included:
-        bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
-        return
-    else:
-        bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
-
+    if oe.types.boolean(d.getVar('ENABLE_COPYLEFT_FILTER')):
+        included, reason = copyleft_should_include(d)
+        if not included:
+            bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
+            return
+        else:
+            bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
 
     # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted,
     # so avoid archiving source here.
Signature · 1 line
2.21.0
#2 lore raw
Quoted 11 lines · Robert Yang

Set it to 0 can make it archive all the used sources during the build, nothing will be filtered out, this is useful when we want to archive all the sources.

This equals to:
COPYLEFT_LICENSE_INCLUDE = "*"
COPYLEFT_LICENSE_EXCLUDE = ""

But there are a lot of settings in copyleft_filter.bbclass, so it may not work when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will make it more reliable.

Why would copyleft_filter.bbclass not work when the settings are changed? They're intended to be configurable.

I've been using COPYLEFT_LICENSE_INCLUDE = "*" in several projects for years now. I'm not sure that we need another overlapping variable which could confuse users further.

Thanks,
Paul

#3 lore raw
Quoted 13 lines · Paul Barker
Quoted 11 lines · Robert Yang

Set it to 0 can make it archive all the used sources during the build, nothing will be filtered out, this is useful when we want to archive all the sources.

This equals to:
COPYLEFT_LICENSE_INCLUDE = "*"
COPYLEFT_LICENSE_EXCLUDE = ""

But there are a lot of settings in copyleft_filter.bbclass, so it may not work when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will make it more reliable.

Quoted 6 lines

Why would copyleft_filter.bbclass not work when the settings are changed? They're intended to be configurable.

I've been using COPYLEFT_LICENSE_INCLUDE = "*" in several projects for years now. I'm not sure that we need another overlapping variable which could confuse users further.

As you know, there other settings in copyleft_filter.bbclass may affect the result, such as:

COPYLEFT_RECIPE_TYPES
COPYLEFT_PN_INCLUDE
COPYLEFT_PN_EXCLUDE

These settings maybe changed, and it's not easy to detect the changes, the ENABLE_COPYLEFT_FILTER can make it more reliable.

// Robert

Quoted 4 lines

Thanks,
Paul

#4 lore raw
Quoted 26 lines · Robert Yang
Quoted 13 lines · Paul Barker
Quoted 11 lines · Robert Yang

Set it to 0 can make it archive all the used sources during the build, nothing will be filtered out, this is useful when we want to archive all the sources.

This equals to:
COPYLEFT_LICENSE_INCLUDE = "*"
COPYLEFT_LICENSE_EXCLUDE = ""

But there are a lot of settings in copyleft_filter.bbclass, so it may not work when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will make it more reliable.

Quoted 6 lines

Why would copyleft_filter.bbclass not work when the settings are changed? They're intended to be configurable.

I've been using COPYLEFT_LICENSE_INCLUDE = "*" in several projects for years now. I'm not sure that we need another overlapping variable which could confuse users further.

As you know, there other settings in copyleft_filter.bbclass may affect the result, such as:

Quoted 6 lines

COPYLEFT_RECIPE_TYPES
COPYLEFT_PN_INCLUDE
COPYLEFT_PN_EXCLUDE

These settings maybe changed, and it's not easy to detect the changes, the ENABLE_COPYLEFT_FILTER can make it more reliable.

I still don't think I understand sorry. Why can't changes be detected? What's unreliable in the existing code? Are there specific failure cases we can give examples of?

I think there's a good argument for renaming copyleft_filter.bbclass and all the variables since the names are confusing when you want the archiver to include non-copyleft packages. But that would cause churn and break lots of people's configs so I've never proposed it. Not sure we need a master variable to enable/disable the whole class though.

Thanks,
Paul

#5 lore raw
Quoted 31 lines · Paul Barker
Quoted 30 lines · Robert Yang
Quoted 13 lines · Paul Barker
Quoted 11 lines · Robert Yang

Set it to 0 can make it archive all the used sources during the build, nothing will be filtered out, this is useful when we want to archive all the sources.

This equals to:
COPYLEFT_LICENSE_INCLUDE = "*"
COPYLEFT_LICENSE_EXCLUDE = ""

But there are a lot of settings in copyleft_filter.bbclass, so it may not work when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will make it more reliable.

Quoted 6 lines

Why would copyleft_filter.bbclass not work when the settings are changed? They're intended to be configurable.

I've been using COPYLEFT_LICENSE_INCLUDE = "*" in several projects for years now. I'm not sure that we need another overlapping variable which could confuse users further.

As you know, there other settings in copyleft_filter.bbclass may affect the result, such as:

COPYLEFT_RECIPE_TYPES
COPYLEFT_PN_INCLUDE
COPYLEFT_PN_EXCLUDE

Quoted 6 lines
Quoted 2 lines

These settings maybe changed, and it's not easy to detect the changes, the ENABLE_COPYLEFT_FILTER can make it more reliable.

I still don't think I understand sorry. Why can't changes be detected? What's unreliable in the existing code? Are there specific failure cases we can give examples of?

If one of the above variables' value is changed in a conf file, the archiver will still work, but the results will be changed, it's not hard for advanced users to detect that, but not easy for newbies.

Quoted 6 lines

I think there's a good argument for renaming copyleft_filter.bbclass and all the variables since the names are confusing when you want the archiver to include non-copyleft packages. But that would cause churn and break lots of people's configs so I've never proposed it. Not sure we need a master variable to enable/disable the whole class though.

I think that the problem is archiver's results depend on copyleft_filter a lot, but they should be two separated functions, so I proposed a new var to control it. But keep the current status is also OK since it works.

// Robert

Quoted 4 lines

Thanks,
Paul