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

Android frontend should only get frontend + common configs #1118

Open
augyg opened this issue Mar 11, 2025 · 1 comment
Open

Android frontend should only get frontend + common configs #1118

augyg opened this issue Mar 11, 2025 · 1 comment

Comments

@augyg
Copy link
Contributor

augyg commented Mar 11, 2025

While inspecting the outputs from ob deploy test android I noticed that my backend configs were copied in

deployMobile seems to just grab all configs including backend.

Image

unless I'm mistaken and there is some reason that these configs are needed

@alexfmpe
Copy link
Collaborator

alexfmpe commented Mar 11, 2025

Wasn't able to reproduce this with nix-build -A android.frontend on the source directory.
In fact, adding backend configs doesn't even cause rebuilds.
That makes sense to me since config/backend is explicitly filtered out

obelisk/default.nix

Lines 299 to 308 in 135bfd7

privateConfigDirs = ["config/backend"];
injectableConfig = builtins.filterSource (path: _:
!(lib.lists.any (x: hasPrefix (toString self.base + "/" + toString x) (toString path)) self.privateConfigDirs)
);
__androidWithConfig = configPath: {
${if self.userSettings.android == null then null else self.frontendName} = {
executableName = "frontend";
${if builtins.pathExists self.userSettings.staticFiles then "assets" else null} =
nixpkgs.obeliskExecutableConfig.platforms.android.inject
(self.injectableConfig configPath)

However, when this util is called by ob deploy test android
, "staticSrc = (passthru.__androidWithConfig ", configDir, ").frontend.staticSrc;"
, "assets = (passthru.__androidWithConfig ", configDir, ").frontend.assets;"

path ends up taking the value of configPath which comes from configDir which is

configDir = root </> "config"

where root is the deploy directory while self.base is the directory specified in default.nix of the source directory (typically ./.)

So I think that causes the prefix check to fail and config/backend to be included.
Probably the same is happening for ob deploy test ios

I'm not sure why root and base are being used here.
Shouldn't everything be made relative to config instead for comparisons?

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

2 participants