habitat icon indicating copy to clipboard operation
habitat copied to clipboard

Space character can't be exported as a separator

Open themightychris opened this issue 4 years ago • 5 comments

  • netdata/plan.sh:

    do_setup_environment() {
      export HAB_ENV_NETDATA_PKG_PLUGINS_DIR_SEPARATOR=" "
      set_runtime_env -f HAB_ENV_NETDATA_PKG_PLUGINS_DIR_SEPARATOR "${HAB_ENV_NETDATA_PKG_PLUGINS_DIR_SEPARATOR}"
      push_runtime_env NETDATA_PKG_PLUGINS_DIR "${pkg_prefix}/libexec/netdata/plugins.d"
      push_runtime_env NETDATA_PKG_PLUGINS_DIR "${pkg_prefix}/plugins.d"
    }
    
  • -> /hab/pkgs/.../RUNTIME_ENVIRONMENT

    HAB_ENV_NETDATA_PKG_PLUGINS_DIR_SEPARATOR= 
    
  • project/plan.sh:

    pkg_deps=(
      origin/netdata
    )
    
    do_before() {
      push_runtime_env NETDATA_PKG_PLUGINS_DIR "${pkg_prefix}/plugins.d"
    }
    

If the separator is set to ; or some other printable character(s), this works as expected: the dependent package has the upstream separator applied

However, if the separator is a single space, it is not quoted in RUNTIME_ENVIRONMENT, and in the dependent plan.sh the default separator of : is applied. A multi-word value beside just a space however, does correctly get quoted and picked up in the dependent plan

themightychris avatar Apr 22 '20 01:04 themightychris

Nice catch... I suspect the error lies in this line:

https://github.com/habitat-sh/habitat/blob/c1c08bd63b93a785ac353ffe261aee19bdcaa408/components/plan-build/bin/shared.bash#L291

christophermaier avatar Apr 28 '20 19:04 christophermaier

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] avatar Jul 26 '21 13:07 stale[bot]

this is still an issue

themightychris avatar Jul 26 '21 19:07 themightychris

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] avatar Jul 31 '22 10:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] avatar Aug 12 '23 18:08 stale[bot]