Skip to content

build_visit improvements for patching #5686

@markcmiller86

Description

@markcmiller86

Proposed best practices for handling patching in build_visit

  • Only use patch -p0 << \EOF not a bare EOF without the leading backslash.
    • Rationale: \EOF is necessary to patch code involving $ chars (e.g. shell code)
  • Maximally restrict patching so that patches are applied under only the conditions we have verified they are necessary. For example, if a package builds fine everywhere except macOS, ensure the patch is restricted to macOS.
    • Rationale: should be self-evident...helps to minimize non-standard builds
  • Put unrelated patches in different bash functions
  • Name patch functions by package's version number and purpose (e.g. apply_cgns_410_missing_ldflags_patch)
    • Rationale: A given version of a TPL can require multiple patches to fix different issues
  • Put logic effecting when a patch is applied in callers of the patch functions and not the patch functions themselves
    • Rationale: makes it a bit clearer to understand when patches get applied
  • Use unified diff format for diffs used in patches (e.g. diff -u)
    • Rationale: Unified diffs are quite a bit shorter
  • Put messaging related to patching in the patch functions and not the callers of those functions
    • Rationale: encpasulation
  • Invoke patches after cd'ing to build dir
    • Rationale: ensures some level of consistency of how patches get defined
  • Define patches relative to the build dir of the package
    • What about out of source builds?
  • When libs are updated, old patch logic should be removed
    • Rationale: should be self-evident. When we bump the version of a lib, we no longer need to maintain patches for the older version.
  • Conditional patching logic should not be predicated on compiler names and/or versions (see Patch application logic should not predicate on compiler name #19693)

The above would help to unify build_visit where patching is concerned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    deliberationIssues that require further discussion and/or team dialogenhancementNew feature or requestimpact mediumProductivity partially degraded (not easily mitigated bug) or improved (enhancement)likelihood mediumNeither low nor high likelihoodreviewedIssue has been reviewed and labeled by a developer

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions