Start to build using Makefiles#1336
Conversation
…r icons Co-authored-by: sneurlax <sneurlax@gmail.com>
Co-authored-by: sneurlax <sneurlax@gmail.com>
Co-authored-by: sneurlax <sneurlax@gmail.com>
…stack.stackduo (fixes invalid bundle-id chars)
…de*.app and switches xcode-select to it, so the CI runner uses the full Xcode SDK instead of CLI tools.
…ow-sdk-path actually resolves
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## staging #1336 +/- ##
========================================
Coverage 4.93% 4.93%
========================================
Files 1064 1064
Lines 107980 107980
========================================
+ Hits 5328 5330 +2
+ Misses 102652 102650 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
danrmiller
left a comment
There was a problem hiding this comment.
Will discuss on call with @parasew
| "\"${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"", | ||
| /usr/lib/swift, | ||
| ); | ||
| PRODUCT_MODULE_NAME = stack_wallet; |
There was a problem hiding this comment.
Per @julian-CStack since its a template, stack_wallet should not be found in this file. If thats an updated requirement for newer macos or general macos builds we'll need to update the template to actual gen scripts to update it on copy
| export NEW_APP_ID="com.cypherstack.stackduo" | ||
| export NEW_APP_ID_CAMEL="com.cypherstack.stackDuo" | ||
| export NEW_APP_ID_SNAKE="com.cypherstack.stack_duo" | ||
| export NEW_APP_ID_SNAKE="com.cypherstack.stackduo" |
There was a problem hiding this comment.
@julian-CStack is unsure about the purpose of this change as the bash var is specifically called snake case id.
…job to Makefile make build-macos now drives the full macOS release build via the Makefile, replacing the old build_app.sh -d -s download path with source compilation. build.yaml: remove redundant Configure/GetDeps/GitVersions/Build steps now handled by make build-macos. Add dtolnay/rust-toolchain@stable + 1.85.1 install so check-reqs passes. Makefile: test-mwc now ensures local stable rustup toolchain is installed and defaulted before flutter test -d macos, fixing missing flutter_libsparkmobile framework linker error when Cargokit rebuilds for Debug mode.
julian-CStack
left a comment
There was a problem hiding this comment.
I know this is still a WIP and I've just done a rough scan of things and haven't fully gone over the main Makefile yet either
In general I do not like patching dependencies if it can be helped and since we control many of the deps I think it would be better to change those and simplify this build process if possible
There was a problem hiding this comment.
This should be reverted.
flutter pub run was replaced by dart run quite a while ago.
| if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
| set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) | ||
| endif() | ||
| # Always install into the local build bundle. On NixOS and other constrained |
There was a problem hiding this comment.
I'm not 100% sure but I don't think this should get changed. I've seen permission to install failures when running projects locally sometimes but that is generally some kind of cache issue or config issue. I don't remember the details as it was a while ago when I ran into this last
| "\"${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"", | ||
| /usr/lib/swift, | ||
| ); | ||
| PRODUCT_MODULE_NAME = stack_wallet; |
There was a problem hiding this comment.
|
|
||
| if [[ ! -f "${PUBSPEC_FILE}" ]]; then | ||
| echo "Error: pubspec.yaml not found at ${PUBSPEC_FILE}" >&2 | ||
| echo "Run from repo root and restore it with: git checkout -- pubspec.yaml" >&2 |
There was a problem hiding this comment.
This is wrong. The pubspec.yaml is generated, not pulled form git.
| else | ||
| sed -i "s/name: PLACEHOLDER/name: ${NEW_PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" | ||
| sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" | ||
| if [[ ! -f "${PUBSPEC_FILE}" ]]; then |
There was a problem hiding this comment.
This is wrong. The pubspec.yaml is generated, not pulled form git.
There was a problem hiding this comment.
Any reason these changes could not be directly PR'd to flutter_libmwc?
| fi | ||
|
|
||
| # Keep macOS stack_wallet builds on the Makefile path so setup steps stay in one place. | ||
| if [ "$APP_BUILD_PLATFORM" = "macos" ] && [ "$APP_NAMED_ID" = "stack_wallet" ]; then |
There was a problem hiding this comment.
Any reason this only applies to stack_wallet and not others?
| $(FLUTTER) config --enable-macos-desktop >/dev/null | ||
| @# Reassert macOS platform metadata in the same local HOME used for the final build. | ||
| @env HOME="$(PROJECT_HOME)" XDG_CACHE_HOME="$(PROJECT_CACHE)" TMPDIR="$(PROJECT_TMP)" PUB_CACHE="$(PUB_CACHE)" \ | ||
| $(FLUTTER) create --platforms=macos . --no-pub >/dev/null |
There was a problem hiding this comment.
I don't think flutter create --platforms=macos should be called on build
| @echo "--- Building app..." | ||
| @if [ ! -f lib/external_api_keys.dart ]; then \ | ||
| echo "[WARN] lib/external_api_keys.dart missing; recreating template."; \ | ||
| printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";\nconst kNanswapApiKey = "";\nconst kNanoSwapRpcApiKey = "";\nconst kWizSwapApiKey = "";\n' > lib/external_api_keys.dart; \ |
There was a problem hiding this comment.
This is redundant as the prebuild.sh script will generate this here https://github.com/cypherstack/stack_wallet/pull/1336/changes#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R399
If a check must be done here, better to fail with an error to check that prebuild.sh worked correctly
| @cp scripts/patches/flutter_libmwc_macos_build_all.sh crypto_plugins/flutter_libmwc/scripts/macos/build_all.sh | ||
| @chmod +x crypto_plugins/flutter_libmwc/scripts/macos/build_all.sh | ||
| @# Ensure Frostdart macOS build script uses sed -i.bak form (GNU/BSD compatibility). | ||
| @perl -0777 -i.bak -pe 's/_run\("sed",\s*\["-i"\s*,\s*"\.bak"\s*,\s*"s\/frostdart\/hrf-api\/",\s*"cargo\.toml"\]\);/_run("sed", ["-i.bak", "s\/frostdart\/hrf-api\/", "cargo.toml"]);/g' crypto_plugins/frostdart/scripts/macos/build_macos.dart 2>/dev/null || true |
There was a problem hiding this comment.
better to fix at source rather than patch
…igure this can be reverted/dropped after the legacy build scripts are deprecated
Courtesy of ongoing work by @parasew this introduces Nix flake + Makefile towards eventual reproducible builds.