Skip to content

Add configure.fish, a wrapper of configure.sh for fish shell. - #639

Open
jonasschwab wants to merge 3 commits into
masterfrom
add-configure-wrapper-for-fish-shell
Open

Add configure.fish, a wrapper of configure.sh for fish shell.#639
jonasschwab wants to merge 3 commits into
masterfrom
add-configure-wrapper-for-fish-shell

Conversation

@jonasschwab

@jonasschwab jonasschwab commented Jun 9, 2026

Copy link
Copy Markdown
Member

Adds a Fish shell wrapper around configure.sh so Fish users can set up the ALF build environment by sourcing a Fish script, while still reusing the existing POSIX configure.sh logic.

Changes

  • Introduces configure.fish to invoke configure.sh in a POSIX sh subshell, using portable mktemp fallback for BSD/macOS compatibility.
  • Passes paths as positional parameters to sh -c to correctly handle spaces and special characters.
  • Captures the resulting environment and imports ALF_* variables into the current Fish session.
  • Guards against incorrect usage: errors with a clear message if the script is not sourced inside an interactive Fish shell session (e.g. executed directly or sourced from bash/sh).

Usage

source configure.fish MACHINE [MODE] [STAB] [options]
# or
. configure.fish MACHINE [MODE] [STAB] [options]

See configure.sh for the full list of MACHINE, MODE, STAB, and option values.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a Fish-shell wrapper around configure.sh so Fish users can set up the ALF build environment by sourcing a Fish script, while still reusing the existing POSIX configure.sh logic.

Changes:

  • Introduces configure.fish to invoke (source) configure.sh in a POSIX sh subshell.
  • Captures the resulting environment and imports ALF_* variables into the current Fish session.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread configure.fish Outdated
Comment thread configure.fish Outdated
@jonasschwab
jonasschwab force-pushed the add-configure-wrapper-for-fish-shell branch from dea9288 to a8af414 Compare June 9, 2026 13:55
@jonasschwab

Copy link
Copy Markdown
Member Author

@copilot Please add a check to configure.fish that checks if it is indeed sourced by a fish shell.

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@copilot Please add a check to configure.fish that checks if it is indeed sourced by a fish shell.

Added two guards at the top of configure.fish (commit configure.fish: add check that the script is sourced in fish):

  1. Fish shell checkset -q FISH_VERSION is true only when running inside fish; any attempt to source the script from bash/sh prints an error and exits.
  2. Sourced checkstatus --is-interactive is true in an interactive fish session. When the script is executed directly (fish configure.fish), fish runs it as a non-interactive subprocess and this check prints an error with the correct source usage.

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