bin/flink-suite.sh aborts under macOS's default bash 3.2

Open Beginner friendly
#653 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash
Domain
cli

Research direction

Read bin/flink-suite.sh and docs/upstream-flink-suite.md, then reproduce the empty-array expansion with macOS Bash 3.2 using the command in the issue. Update the script or document and check the version requirement as appropriate; done means the suite no longer aborts on the documented setup, with the required Bash behavior clear.

Written by the indexing model from the issue text.

Description

Priority: P4.

Problem

bin/flink-suite.sh runs under #!/usr/bin/env bash with set -uo pipefail and expands arrays that can be empty, such as STREAMFUSION_LINE_PROFILES on the 2.2 line and TEST_SELECTOR_ARGS when no test selector is given. Bash before 4.4 treats "${array[@]}" of an empty array as an unbound variable under set -u, so on macOS, whose /bin/bash is 3.2, the suite aborts unless a newer bash comes first on PATH. docs/upstream-flink-suite.md does not state a bash requirement.

Confirmed on canonical main 97f7b08de84d11b9eb58e0f3b1bf33713e57ec83:

$ /bin/bash -c 'set -u; empty=(); printf "[%s]\n" "${empty[@]}"'
/bin/bash: empty[@]: unbound variable          # bash 3.2.57 (macOS)
$ /opt/homebrew/bin/bash -c 'set -u; empty=(); printf "[%s]\n" "${empty[@]}"'
[]                                              # bash 5.3

Direction

Expand possibly empty arrays as ${array[@]+"${array[@]}"}, which works on every bash version. Alternatively, document the bash 4.4 requirement and fail fast with a clear version check at the top of the script.

Dominant language
Java
Stars
157
Forks
13
Avg merge
7h 56m
Merged PRs (30d)
153

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from datafusion-contrib/StreamFusion

All issues in datafusion-contrib/StreamFusion

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.