Skip to content

Rules should use /usr/bin/env bash instead of /bin/bash #52

@AleksanderGondek

Description

@AleksanderGondek

Description of the problem:

Gitops rules should not assume /bin/bash is present on the host machine, as it breaks the compatibility for Linux OS'es which do not place bash executable in such location. It should use more portable /usr/bin/env bash.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Use NixOS operating system (for example, in version 20.09)
  2. Clone the example repository: Link
  3. Remove patch fixing the issue (WORKSPACE line 33)
  4. Run bazel build //kubeview:kustomize-dev

Alternatively:

  1. Use NixOS operating system (for example, in version 20.09)
  2. Clone any bazel project using rules_gitops
  3. Run bazel target utilizing k8s_deploy

What operating system are you running Bazel on?

NixOS 20.09

What's the output of bazel info release?

release 3.3.1- (@non-git)

If bazel info release returns "development version" or "(@Non-Git)", tell us how you built Bazel.

It was installed by nix package manager (link).

Snippet of the WORKSPACE file that includes rules_gitops rules.

...

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

git_repository(
  name="com_adobe_rules_gitops",
  commit="354e7d3341f05e076f286663731f18caf1e62340",
  remote="https://github.com/adobe/rules_gitops.git",
  shallow_since="1611050644 +0000",
)
load("@com_adobe_rules_gitops//gitops:deps.bzl", "rules_gitops_dependencies")
rules_gitops_dependencies()

...
load("@com_adobe_rules_gitops//gitops:repositories.bzl", "rules_gitops_repositories")
rules_gitops_repositories()

Have you found anything relevant by searching the web?

No.

Any other information, logs, or outputs that you want to share?

Fixing this issue will not make adobe/rules_gitops work on NixOS, as downloaded golang binaries are using wrong ELF (which, imho, should be a separate issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions