Skip to content

Fix two shell script variable-name typos - #2836

Draft
rootkiller6788 wants to merge 1 commit into
google:masterfrom
rootkiller6788:fix-script-variable-typos
Draft

Fix two shell script variable-name typos#2836
rootkiller6788 wants to merge 1 commit into
google:masterfrom
rootkiller6788:fix-script-variable-typos

Conversation

@rootkiller6788

Copy link
Copy Markdown

Problem

Two shell script variable-name typos silently break parts of the j2objc build/distribution tooling:

  1. scripts/list_framework_libraries.sh — the single-architecture loop (used for appletvos and appletvsimulator) constructs the path as build_result/objs-$platform/lib{LIBRARY_NAME}.a instead of lib${LIBRARY_NAME}.a. The {...} form is not expanded, so [ -f $library ] never succeeds and tvOS slices are silently dropped from the XCFramework produced by gen_xcframework.sh (invoked from make/framework.mk).

  2. scripts/j2objcc.sh — the -x case sets OBJ_CPP (a typo), but the default-standard logic checks OBJC_CPP. Passing -x objective-c++ (the documented way to force ObjC++ for files without a .mm extension) therefore falls through to --std=c17 instead of --std=c++17, and ObjC++ code using C++17 constructs fails to compile.

Verification

  • bash -n passes on both scripts.
  • list_framework_libraries.sh: with a mock build_result/objs-appletvos/libFoo.a present, the fixed script echoes build_result/objs-appletvos/libFoo.a; the unfixed script echoes nothing for the single-arch platforms.
  • j2objcc.sh: with a stub xcrun, j2objcc -x objective-c++ -c test.cpp now emits --std=c++17 (previously --std=c17).

- list_framework_libraries.sh: expand ${LIBRARY_NAME} in the
  SINGLE_PLATFORMS loop so appletvos/appletvsimulator static libraries
  are included in XCFramework builds. The literal 'lib{LIBRARY_NAME}.a'
  never matched a file, so tvOS slices were silently dropped.
- j2objcc.sh: set OBJC_CPP (not OBJ_CPP) when '-x objective-c++' is
  passed, so the script adds --std=c++17 instead of --std=c17 for
  Objective-C++ translation units compiled without a .mm extension.
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.

1 participant