zaneschepke / wgtunnel

An alternative Android client app for WireGuard VPN
https://zaneschepke.com/wgtunnel-docs
MIT License
915 stars 47 forks source link

F-Droid can't build #47

Closed licaon-kter closed 3 months ago

licaon-kter commented 1 year ago

ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/5362089442#L1173

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/8bc2d4275aedf2e613f4faafab182d3f0a3dea94

licaon-kter commented 1 year ago

Please reopen, now there's gms classes :( ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/5392493797#L583

I tried cleaning some more

      - sed -i -e '/com.google.gms/d' -e '/com.google.firebase/d' -e '/libs.google/d'
        -e '/libs.firebase/d' build.gradle.kts
      - sed -i -e '/libs.google.services/d' -e '/libs.firebase/d' ../build.gradle.kts
      - sed -i -e '/firebase/d' -e '/google-services/d' ../gradle/libs.versions.toml

but still

...
2023-10-27 15:39:52,542 DEBUG: Problem: found class 'com/google/android/gms/common/GooglePlayServicesIncorrectManifestValueException'
2023-10-27 15:39:52,544 DEBUG: Problem: found class 'com/google/android/gms/common/GooglePlayServicesMissingManifestValueException'
2023-10-27 15:39:52,545 DEBUG: Problem: found class 'com/google/android/gms/common/api/Status'
2023-10-27 15:39:52,545 DEBUG: Problem: found class 'com/google/android/gms/common/util/DynamiteApi'
2023-10-27 15:39:52,545 DEBUG: Problem: found class 'com/google/android/gms/common/GooglePlayServicesManifestException'
2023-10-27 15:39:52,546 DEBUG: Problem: found class 'com/google/android/gms/common/api/internal/LifecycleCallback'
2023-10-27 15:39:52,546 DEBUG: Problem: found class 'com/google/android/gms/common/api/Scope'
2023-10-27 15:39:52,547 DEBUG: Problem: found class 'com/google/android/gms/common/annotation/KeepName'
2023-10-27 15:39:52,548 DEBUG: Problem: found class 'com/google/android/gms/common/api/GoogleApiActivity'
2023-10-27 15:39:52,549 DEBUG: Problem: found class 'com/google/android/gms/dynamite/DynamiteModule'
2023-10-27 15:39:52,549 DEBUG: Problem: found class 'com/google/android/gms/common/internal/ReflectedParcelable'
2023-10-27 15:39:52,554 DEBUG: Problem: found class 'com/google/android/gms/auth/api/signin/GoogleSignInAccount'
2023-10-27 15:39:52,557 CRITICAL: Found 12 problems in build/com.zaneschepke.wireguardautotunnel/app/build/outputs/apk/fdroid/release/app-fdroid-release-unsigned.apk

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/6a1495f8c8100e641a82366bc0256dad1bcad216

zaneschepke commented 1 year ago

Thank you. I will look into this

licaon-kter commented 8 months ago

Which lib are you rebuilding exactly ? https://github.com/zaneschepke/wgtunnel/commit/2690ce29e12ae50ece65aef32d43bb869c5872a2 how?

We need to rebuild the same for F-Droid: https://gitlab.com/fdroid/fdroiddata/-/jobs/6202532336#L1008

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/a9fd00deb938436063bb9eaf1e317a2cc439c87a

zaneschepke commented 8 months ago

Which lib are you rebuilding exactly ? 2690ce2 how?

We need to rebuild the same for F-Droid: https://gitlab.com/fdroid/fdroiddata/-/jobs/6202532336#L1008

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/a9fd00deb938436063bb9eaf1e317a2cc439c87a

I'm still in the process of getting the lib into Maven Central. The lib was failing to publish to jitpack because they do not support recursive cloning. This lib is currently being pulled into the app from here using GitHub Packages, but GitHub Packages ridiculously requires auth to get packages. Anyone can use the package, it just requires they create a readpackages role personal access token to read the package.

repositories {
        maven {
            name = "GitHubPackages"
            url = uri("https://maven.pkg.github.com/zaneschepke/wireguard-android")
            credentials {
                username = getLocalProperty(GITHUB_USER_VAR) ?: System.getenv(GITHUB_USER_VAR)
                password = getLocalProperty(GITHUB_TOKEN_VAR) ?: System.getenv(GITHUB_TOKEN_VAR)
            }
        }
licaon-kter commented 8 months ago

ping us when it's live in Maven

licaon-kter commented 8 months ago

ok, so looking at https://github.com/zaneschepke/wgtunnel/blob/3.3.8/gradle/libs.versions.toml#L85 I should find a tag 1.1.0 at https://github.com/zaneschepke/wireguard-android/tags ?

I'd like to build your fork https://github.com/zaneschepke/wgtunnel/blob/3.3.8/README.md#building but I need a point of reference

licaon-kter commented 8 months ago

how do we skip all the publishing part of your fork?

  - versionName: 3.3.8
    versionCode: 33800
    commit: ee8db0a859778308ca584486a6d551a341b5b365
    subdir: app
    sudo:
      - apt-get update
      - apt-get install -y gcc g++ maven
      - apt-get install -y openjdk-17-jdk-headless
      - update-alternatives --auto java
    gradle:
      - fdroid
    srclibs:
      - wireguard-android-zaneschepke@161b73a35e3a92d9e58eb807b4e633d5c43f0825
    prebuild:
      - sed -i -e '/com.google.gms/d' -e '/com.google.firebase/d' -e '/libs.androidx.core.google.shortcuts/d'
        build.gradle.kts
      - sed -i -e '/libs.google.services/d' -e '/libs.firebase/d' ../build.gradle.kts
      - sed -i -e '/maven {/,/^        }/d' ../settings.gradle.kts $$wireguard-android-zaneschepke$$/tunnel/build.gradle.kts
    build:
      - cd $$wireguard-android-zaneschepke$$
      - gradle publishToMavenLocal

fails with

...
> Task :tunnel:javaDocReleaseJar
> Task :tunnel:generateMetadataFileForReleasePublication
Could not write standard input to command 'gpg'.
java.io.IOException: Broken pipe
        at java.base/java.io.FileOutputStream.writeBytes(Native Method)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:349)
        at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
        at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
        at org.gradle.process.internal.streams.ExecOutputHandleRunner.writeBuffer(ExecOutputHandleRunner.java:98)
        at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:85)
        at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:64)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)

> Task :tunnel:signReleasePublication FAILED
gpg: directory '/home/vagrant/.gnupg' created
gpg: keybox '/home/vagrant/.gnupg/pubring.kbx' created
gpg: no default secret key: No secret key
gpg: signing failed: No secret key

FAILURE: Build failed with an exception.
zaneschepke commented 8 months ago

I think instead of building the forked lib it would be easier to just add these env vars to the pipeline

      GH_USER: ${{ secrets.GH_USER }}
      GH_TOKEN: ${{ secrets.GH_TOKEN }}

The lib is already built and published to github packages, it is just stupid github requires read packages personal access token to get the package. Any valid github user can get the package with a valid read packages personal access token.

I should have the lib on maven central soon which will solve this issue.

licaon-kter commented 8 months ago

F-Droid needs to build, since it's not (yet) in one on the trusted repos: https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/scanner.py#L457-L475

anyway, I'll stop trying and wait for your maven publish then, sorry for the noise

zaneschepke commented 8 months ago

Package is available on Maven Central now. This should fix the build issue. Thank you for reaching out!

licaon-kter commented 8 months ago

Done, thanks https://gitlab.com/fdroid/fdroiddata/-/commit/a8c5fc537d563518f86484cd15c8dcb5094003b0

licaon-kter commented 8 months ago

Can we reopen?

...
> Task :app:checkFdroidReleaseAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkFdroidReleaseAarMetadata'.
> Could not resolve all files for configuration ':app:fdroidReleaseRuntimeClasspath'.
   > Could not find com.zaneschepke:pin_lock_compose:1.0.3.
     Searched in the following locations:
       - file:/home/vagrant/.m2/repository/com/zaneschepke/pin_lock_compose/1.0.3/pin_lock_compose-1.0.3.pom
       - https://dl.google.com/dl/android/maven2/com/zaneschepke/pin_lock_compose/1.0.3/pin_lock_compose-1.0.3.pom
       - https://repo.maven.apache.org/maven2/com/zaneschepke/pin_lock_compose/1.0.3/pin_lock_compose-1.0.3.pom
     Required by:
         project :app

ref: https://mvnrepository.com/artifact/com.zaneschepke does not have it

ref: https://github.com/zaneschepke/wgtunnel/commit/5946d7c10d195e6ddefe12b0666b64955130ae16#diff-5625e3601fa0ad3a6a2824239e5a2fde71c149597d31394f9224a08c24be7b9dR14

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/419b5cb18abaf7cdba9c05260f401cb0e1004552

zaneschepke commented 7 months ago

The lib has been added to maven central. The app should be able to build now.

licaon-kter commented 7 months ago

thanks https://gitlab.com/fdroid/fdroiddata/-/commit/289525dd8979a90d19516a62757ce8fe7710e261

licaon-kter commented 3 months ago

Hmm, do reopen

https://gitlab.com/fdroid/fdroiddata/-/jobs/7445363327#L1194

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/f25bc60d5e4b438e516bc85bc50d20a25274c09f

zaneschepke commented 3 months ago

Hmm, do reopen

https://gitlab.com/fdroid/fdroiddata/-/jobs/7445363327#L1194

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/f25bc60d5e4b438e516bc85bc50d20a25274c09f

Thanks for the heads up!

https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15494