Skip to content
Snippets Groups Projects
Select Git revision
  • sh-compile-with-ubuntu-20.04
  • pl-prometheus-ruby-service
  • main default protected
  • 904-webpack-ruby-service
  • sh-fix-ci-compile
  • kev-gitlab-ui-ruby-service
  • pl-grafana-ruby-service
  • kev-snowplow-micro-ruby-service
  • slashmanov/require-https-for-vite
  • kev-registry-ruby-service
  • pl-rake-log-attachment
  • 513075-refactor-cells-configuration
  • kev-del-expr-auto-reconf-setting
  • 2454-simplify-tool-version-manager-config
  • eread/remove-asdf-pages-and-some-references-to-asdf
  • sc1-update-redis-cluster
  • johnmason-main-patch-802d
  • 2412-combine-tool-versions-and-install-before-update
  • leipert-cert-doctor
  • 2431-remove-unused-software-installed-by-mise
  • v0.2.16
  • v0.2.15
  • v0.2.14
  • v0.2.13
  • v0.2.12
  • v0.2.11
  • v0.2.10
  • v0.2.9
  • v0.2.8
  • v0.2.7
  • v0.2.5
  • v0.2.6
  • v0.2.4
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.1
37 results

remove-empty-file

  • Patrick Steinhardt's avatar
    fb8df265
    Adjust bash shebangs to be more portable · fb8df265
    Patrick Steinhardt authored
    We're using the `/bin/bash` shebang in many of our scripts. This path is
    not guaranteed to exist by POSIX though, and it in fact doesn't on
    NixOS, for example.
    
    Unfortunately, there is no way to make this portable according to the
    POSIX standard except to rewrite the shebang:
    
        Furthermore, on systems that support executable scripts (the "#!"
        construct), it is recommended that applications using executable
        scripts install them using getconf PATH to determine the shell
        pathname and update the "#!" script appropriately as it is being
        installed (for example, with sed). For example:
    
    This is not really practical though. There are two alternatives that are
    commonly used in practice though:
    
        1. Use `/bin/sh` and stop using Bashisms. This binary really exists
           on virtually every platform, even on NixOS. This would require us
           to port over existing test scripts to be compatible.
    
        2. Use `/usr/bin/env bash`, which resolves the shell via PATH. This
           does not require us to port shell scripts and works in practice.
    
    Convert our scripts to use the second option, as it is the easier one of
    both and addresses the underlying issue on NixOS.
    fb8df265
    History
    Adjust bash shebangs to be more portable
    Patrick Steinhardt authored
    We're using the `/bin/bash` shebang in many of our scripts. This path is
    not guaranteed to exist by POSIX though, and it in fact doesn't on
    NixOS, for example.
    
    Unfortunately, there is no way to make this portable according to the
    POSIX standard except to rewrite the shebang:
    
        Furthermore, on systems that support executable scripts (the "#!"
        construct), it is recommended that applications using executable
        scripts install them using getconf PATH to determine the shell
        pathname and update the "#!" script appropriately as it is being
        installed (for example, with sed). For example:
    
    This is not really practical though. There are two alternatives that are
    commonly used in practice though:
    
        1. Use `/bin/sh` and stop using Bashisms. This binary really exists
           on virtually every platform, even on NixOS. This would require us
           to port over existing test scripts to be compatible.
    
        2. Use `/usr/bin/env bash`, which resolves the shell via PATH. This
           does not require us to port shell scripts and works in practice.
    
    Convert our scripts to use the second option, as it is the easier one of
    both and addresses the underlying issue on NixOS.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.