Skip to content

Conversation

@Its-Just-Nans
Copy link
Contributor

Related to #12492 (comment)

Other options is to use /bin/bash instead of /bin/sh

@Turbo87
Copy link
Member

Turbo87 commented Dec 16, 2025

Thanks for the PR! You're correct that pipefail is not POSIX-compliant.

However, I'd prefer changing the shebang to #!/usr/bin/env bash instead of removing pipefail. The script has a pipeline on line 73:

python3 "$(dirname "$0")/infer-database-dump-version.py" -m "$DUMP_PATH/metadata.json" | psql -a "$DATABASE_NAME"

Without pipefail, if the Python script fails, psql might still exit 0 (having received partial or no input), and the script would continue silently. With pipefail, we'd catch this failure.

We already use bash in script/create-diff-link.sh, so there's precedent for it in this repo.

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Dec 16, 2025
@Its-Just-Nans
Copy link
Contributor Author

Okay thanks for the info

Fixed

@Turbo87 Turbo87 changed the title shell: pipefail is not included in /bin/sh Use env bash in script/import-database-dump.sh Dec 16, 2025
@Turbo87 Turbo87 enabled auto-merge (squash) December 16, 2025 15:36
@Turbo87 Turbo87 merged commit 11f2f56 into rust-lang:main Dec 16, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants