Search code examples
gradlenetflix-nebula-plugins

Nebula Ospackage plugin incremental build issue


Using Nebula RPM Plugin I have some issues with incremental build support, for some of the ospackage extension properties.

See simple example below:

plugins {
  id "nebula.ospackage" version "9.1.1"
}

ospackage {
    packageDescription = "my sample package"
    user  "root"
    createDirectoryEntry true
    addParentDirs        true   
}

When changing createDirectoryEntry property value, Gradle properly detects the change and consideres the task as NOT up-to-date , as expected:

> Task :buildRpm
Caching disabled for task ':buildRpm' because:
  Build cache is disabled
Task ':buildRpm' is not up-to-date because:
  Value of input property 'createDirectoryEntry' has changed for task ':buildRpm'
Created rpm java.io.RandomAccessFile@25ee06fa
:buildRpm (Thread[Execution worker for ':',5,main]) completed. Took 0.02 secs.

BUT when changing addParentDirs propery value, the change is not detected, and task is considered as up-to-date!

> Task :buildRpm UP-TO-DATE
Caching disabled for task ':buildRpm' because:
  Build cache is disabled
Skipping task ':buildRpm' as it is up-to-date.
:buildRpm (Thread[Execution worker for ':',5,main]) completed. Took 0.007 secs.

Both addParentDirs and createDirectoryEntry are simple Boolean properties with their getters correctly annoted with @Input, see https://github.com/nebula-plugins/gradle-ospackage-plugin/blob/main/src/main/groovy/com/netflix/gradle/plugins/packaging/SystemPackagingExtension.groovy#L71.

How can we explain the different behavior in up-to-date check for these two properties?

Note

Same behavior when using property assignment or not (e.g.: addParentDirs true same effect as addParentDirs = true ) ; seems that there can be issues related to the syntaxe used, see https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/82 and https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/39

(Using Gradle v7.4, ospackage plugin v9.1.1)


Solution

  • Root cause is that addParentDirs property defined in ospackage is simply ignore by nebula ospackage plugin, due to issue https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/246.

    So whatever value will be defined for this property in this extension, it won't affect the task configuration, I guess that's why it is ignored by the up-to-date check mecanism.