ipm icon indicating copy to clipboard operation
ipm copied to clipboard

Compile classes with u flag

Open SCanzano opened this issue 1 year ago • 8 comments
trafficstars

When running install -v moduleName

I see

Compilation started on 5/13/2024 12:23:34 with qualifiers "d-lck"

but I'm seeing issues with the class Ens.Utils.Tasks.Purge being compiled when I deliver rclib-ens and this is causing the entire module from not being installed successfully as ENSLIB is marked as ReadOnly

If I do ##class(%SYSTEM.OBJ).IsUpToDate("Ens.Utils.Tasks.Purge")

it reports 0.

All of this being said I would like to see ZPM call the class compiler with the u(skip up to date) flag, to skip any up to date classes.

Consider I have a module with 100 classes on version 1.0.1 and then I make a change to one of the 100 classes and do not change the version.
This will redeliver all 100 classes and compile all 100 classes but in practice we only need to compile one class.

SCanzano avatar May 13 '24 18:05 SCanzano

@SCanzano I view this as an upstream issue in that ##class(%SYSTEM.OBJ).IsUpToDate("Ens.Utils.Tasks.Purge") definitely should report 1 (and IPM can't do anything about that). This could be worth pursuing via InterSystems Support.

As a workaround, two options:

  1. Use the Flags attribute on the resource in question to add the u flag - e.g.: <Resource Name="WhateverPackage.PKG" Flags="cku" />
  2. Use $System.OBJ.SetFlags/SetQualifiers to skip up-to-date by default (https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=RCOS_vsystem_flags_qualifiers#RCOS_vsystem_flags_qualifiers_defaults)

isc-tleavitt avatar May 13 '24 18:05 isc-tleavitt

Disclaimer: I haven't used the Flags attribute for ~7 years, but I think it should work!

isc-tleavitt avatar May 13 '24 18:05 isc-tleavitt

@isc-tleavitt I dont disagree with you and this may not have solved my issue but the real question is when running install moduleName should it force the recompile of classes which have not changed. Using the u flag would allow it to skip the up to date classes and produce a much faster install time for modules that have a large number of classes and the latest version of the module has only changed a few of the classes in the module,

SCanzano avatar May 14 '24 14:05 SCanzano

@isc-tleavitt

@SCanzano I view this as an upstream issue in that ##class(%SYSTEM.OBJ).IsUpToDate("Ens.Utils.Tasks.Purge") definitely should report 1 (and IPM can't do anything about that). This could be worth pursuing via InterSystems Support.

As a workaround, two options:

  1. Use the Flags attribute on the resource in question to add the u flag - e.g.: <Resource Name="WhateverPackage.PKG" Flags="cku" />
  2. Use $System.OBJ.SetFlags/SetQualifiers to skip up-to-date by default (https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=RCOS_vsystem_flags_qualifiers#RCOS_vsystem_flags_qualifiers_defaults)

My issue with this is I was unaware of an attribute on Flags for Resource . I don't see this documented anywhere. Is Resource documented anywhere and is Flags also documented?

SCanzano avatar May 14 '24 14:05 SCanzano

@isc-tleavitt I dont disagree with you and this may not have solved my issue but the real question is when running install moduleName should it force the recompile of classes which have not changed. Using the u flag would allow it to skip the up to date classes and produce a much faster install time for modules that have a large number of classes and the latest version of the module has only changed a few of the classes in the module,

That's a fair question. @isc-kiyer @isc-bzhang do you have any thoughts on this? I think changing the default flags (or making the default compilation flags an IPM setting like default registry, analytics, etc.) in this way would be reasonable.

isc-tleavitt avatar May 14 '24 15:05 isc-tleavitt

@isc-tleavitt

@SCanzano I view this as an upstream issue in that ##class(%SYSTEM.OBJ).IsUpToDate("Ens.Utils.Tasks.Purge") definitely should report 1 (and IPM can't do anything about that). This could be worth pursuing via InterSystems Support. As a workaround, two options:

  1. Use the Flags attribute on the resource in question to add the u flag - e.g.: <Resource Name="WhateverPackage.PKG" Flags="cku" />
  2. Use $System.OBJ.SetFlags/SetQualifiers to skip up-to-date by default (https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=RCOS_vsystem_flags_qualifiers#RCOS_vsystem_flags_qualifiers_defaults)

My issue with this is I was unaware of an attribute on Flags for Resource . I don't see this documented anywhere. Is Resource documented anywhere and is Flags also documented?

The resource element in module.xml is documented (insufficiently, without any information on attributes - Flags isn't the only useful one) at https://github.com/intersystems/ipm/wiki/03.-IPM-Manifest-(Module.xml)#elements . I've added the documentation tag to reflect the need for expansion there.

isc-tleavitt avatar May 14 '24 15:05 isc-tleavitt

@isc-tleavitt Purely from the use case scenario described, skipping up-to-date classes sounds reasonable... I'm a bit concerned with whether it would break any usage for non-compile lifecycle or something else...

isc-bzhang avatar May 14 '24 15:05 isc-bzhang

Added documentation here: https://github.com/intersystems/ipm/wiki/03.-IPM-Manifest-(Module.xml)#resource

isc-dchui avatar Jun 12 '24 13:06 isc-dchui