Skip to content

Update bash $PATH in gpdemo for better portability#1162

Merged
tuhaihe merged 1 commit intoapache:mainfrom
tuhaihe:update-gpdemo-bash-path
Jun 18, 2025
Merged

Update bash $PATH in gpdemo for better portability#1162
tuhaihe merged 1 commit intoapache:mainfrom
tuhaihe:update-gpdemo-bash-path

Conversation

@tuhaihe
Copy link
Member

@tuhaihe tuhaihe commented Jun 16, 2025

Replace hardcoded /usr/bin/bash path with /usr/bin/env bash in gpAux/gpdemo/Makefile to improve portability across different systems. This change ensures the demo cluster can be created regardless of where bash is installed on the system.

Will return the following errors when testing under Ubuntu 18.04 container:

gpadmin@cdw:~/cloudberry$ make create-demo-cluster -C ~/cloudberry
make: Entering directory '/home/gpadmin/cloudberry'
make -C gpAux/gpdemo create-demo-cluster
make[1]: Entering directory '/home/gpadmin/cloudberry/gpAux/gpdemo'
make[1]: /usr/bin/bash: Command not found

This change makes the demo environment more robust across different Linux distributions, container environments, and custom installations.

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


Copy link
Contributor

@avamingli avamingli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Replace hardcoded `/usr/bin/bash` path with `/usr/bin/env bash` in
gpAux/gpdemo/Makefile to improve portability across different systems.
This change ensures the demo cluster can be created regardless of where
bash is installed on the system.

Will return the following errors when testing under Ubuntu 18.04
container:

```
gpadmin@cdw:~/cloudberry$ make create-demo-cluster -C ~/cloudberry
make: Entering directory '/home/gpadmin/cloudberry'
make -C gpAux/gpdemo create-demo-cluster
make[1]: Entering directory '/home/gpadmin/cloudberry/gpAux/gpdemo'
make[1]: /usr/bin/bash: Command not found
```

This change makes the demo environment more robust across different
Linux distributions, container environments, and custom installations.
@tuhaihe tuhaihe force-pushed the update-gpdemo-bash-path branch from 56d93e9 to 96f80ef Compare June 18, 2025 06:10
@tuhaihe tuhaihe merged commit 6e8aa55 into apache:main Jun 18, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants