Fix two shell script variable-name typos - #2836
Draft
rootkiller6788 wants to merge 1 commit into
Draft
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two shell script variable-name typos silently break parts of the j2objc build/distribution tooling:
scripts/list_framework_libraries.sh— the single-architecture loop (used forappletvosandappletvsimulator) constructs the path asbuild_result/objs-$platform/lib{LIBRARY_NAME}.ainstead oflib${LIBRARY_NAME}.a. The{...}form is not expanded, so[ -f $library ]never succeeds and tvOS slices are silently dropped from the XCFramework produced bygen_xcframework.sh(invoked frommake/framework.mk).scripts/j2objcc.sh— the-xcase setsOBJ_CPP(a typo), but the default-standard logic checksOBJC_CPP. Passing-x objective-c++(the documented way to force ObjC++ for files without a.mmextension) therefore falls through to--std=c17instead of--std=c++17, and ObjC++ code using C++17 constructs fails to compile.Verification
bash -npasses on both scripts.list_framework_libraries.sh: with a mockbuild_result/objs-appletvos/libFoo.apresent, the fixed script echoesbuild_result/objs-appletvos/libFoo.a; the unfixed script echoes nothing for the single-arch platforms.j2objcc.sh: with a stubxcrun,j2objcc -x objective-c++ -c test.cppnow emits--std=c++17(previously--std=c17).