Skip to content

fix: build script for macOS development #1491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

volsa
Copy link
Member

@volsa volsa commented Jul 5, 2025

build.sh --lit as well as build.sh --package should now work with this PR on MacOS (ARM)

@volsa volsa requested a review from Copilot July 7, 2025 06:51
Copy link

@Copilot 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

This PR enhances the build script to support macOS linker flags and fixes incorrect ordering of chmod options.

  • Added a Darwin case to adjust linker flags (-force_load and -framework CoreFoundation) for macOS.
  • Unified output filenames to libiec61131std.so across platforms.
  • Corrected chmod usage to place -R before the mode specifier.
Comments suppressed due to low confidence (1)

scripts/build.sh:296

  • The quoting in this log statement breaks the string around $lib_dir. Use consistent quoting or escape inner quotes, for example:
log "Running : $cc --shared -L$lib_dir \
  -Wl,-force_load,$lib_dir/libiec61131std.a ..."
                log "Running : $cc --shared -L"$lib_dir" \

-Wl,-force_load,$lib_dir/libiec61131std.a \
-o "$lib_dir/libiec61131std.so" \
-lm -framework CoreFoundation"
$cc --shared -L"$lib_dir" \
Copy link
Preview

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

The macOS branch invocation is missing the --target="$val" flag that appears in the first block, which could lead to incorrect target linking. Add --target="$val" here to match behavior.

Suggested change
$cc --shared -L"$lib_dir" \
$cc --shared -L"$lib_dir" \
--target="$val" \

Copilot uses AI. Check for mistakes.

--target="$val"

mv "$lib_dir/out.so" "$lib_dir/libiec61131std.so"
# Check if we're on macOS and adjust linker flags accordingly
Copy link
Preview

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

[nitpick] The macOS-specific linking logic is duplicated in two sections. Consider extracting this into a helper function or shared snippet to avoid repetition and simplify future maintenance.

Copilot uses AI. Check for mistakes.

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