-
Notifications
You must be signed in to change notification settings - Fork 4
Sixteen kb pagesize #5
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
Changes from all commits
ffc3e3f
bcdf8ab
e4b8f14
d828d78
62703f6
82bba26
7b3c1b0
065c5a8
e026f2e
05faf81
1b9fbb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| name: Build and Verify 16KB Page Size Alignment | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master, main, develop ] | ||
| pull_request: | ||
| branches: [ master, main, develop ] | ||
|
|
||
| jobs: | ||
| build-and-verify: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
|
|
||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Build with Gradle | ||
| run: ./gradlew build | ||
|
|
||
| - name: Verify 16KB Page Size Alignment | ||
| run: | | ||
| echo "🔍 Checking 16KB page size alignment of 64-bit native libraries..." | ||
|
|
||
| # Function to check alignment of a shared library | ||
| check_alignment() { | ||
| local lib_path="$1" | ||
| local lib_name=$(basename "$lib_path") | ||
|
|
||
| echo "Checking $lib_name..." | ||
|
|
||
| # Use llvm-readelf from NDK to check alignment | ||
| local ndk_path="$ANDROID_NDK_ROOT" | ||
| local readelf="$ndk_path/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readelf" | ||
|
|
||
| if [ ! -f "$readelf" ]; then | ||
| echo "❌ Error: llvm-readelf not found at $readelf" | ||
| return 1 | ||
| fi | ||
|
|
||
| # Check LOAD segments alignment | ||
| local alignments=$($readelf -l "$lib_path" | grep "LOAD" | awk '{print $NF}') | ||
|
|
||
| local all_aligned=true | ||
| for alignment in $alignments; do | ||
| # Convert hex to decimal | ||
| local decimal_alignment=$((alignment)) | ||
| local kb_alignment=$((decimal_alignment / 1024)) | ||
|
|
||
| echo " Segment alignment: $alignment ($decimal_alignment bytes = ${kb_alignment}KB)" | ||
|
|
||
| if [ $decimal_alignment -ne 16384 ]; then | ||
| echo " ❌ Not 16KB aligned (expected 0x4000 = 16384 bytes)" | ||
| all_aligned=false | ||
| else | ||
| echo " ✅ 16KB aligned" | ||
| fi | ||
| done | ||
|
|
||
| if [ "$all_aligned" = true ]; then | ||
| echo "✅ $lib_name is properly 16KB aligned" | ||
| return 0 | ||
| else | ||
| echo "❌ $lib_name has incorrect alignment" | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| # Find all .so files in build outputs (64-bit architectures only) | ||
| echo "Finding 64-bit native libraries in build outputs..." | ||
| so_files=$(find . -path "*/build/intermediates/cxx/*/obj/*/*.so" -type f | grep -E "(Release|RelWithDebInfo)" | grep -E "(arm64-v8a|x86_64)" | head -20) | ||
|
|
||
| if [ -z "$so_files" ]; then | ||
| echo "❌ No native libraries found in build outputs" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Found native libraries:" | ||
| echo "$so_files" | ||
| echo | ||
|
|
||
| # Check alignment for each library | ||
| all_libs_aligned=true | ||
| for so_file in $so_files; do | ||
| if ! check_alignment "$so_file"; then | ||
| all_libs_aligned=false | ||
| fi | ||
| echo | ||
| done | ||
|
|
||
| # Summary | ||
| echo "📊 Alignment Verification Summary:" | ||
| if [ "$all_libs_aligned" = true ]; then | ||
| echo "🎉 All native libraries are properly 16KB aligned!" | ||
| echo "✅ This build is compatible with 16KB page size devices" | ||
| else | ||
| echo "❌ Some libraries are not properly aligned" | ||
| echo "💡 Ensure you're using Android Gradle Plugin 8.5.1+ and target SDK 35+" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Verify AAR Contents | ||
| run: | | ||
| echo "🔍 Verifying AAR files contain native libraries..." | ||
|
|
||
| # Find AAR files | ||
| aar_files=$(find . -name "*.aar" -path "*/build/outputs/aar/*" -type f) | ||
|
|
||
| if [ -z "$aar_files" ]; then | ||
| echo "❌ No AAR files found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Found AAR files:" | ||
| for aar in $aar_files; do | ||
| echo "📦 $(basename $aar)" | ||
|
|
||
| # Check if AAR contains native libraries | ||
| native_libs=$(unzip -l "$aar" | grep -E "jni/.*\.so$" | wc -l) | ||
|
|
||
| if [ $native_libs -gt 0 ]; then | ||
| echo " ✅ Contains $native_libs native libraries" | ||
| echo " 📋 Native library details:" | ||
| unzip -l "$aar" | grep -E "jni/.*\.so$" | awk '{print " " $4}' | ||
| else | ||
| echo " ℹ️ No native libraries (library may be pure Java/Kotlin)" | ||
| fi | ||
| echo | ||
| done | ||
|
|
||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: build-outputs | ||
| path: | | ||
| **/build/outputs/aar/*.aar | ||
| **/build/intermediates/cxx/*/obj/*/*.so | ||
| retention-days: 7 | ||
|
|
||
| - name: Upload lint reports | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: lint-reports | ||
| path: | | ||
| **/build/reports/lint-results-*.html | ||
| retention-days: 7 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,5 @@ | |
| /captures | ||
| /local.properties | ||
| .externalNativeBuild | ||
| .cxx | ||
| .cxx | ||
| .java-version | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,20 @@ | ||
| DashJ BLS for Android | ||
| # DashJ BLS for Android | ||
|
|
||
| ```bash | ||
| git submodule update --init --recursive | ||
| ./gradlew build | ||
| ``` | ||
|
|
||
| Publish to Maven Local | ||
| ### Publish to Maven Local | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix markdown heading hierarchy. The sections use H3 (###) immediately after H1 (#), but markdown heading levels should increment by one level at a time. Change both to H2 (##) for proper hierarchy. -### Publish to Maven Local
+## Publish to Maven Local-### Publish to Maven Central
+## Publish to Maven CentralAlso applies to: 13-13 🧰 Tools🪛 markdownlint-cli2 (0.18.1)8-8: Heading levels should only increment by one level at a time (MD001, heading-increment) 🤖 Prompt for AI Agents |
||
| ``` | ||
| ./gradlew publishToMavenLocal | ||
| ``` | ||
|
Comment on lines
9
to
11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language specification to code block for consistency. The bash code block is missing a language tag. Add -```
+```bash
./gradlew publishToMavenLocal
-```
+```🧰 Tools🪛 markdownlint-cli2 (0.18.1)9-9: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
| Publish to Maven Central | ||
| ``` | ||
|
|
||
| ### Publish to Maven Central | ||
|
|
||
| To deploy to the maven repository: | ||
| ```bash | ||
| ./gradlew clean | ||
| ./gradlew publish | ||
| ./gradlew jreleaserDeploy | ||
| ``` | ||
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.
Reconsider the failure condition for missing AAR files.
The workflow exits with error if no AAR files are found (line 134). This will cause CI failures for Android app projects that don't produce AARs (libraries produce AARs, but apps produce APKs). The AAR verification step should be optional or conditional.
Example fix:
📝 Committable suggestion