Skip to content
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

F-Droid #692

Open
linsui opened this issue Dec 20, 2024 · 28 comments
Open

F-Droid #692

linsui opened this issue Dec 20, 2024 · 28 comments

Comments

@linsui
Copy link

linsui commented Dec 20, 2024

Could you please publish naiveproxy plugin on F-Droid? :)

@klzgrad
Copy link
Owner

klzgrad commented Dec 21, 2024

Who will use it?

How to do it?

Who will support this work?

@linsui
Copy link
Author

linsui commented Dec 21, 2024

Since exclave will be published to F-Droid soon, its users can use this plugin. I'll do the package work but I may need your help.

@klzgrad
Copy link
Owner

klzgrad commented Dec 21, 2024

I'd prefer to have an F-Droid update process as automated as possible.

What changes are needed in this repo?

@linsui
Copy link
Author

linsui commented Dec 21, 2024

F-Droid can't calculate the version code. It can only extract it with a regex. You can put a file with the version code in release.

@klzgrad
Copy link
Owner

klzgrad commented Dec 21, 2024

Can it discern version codes from git tag names?

@linsui
Copy link
Author

linsui commented Dec 21, 2024

It can extract the version code from the tag name with regex.

@klzgrad
Copy link
Owner

klzgrad commented Dec 22, 2024

The current way to make a version code is this https://github.com/klzgrad/naiveproxy/blob/master/apk/app/build.gradle.kts#L34

Chromium releases vMAJOR.MINOR.BUILD.PATCH. On each major release I will rebase the patches, and with possible bug fixes, it becomes vMAJOR.MINOR.BUILD.PATCH-DownstreamPatch. E.g. for Chromium v131.0.6778.86, I will rebase the code to create a v131.0.6778.86-1. If there is an important bug fix in the same major release cycle that requires user upgrade, I will release v131.0.6778.86-2.

So the apk version code is currently derived from tag names and calculated as major * 10 + downstream_patch. v131.0.6778.86-1 -> 1311. v131.0.6778.86-2 -> 1312. I don't use 0 for downstream_patch and I don't expect there will be more than 9 downstream_patch release.

I'd prefer extracting version code from tag names so I don't have to edit a special version code file on each tag release.

@linsui
Copy link
Author

linsui commented Dec 22, 2024

Regex can't extract 1312 from v131.0.6778.86-2. 🤷 You can generate the file in CI.

@klzgrad
Copy link
Owner

klzgrad commented Dec 22, 2024

Regex can't extract 1312 from v131.0.6778.86-2

Why

@linsui
Copy link
Author

linsui commented Dec 22, 2024

Currently F-Droid can only extract one match group. It can't concatenate 131 with 2.

@klzgrad
Copy link
Owner

klzgrad commented Dec 23, 2024

How does fdroid extract this thing? Where is the code for this?

@linsui
Copy link
Author

linsui commented Dec 23, 2024

https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/checkupdates.py?ref_type=heads#L212 It just uses re.search and takes the first match group.

@klzgrad
Copy link
Owner

klzgrad commented Dec 24, 2024

You can generate the file in CI.

How can I do this? Can you show me which line in https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/checkupdates.py?ref_type=heads#L212 read the generated file?

@linsui
Copy link
Author

linsui commented Dec 24, 2024

It can use a path or a url to get the file. The related code is https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/checkupdates.py#L79. If you, e.g., put the version code in versionCode.txt in release, then the url will be https://github.com/klzgrad/naiveproxy/releases/latest/download/versionCode.txt. You can also put the version code in the release note so we can use https://github.com/klzgrad/naiveproxy/releases/latest directly.

@klzgrad
Copy link
Owner

klzgrad commented Dec 24, 2024

@linsui
Copy link
Author

linsui commented Dec 25, 2024

Yes, it does. :)

@linsui
Copy link
Author

linsui commented Dec 25, 2024

If I don't need to test it, I don't need to get sys image, right? I thought clang and gn need to be built from source. Are there any other bianries used in the build?

@linsui
Copy link
Author

linsui commented Dec 26, 2024

Another problem is that it uses the same appid as the plugin of sagernet. Is it transferred? CC @nekohasekai

It's better if it can use a different appid.

@klzgrad
Copy link
Owner

klzgrad commented Dec 26, 2024

Using the same appid is meant for compatibility with Sagernet successors.

I think by this time it is right to "transfer" the control of the id to me as I'm the defacto maintainer of the appid, and this appid is only used for Sagernet successors.

@nekohasekai can make a statement for that.

@nekohasekai
Copy link

sagernet is deprecated and no longer maintained, so you don't need to worry about compatibility, just contact the author of the fork to take care of everything.

@klzgrad
Copy link
Owner

klzgrad commented Dec 27, 2024

Keeping the appid unchanged is for maintaining compatibility with Sagernet successors, not Sagernet itself.

It is not better to change the appid for no reason. And whatever administrative reason does not justify breaking compatibility.

@linsui
Copy link
Author

linsui commented Dec 29, 2024

I'm trying to build clang. Do I have to use the clang for chromium? If it's necessary, could you please add https://chromium.googlesource.com/chromium/src/+/main/tools/clang/scripts/build.py to the repo?

@klzgrad
Copy link
Owner

klzgrad commented Dec 30, 2024

Why build Clang? If you trust various sources and binaries provided by Google, you already trust Google built Clang. I don't think this is time worth spending.

If you've got build.py working I can add it to the repo.

@linsui
Copy link
Author

linsui commented Dec 30, 2024

Is there any other binaries needed to be built? It's easy to build gn and NDK is trusted (or allowed) by F-Droid.

@klzgrad
Copy link
Owner

klzgrad commented Dec 30, 2024

PGO profiles. Debian sysroots. A previously Google built Clang to bootstrap the current Clang.

@linsui
Copy link
Author

linsui commented Dec 30, 2024

I'm going to use system clang to build the chromium clang. PGO profiles are data which is OK. I'll have to patch build.py a little though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants