Skip to content

Fix buildtool failures on non-bash shells and multi-target link/derived-dir handling - #21

Merged
gcasa merged 2 commits into
masterfrom
copilot/fix-build-issues-minixcompat
Oct 4, 2026
Merged

gcasa merged 2 commits into
masterfrom
copilot/fix-build-issues-minixcompat

Conversation

Copilot AI commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Building MINIXCompat with buildtool on Debian fails in several places: shopt is missing under dash, PROJECT_DERIVED_FILE_DIR is undefined, and a target can't link against another target's static library. This PR fixes those three. It was not built or tested, because GNUstep wasn't available in the authoring environment.

  • shopt portability (PBXShellScriptBuildPhase.m, xcsystem.m)

    • The generated scripts now use shopt -s inherit_errexit 2>/dev/null || true. Shells without shopt skip it instead of aborting the script.
    • xcsystem.m uses CRLF line endings, which I preserved.
  • PROJECT_DERIVED_FILE_DIR (PBXNativeTarget.m)

    • It is set to derived_src in the build context and the environment. It's set in _productWrapper, alongside TARGET_NAME. Scripts and compile commands that reference it no longer expand it to an empty string, which produced mkdir /Musashi.
  • Cross-target linking (PBXFrameworksBuildPhase.m)

    • The link line now adds -L build/<target>/Products for every other target's Products directory, so -lMusashi resolves to libMusashi.a.
    • The current target's own directory is skipped.
-L/usr/local/lib ... -Lbuild/Musashi/Products -Lbuild/m68kmake/Products -lMusashi

Not addressed (from the same issue):

  • Target build ordering and the lack of a way to build a single target.
  • The Generate 68000 Core script's expectation of a shared Products directory.
  • derived_src/Musashi not being on the header search path (m68kops.h).
  • buildtool clean leaving build/script_* behind.

Copilot AI linked an issue Oct 4, 2026 that may be closed by this pull request
Co-authored-by: gcasa <27943+gcasa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build issues with MINIXCompat on Debian Fix buildtool failures on non-bash shells and multi-target link/derived-dir handling Oct 4, 2026
Copilot AI requested a review from gcasa October 4, 2026 05:49
@gcasa
gcasa marked this pull request as ready for review October 4, 2026 05:53
@gcasa
gcasa merged commit d017c4a into master Oct 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Handful of issues building MINIXCompat

2 participants