Skip to content

Conversation

@julius-boettger
Copy link
Contributor

Adds a flake to the cross-mingw example.

Without mkRustBin for now, as I was not able to understand what benefit(s) it brings me, plus I find the syntax more difficult to read/understand.

Let me know if you would like this flake to use mkRustBin too, and if you're extra nice, attempt to explain why one should use it 😄

But even then, it might be nice to have (at least) one flake example that shows how it could look without mkRustBin.

@oxalica
Copy link
Owner

oxalica commented May 9, 2025

Can we also add CI tests for this, like the (cross-aarch64, flake) tuple? Previously I found MinGW tests on unstable sometimes does not work. Hope a locked flake test can mitigate it.

matrix:
# FIXME: cross-mingw is flaky on latest nixpkgs (shell) without lockfile.
example: [cross-aarch64, cross-wasi]
kind: [shell]
include:
- example: cross-aarch64
kind: flake

Copy link
Owner

@oxalica oxalica left a comment

Choose a reason for hiding this comment

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

Let me know if you would like this flake to use mkRustBin too, and if you're extra nice, attempt to explain why one should use it 😄

mkRustBin is a non-overlay interface. Overlay interface is only efficient when there is only a single import nixpkgs with all overlays applied at once, this may not be possible when you have a very complex flake dependency graph and dependency flakes are using their own nixpkgs, causing overlays to import nixpkgs multiple times with the cost of eval time.

In this example there is obviously only one import nixpkgs, so I don't have a strong opinion on it. You can keep import nixpkgs for now.

@oxalica oxalica added the documentation Improvements or additions to documentation label May 9, 2025
@julius-boettger
Copy link
Contributor Author

mkRustBin is a non-overlay interface. Overlay interface is only efficient when there is only a single import nixpkgs with all overlays applied at once, this may not be possible when you have a very complex flake dependency graph and dependency flakes are using their own nixpkgs, causing overlays to import nixpkgs multiple times with the cost of eval time.

In this example there is obviously only one import nixpkgs, so I don't have a strong opinion on it. You can keep import nixpkgs for now.

Thank you for the explanation! I get it now. Then I would like to leave it as-is.

@julius-boettger
Copy link
Contributor Author

Can we also add CI tests for this, like the (cross-aarch64, flake) tuple? Previously I found MinGW tests on unstable sometimes does not work. Hope a locked flake test can mitigate it.

matrix:
# FIXME: cross-mingw is flaky on latest nixpkgs (shell) without lockfile.
example: [cross-aarch64, cross-wasi]
kind: [shell]
include:
- example: cross-aarch64
kind: flake

Sure, although I don't have any experience with GitHub workflows. Would something like this already do the job?

        include:
          - example: cross-aarch64
            kind: flake
+         - example: cross-mingw
+           kind: flake

If it's more complex, it might be faster for someone who has worked with GitHub workflows before to do it in a separate PR instead.

@julius-boettger
Copy link
Contributor Author

Can we also add CI tests for this, like the (cross-aarch64, flake) tuple? Previously I found MinGW tests on unstable sometimes does not work. Hope a locked flake test can mitigate it.

On another note: What do you mean by "locked" flake test? I did not push the flake.lock this flake.nix currently generates, as I saw that examples/cross-aarch64 also does not contain a flake.lock. Should I push it? Or are you talking about something else?

@julius-boettger julius-boettger requested a review from oxalica May 13, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants