Skip to content
  • Thomas Miedema's avatar
    0d20d769
    Build system: make clean in utils/ghc-pkg should not delete inplace/lib/bin · 0d20d769
    Thomas Miedema authored
    Make sure $1_$2_PROG always gets assigned a value, even when cleaning.
    
    The problem with not setting the variable becomes apparent when looking
    at the following two lines of code:
    
    ```
      $1_$2_INPLACE = $$(INPLACE_LIB)/bin/$$($1_$2_PROG)
      $(call clean-target,$1,$2_inplace,$$($1_$2_INPLACE))
    ```
    
    So running `make clean` in for example `utils/ghc-pkg` deletes
    `inplace/lib/bin/` instead of `inplace/lib/bin/ghc-pkg`.
    
    The offending code was introduced in commit
    2b85372c.
    
    There is one small implication. When cleaning before configure, the
    variable $1_$2_PROG will now be assigned a slightly wrong value, because
    exeext$3 isn't known yet. But I think that's ok, as no files have been
    build yet, so it will just try to delete a slighly different nonexistent
    file.
    
    [skip ci]
    
    Differential Revision: https://phabricator.haskell.org/D916
    0d20d769
    Build system: make clean in utils/ghc-pkg should not delete inplace/lib/bin
    Thomas Miedema authored
    Make sure $1_$2_PROG always gets assigned a value, even when cleaning.
    
    The problem with not setting the variable becomes apparent when looking
    at the following two lines of code:
    
    ```
      $1_$2_INPLACE = $$(INPLACE_LIB)/bin/$$($1_$2_PROG)
      $(call clean-target,$1,$2_inplace,$$($1_$2_INPLACE))
    ```
    
    So running `make clean` in for example `utils/ghc-pkg` deletes
    `inplace/lib/bin/` instead of `inplace/lib/bin/ghc-pkg`.
    
    The offending code was introduced in commit
    2b85372c.
    
    There is one small implication. When cleaning before configure, the
    variable $1_$2_PROG will now be assigned a slightly wrong value, because
    exeext$3 isn't known yet. But I think that's ok, as no files have been
    build yet, so it will just try to delete a slighly different nonexistent
    file.
    
    [skip ci]
    
    Differential Revision: https://phabricator.haskell.org/D916
Loading