summaryrefslogtreecommitdiff
path: root/golang/golang.go
AgeCommit message (Collapse)Author
2025-02-04Fixes for missing rules in m --soong-only Spandan Das
This CL 1. Disables filesystem diff test if there is no kati invocation, since there will not be a file_list.txt to do the comparison 2. Disables installation for goBinary if it is in an unexported namespace. Test: m checkbuild --soong-build (top of stack) Bug: 394096939 Change-Id: I5057c2cc431f5e8db12816c3dacf69b3159e18d5
2025-02-04Create install rule for loadplugins without adding to blueprint_tools Spandan Das
m checkbuild --soong-only currently runs into errors for "Test for dangling rules" since the install rule for loadplugins is not created in `m --soong-only`. In regular `m` builds kati generates the installation rule since `LOCAL_SOONG_INSTALLED_MODULE` for `loadplugins` is empty in the generated Android.mk file. To solve the missing rule in soong-only mode, always generate the installation rule. To prevent repeated reanalysis in `m`, do not add the installed file to `blueprint_tools`, which is a transitive dep of droid via droid_targets. Bug: 394096939 Test: m blueprint_tools && m blueprint_tools (second one is noop) Test: m checkbuild --soong-only (passes at top of stack) Change-Id: I202bb2fa31543f8e3acbe11a4732f6236cd3b71f
2024-10-28Support host-cross variant on golang modules Cole Faust
This doesn't actually add support for cross-compiling go modules, even when built on the cross-compile variant, the results will still just be built for the current host. However, it does make the variants of golang modules match up better with other host tools that are being built for a cross-compile variant. Bug: 369916167 Test: m nothing on aosp_cf_arm64_only_phone with aosp/3318965 Change-Id: I2245d09d2cfc9bcfb819d678cdae541dd87a441d
2024-10-04Remove cross compilation support from go packages Cole Faust
Go packages supported cross-compilation (to linux_musl at least), but go binaries did not. Go packages also add a reverse dependency onto the binary packages, which would cause a missing dependency error, except that all non-primary variants of go modules essentially disable themselves and reuse outputs from the primary variants. However, in mac builds, for some reason the primary variant is arm64 but the binary is only created for x86_64. This causes the missing dependency, but mac sets AllowMissingDependencies, but the missing dependencies still cause problems when generating soong documentation. After we submit this cl, we can potentially make the go modules not copy outputs from the primary variation, and instead have all variations work independently. Bug: 369916167 Test: m soong_docs on mac Change-Id: I967e63fc16f3b2a5cc1fa00ab62f5626b268c087
2024-09-12Fix reanalysis after full build Colin Cross
Blueprint bootstrap and Soong each create rules to install blueprint_go_binary modules to the same location, but with different command lines. Binaries used during bootstrap are installed using the bootstrap rule, but then get reinstalled during a full build via the blueprint_tools phony that is a dependency of droid. This changes the command line used for the rule stored in .ninja_log, and then on the next bootstrap ninja will rerun the binaries, triggering reanalysis. As a quick fix, don't create install rules for loadplugins and soong_build. A more permanent fix may be to move the bootstrap installation to a different location, but that will require more testing. Bug: 366291149 Test: m blueprint_tools && m blueprint_tools Flag; EXEMPT bugfix Change-Id: Ib7f2910976f4b5e6add2128ce0b2a5d10445a53c
2024-09-11Wrap blueprint_go_binary and bootstrap_go_package into android.Modules Colin Cross
Depending on a blueprint_go_binary from a Soong module requires hacks that allow Soong to support both blueprint.Module and android.Module. Wrap the blueprint Go module types with ones that implement android.Module, and delete all the related hacks. Bug: 319288033 Test: m checkbuild Flag: EXEMPT refactor Change-Id: I9b62b450de09bd10288333fbc66aa71c867ae0b3