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

Flake outputs are misleading. #3

Open
shymega opened this issue Sep 3, 2024 · 10 comments
Open

Flake outputs are misleading. #3

shymega opened this issue Sep 3, 2024 · 10 comments

Comments

@shymega
Copy link

shymega commented Sep 3, 2024

The Flake is misleading. Packages should be system-specific, and not expose attrs of more systems.

Below is a screenshot. I would propose arm64-linux and x86_64-windows to be moved up a level.

notright

@shymega
Copy link
Author

shymega commented Sep 3, 2024

NB: I'm happy to make a PR. The issue is reproducible with Himalaya as well.

@soywod
Copy link
Member

soywod commented Sep 3, 2024

The structure is not well documented yet, but the first level correspond to host platforms, the second the cross platforms. From x86_64-linux, you can cross compile for x86_64-linux, arm64-linux and also x86_64-windows. I like the structure, it took me a while to set it up correctly. It just needs to be better documented and fixed (somehow does not work properly since last upgrade).

@shymega
Copy link
Author

shymega commented Sep 3, 2024

Ah... I see. Okay. That makes sense. Maybe, just to make it clear for people, you could add - either a prefix or a suffix - -cross.

That way it's obvious it's for cross-compiling. What are your thoughts on that?

@soywod
Copy link
Member

soywod commented Sep 3, 2024

It allows this kind of things in CI, which I find great and I would like to keep it. It makes builds more predictable and reproducible.

@shymega
Copy link
Author

shymega commented Sep 3, 2024

Agreed. Wouldn't a suffix/prefix be relatively easy to adjust in CI as well, though? I mean, it wouldn't be 'typical' user-facing, only for those like me who inspect the Flake, and even then, with documentation in the flake, it would be explained.

@soywod
Copy link
Member

soywod commented Sep 3, 2024

Maybe, just to make it clear for people, you could add - either a prefix or a suffix - -cross.

Yes indeed, I like the proposition!

@shymega
Copy link
Author

shymega commented Sep 3, 2024

Would you like me to make a PR?

Actually, I think it's best you do this. The Flake looks rather complex.

@soywod
Copy link
Member

soywod commented Sep 4, 2024

As you wish. It should not take long for me to fix it, I already put my nose in recently. Thank you for proposing, feel free to submit other PRs if you want!

@shymega
Copy link
Author

shymega commented Sep 11, 2024

I've been thinking about this some more.

I may be wrong, but I believe nix/nixpkgs does support system attributes,
such as: x86_64-windows, and aarch64-darwin.

We could refactor the Flake here (and on the other projects) to export the
nested attributes up a level. It should work with Nix, but you may want to
check on the forums.

I think this would be simpler than the current approach and/or adding a
-cross suffix.

I suppose the ultimate goal is to upstream to Nixpkgs, right?

@soywod
Copy link
Member

soywod commented Sep 18, 2024

Sorry, I realized I've never replied to you.

I think this would be simpler than the current approach and/or adding a -cross suffix.

Should be definitely enough, would you like to propose a PR?

I suppose the ultimate goal is to upstream to Nixpkgs, right?

It's already available on Nixpkgs, but with another derivation. The best would be to use the same between both, do you think it's doable?

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