fix(examples/mobc): Enable cross-platform builds with auto-target detection#446
Open
Keisuke Machida (keimatch) wants to merge 1 commit intomainfrom
Open
fix(examples/mobc): Enable cross-platform builds with auto-target detection#446Keisuke Machida (keimatch) wants to merge 1 commit intomainfrom
Keisuke Machida (keimatch) wants to merge 1 commit intomainfrom
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 <noreply@anthropic.com>
Comment on lines
+3
to
+7
| 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", | ||
| }; |
Member
There was a problem hiding this comment.
Rust target から BUILD_FOR_32BIT 生やすのかなり妥当だ
Comment on lines
+12
to
+16
| // 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++"); | ||
| } |
Member
There was a problem hiding this comment.
これは悩ましい。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)", |
Member
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
これは更新忘れ。Renovate で更新するようにした気がしていたけど、動いてないな。そっちのデバッグのためにも別 PR でやりたいかも。
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.
概要
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系の動作がガラッと変わる,とか.
補足
何かあれば