-
Notifications
You must be signed in to change notification settings - Fork 3
fix(examples/mobc): Enable cross-platform builds with auto-target detection #446
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
base: main
Are you sure you want to change the base?
Conversation
…ection - Update tmtc-c2a version from 1.1.1 to 1.2.0 to fix compatibility issues - Add platform detection for jrsonnet binary downloads (macOS/Linux support) - Implement automatic target detection in package.json using rustc host info - Add macOS compiler configuration in build.rs for proper CMake builds - Remove fixed i686 target config to enable native platform builds - Add architecture detection for proper 32bit/64bit build flags 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
| let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_else(|_| "x86_64".to_string()); | ||
| let build_for_32bit = match target_arch.as_str() { | ||
| "i686" | "i586" | "arm" => "ON", | ||
| _ => "OFF", | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust target から BUILD_FOR_32BIT 生やすのかなり妥当だ
| // Use system default compiler for macOS | ||
| if cfg!(target_os = "macos") { | ||
| c2a_cmake.define("CMAKE_C_COMPILER", "clang"); | ||
| c2a_cmake.define("CMAKE_CXX_COMPILER", "clang++"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは悩ましい。SILS としてのビルドなら動けばいいぐらいなのでそんなに困らない気もしつつ、Apple clang は gcc とも clang ともビミョ~~~に違うので、デフォルトの選択肢として使いたい気はあまりしない。
| "scripts": { | ||
| "build:tlmcmddb": "tlmcmddb-cli bundle --pretty tlm-cmd-db/TLM_DB/calced_data tlm-cmd-db/CMD_DB tlmcmddb.json", | ||
| "run:c2a": "cargo run", | ||
| "run:c2a": "cargo run --target $(rustc -vV | grep host | cut -d' ' -f2)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run run:c2a で target を指定するようにする + .cargo/config.toml で指定しない、のは、cargo run を基本的に npm 経由でしかしないのであれば妥当なんですが、現状はあんまりそうなってないのでちょっと違うかなあとなっています。ここらへんは実機・SILS両方にビルドしないといけない実際の C2A user プロジェクトでも毎回悩むところなんですが、ある程度のやり方は見えてきてはいるので、c2a-core をそれに合わせるのがよいだろうな。(なので、このパッチを入れる、というよりはちょっと違うことになりそう)
| curl -L --proto '=https' --tlsv1.2 -sSf "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/${BINSTALL_VERSION}/install-from-binstall-release.sh" | env BINSTALL_VERSION=${BINSTALL_VERSION} CARGO_HOME=$(pwd) bash | ||
|
|
||
| ./bin/cargo-binstall --root . tmtc-c2a --version 1.1.1 --no-confirm | ||
| ./bin/cargo-binstall --root . tmtc-c2a --version 1.2.0 --no-confirm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは更新忘れ。Renovate で更新するようにした気がしていたけど、動いてないな。そっちのデバッグのためにも別 PR でやりたいかも。
概要
macosで環境構築した際にクレートのバージョン、プラットフォーム間のバイナリ差分があり起動に失敗したため対応したPE
Issue
詳細
発生した問題
実施した解決策
依存関係の更新
boom-tools/install.sh
前: tmtc-c2a --version 1.1.1
後: tmtc-c2a --version 1.2.0
プラットフォーム自動判定機能
boom-tools/install.sh に下記を追加
検証結果
test へのリンクや,検証結果へのリンク
影響範囲
XX系の動作がガラッと変わる,とか.
補足
何かあれば