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

Fix mobile builds #1108

Draft
wants to merge 6 commits into
base: haskell.nix
Choose a base branch
from
Draft

Fix mobile builds #1108

wants to merge 6 commits into from

Conversation

alexfmpe
Copy link
Collaborator

I have:

  • Based work on latest develop branch
  • Followed the contribution guide
  • Looked for lint in my changes with hlint . (lint found code you did not write can be left alone)
  • Run the test suite: $(nix-build -A selftest --no-out-link)
  • Updated the changelog
  • (Optional) Run CI tests locally: nix-build release.nix -A build.x86_64-linux --no-out-link (or x86_64-darwin on macOS)

@alexfmpe alexfmpe changed the title Haskell.nix platforms Fix mobile builds Dec 19, 2024
skeleton/default.nix Show resolved Hide resolved
# A simple derivation that just creates a file with the names of all
# of its inputs. If built, it will have a runtime dependency on all
# of the given build inputs.
pinBuildInputs = name: buildInputs: (local-self.nixpkgs.releaseTools.aggregate {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed from reflex-platform. Not sure if intentional

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wasn't needing them while doing the haskell.nix work. I don't think we need them in reflex-platform anymore but pulling it into the obelisk nix is fine by me

@@ -55,7 +54,7 @@ let
});

perPlatform = lib.genAttrs cacheBuildSystems (system: let
reflex-platform = import ./dep/mars { inherit system __useNewerCompiler; };
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gives me eval errors

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you could post those errors that'd be great!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inherit iosSkeleton;
} // lib.optionalAttrs (system == "x86_64-linux") {
android-app = rawSkeleton.android.app.aarch64;
} // lib.optionalAttrs (system == "x86_64-darwin") {
Copy link
Collaborator Author

@alexfmpe alexfmpe Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

androidSupport/iosSupport are gone:
https://github.com/reflex-frp/reflex-platform/blob/20a0a01ec32a747106cb22605832cb57f6fb62ca/default.nix#L106-L107

For now I mirrored what's in
https://github.com/reflex-frp/reflex-platform/blob/20a0a01ec32a747106cb22605832cb57f6fb62ca/release.nix#L15-L20
but it's strange that the logic for whether a platform is supported be pushed on users

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm the ghcShell failure on darwin is interesting, I think we'll be okay disabling it (for now at least) but maybe we should be disabling webkit2gtk for darwin..

dep/mars/github.json Outdated Show resolved Hide resolved
@alexfmpe alexfmpe force-pushed the haskell.nix-platforms branch from 5b3ff5d to 8e2b84c Compare December 20, 2024 01:21
@alexfmpe alexfmpe force-pushed the haskell.nix-platforms branch 2 times, most recently from 5e4f911 to cc748ca Compare December 20, 2024 01:48
@alexfmpe alexfmpe mentioned this pull request Dec 20, 2024
6 tasks
@alexfmpe alexfmpe force-pushed the haskell.nix-platforms branch from cc748ca to 86d56e8 Compare December 20, 2024 01:50
frameworks =
if (pkgs.stdenv.targetPlatform.isiOS) then lib.mkForce [ pkgs.darwin.iosSdkPkgs.sdk pkgs.darwin.apple_sdk.frameworks.CoreFoundation ]
else [ pkgs.darwin.apple_sdk.frameworks.CoreFoundation ];
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was getting webkit2gtk eval failures on android so cargo-culted this section from https://github.com/reflex-frp/reflex-platform/blob/4fccfb196ac724695a5006a456b2125eeff331e5/example/default.nix#L62

We definitely don't want this re-done on every project.
Something more like, shoved into a trivially importable overlay on reflex-platform?
Could maybe have it implicitly applied by obelisk, but then what happens on module conflicts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the linked code should always be applied in obelisk (not so much in reflex-platform). If folks need to overwrite it they can use "lib.mkOverride" for a higher value than "lib.mkForce". I'd much rather this be a default instead of some documentation or comments anywhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well yes but a default on obelisk or on the obelisk skeleton?

@alexfmpe alexfmpe force-pushed the haskell.nix-platforms branch from 86d56e8 to f44cf14 Compare December 20, 2024 02:08
@alexfmpe alexfmpe requested a review from cidkidnix December 20, 2024 02:12
# https://developer.android.com/studio/terms in order to build Android apps.
# Uncomment this to indicate your acceptance:
android_sdk_accept_license = true;
allowUnfree = true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be set to false before merging.
How do we make sure CI caches it though?
Add the accept/allow as args to this file defaulting to false and overriden by CI?

frameworks =
if (pkgs.stdenv.targetPlatform.isiOS) then lib.mkForce [ pkgs.darwin.iosSdkPkgs.sdk pkgs.darwin.apple_sdk.frameworks.CoreFoundation ]
else [ pkgs.darwin.apple_sdk.frameworks.CoreFoundation ];
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well yes but a default on obelisk or on the obelisk skeleton?

@@ -55,7 +54,7 @@ let
});

perPlatform = lib.genAttrs cacheBuildSystems (system: let
reflex-platform = import ./dep/mars { inherit system __useNewerCompiler; };
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

2 participants