wireguard-android icon indicating copy to clipboard operation
wireguard-android copied to clipboard

tools: fixup the CMake custom command for elf-cleaner to correctly find sources

Open tturner opened this issue 2 years ago • 5 comments

This is a tiny change to allow elf-cleaner to build correctly during assembleRelease.

Without this I got failures to find these files with the latest Android Studio (and on the command line) - the glob found no files so the build command was malformed.

tturner avatar Jun 11 '23 14:06 tturner

I haven't run into a build error yet but this is a good change even for consistency sake, merged as 1ba84e0568586936de2c09d9637d81e54091afca

msfjarvis avatar Jun 11 '23 18:06 msfjarvis

Wondering how to repro this. Do you run gradle from a different CWD or something?

zx2c4 avatar Jun 13 '23 14:06 zx2c4

I didn't think I was doing anything particularly unusual. Fairly vanilla Debian 12 (no custom shell). Installed latest beta? of the android studio (Hedgehog) because that seemed to be needed for the latest commits on master (I got errors relating to the agp alpha version when I tried the normal android studio release).

I had that download the android SDK and then used ANDROID_HOME env to point to the sdk directory. I then ran the command from the readme in the base directory of the cloned repo.

I'm not sure why it is different from your experience but the general recommendation is to make cmake builds agnostic to the folder they are built in and the old version of that cmake command assumed that the custom command was running in the source folder which isn't guaranteed by cmake.

tturner avatar Jun 13 '23 20:06 tturner

Well, there are two other GLOBs in there that aren't doing this. So that's a bit puzzling. I think I'd like to see some analysis of what's happening here. AFAICT, what was there before should be correct already and seems standard practice.

zx2c4 avatar Jun 13 '23 21:06 zx2c4

No reply from you or further research so I'm going to revert the commit until the right time.

zx2c4 avatar Jun 21 '23 18:06 zx2c4

Closing for inactivity, still haven't hit the build error so I assume it's not a general problem.

msfjarvis avatar Sep 19 '25 18:09 msfjarvis