Skip to content

Unset CDPATH when running admin/configure in README#337

Open
agis wants to merge 1 commit intometabrainz:masterfrom
agis:cdpath-omit-readme
Open

Unset CDPATH when running admin/configure in README#337
agis wants to merge 1 commit intometabrainz:masterfrom
agis:cdpath-omit-readme

Conversation

@agis
Copy link
Copy Markdown

@agis agis commented Feb 22, 2026

On systems that set the CDPATH environment variable[1], cd might print the directory to stdout:

If cd uses a non-empty directory name from CDPATH, or if -
is the first argument, and the directory change is
successful, cd writes the absolute pathname of the new
working directory to the standard output.

This causes admin/lib/common.inc.bash to erroneously set MB_DOCKER_ROOT to `$'/home/musicbrainz-docker\n/home/musicbrainz-docker', which in turn causes the following error:

$ admin/configure with alt-db-only-mirror
admin/lib/common.inc.bash: line 12: cd: $'/home/musicbrainz-docker\n/home/musicbrainz-docker': No such file or directory
configure: fail to change directory to '/home/musicbrainz-docker
/home/musicbrainz-docker'

By temporarily unsetting CDPATH (just in case the user has set it), the command succeeds in my system.

[1] https://man7.org/linux/man-pages/man1/bash.1.html

Copilot AI review requested due to automatic review settings February 22, 2026 20:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the installation instructions to avoid CDPATH-related stdout from cd breaking admin/configure on systems where CDPATH is set, improving reliability of the documented setup flow.

Changes:

  • Prefixes the admin/configure with alt-db-only-mirror README command with CDPATH= to neutralize CDPATH for that invocation.

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

On systems that set the CDPATH environment variable[1], cd might print
the directory to stdout:

    If cd uses a non-empty directory name from CDPATH, or if -
    is the first argument, and the directory change is
    successful, cd writes the absolute pathname of the new
    working directory to the standard output.

This causes admin/lib/common.inc.bash to erroneously set MB_DOCKER_ROOT
to `$'/home/musicbrainz-docker\n/home/musicbrainz-docker', which in turn
causes the following error:

    $ admin/configure with alt-db-only-mirror
    admin/lib/common.inc.bash: line 12: cd: $'/home/musicbrainz-docker\n/home/musicbrainz-docker': No such file or directory
    configure: fail to change directory to '/home/musicbrainz-docker
    /home/musicbrainz-docker'

By temporarily unsetting CDPATH (just in case the user has set it), the
command succeeds in my system.

[1] https://man7.org/linux/man-pages/man1/bash.1.html
@agis agis force-pushed the cdpath-omit-readme branch from 1f98e5a to 6f9b192 Compare February 22, 2026 20:49
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.

2 participants