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

Makes cursive and pancurses compile with v6 of ncurses-rs #220

Conversation

correabuscar
Copy link
Contributor

@correabuscar correabuscar commented Jun 6, 2024

This was originally made in PR #218 but now it's split off1 for easier reviewing and merging, because that PR also has a ton of build improvements too and it's too difficult to review.

With this PR, cursive and pancurses will compile afterwards but only if they also accept their own PRs which are gyscos/cursive#778 respectively ihalila/pancurses#93

Note, perhaps obvious to me, that currently cursive and pancurses cannot compile (without errors) with version 6.0.0 of ncurses-rs due to regressions that v6 introduced and also some incompatible changes, both of which this PR addresses, so they're stuck using version 5.101.0

Footnotes

  1. technically that PR still contains everything this PR, so merging that one doesn't require this one as well. Ideally, that one would be merged instead of this one, but hey, the option to not merge that one(at all, ever) is now available, if we only care about making cursive&pancurses use our version 6 as soon as possible(well, 2 months late anyway :D)

so that it can be used like this:
pub const KEY_F15: i32 = ncurses::KEY_F(15);
which is what pancurses uses.
or else they aren't defined.
(regression)
@correabuscar correabuscar changed the title Makes cursive and pancurses compile with v6 of us Makes cursive and pancurses compile with v6 of ncurses-rs Jun 6, 2024
correabuscar added a commit to correabuscar/cursive that referenced this pull request Jun 6, 2024
which means that ncurses-rs already has the
needed changes in this PR:
jeaye/ncurses-rs#220
and/or from this PR:
jeaye/ncurses-rs#218
correabuscar added a commit to correabuscar/cursive that referenced this pull request Jun 7, 2024
which means that ncurses-rs already has the
needed changes in this PR:
jeaye/ncurses-rs#220
and/or from this PR:
jeaye/ncurses-rs#218
correabuscar added a commit to correabuscar/cursive that referenced this pull request Jun 10, 2024
which means that ncurses-rs already has the
needed changes in this PR:
jeaye/ncurses-rs#220
and/or from this PR:
jeaye/ncurses-rs#218
correabuscar added a commit to correabuscar/cursive that referenced this pull request Jun 20, 2024
which means that ncurses-rs already has the
needed changes in this PR:
jeaye/ncurses-rs#220
and/or from this PR:
jeaye/ncurses-rs#218
@correabuscar

This comment was marked as outdated.

@jeaye
Copy link
Owner

jeaye commented Jul 12, 2024

Ah, thanks for the ping on this one. My apologies for being terrible about merging these things. 🤦 It's not your fault I've taken so long; just bad prioritization on my part.

If you're ok with this, I'm good to reopen this one and merge it without any change.

@correabuscar
Copy link
Contributor Author

correabuscar commented Jul 12, 2024

It's up to you really, but if this gets merged I'll reopen the ones from cursive and pancurses as they'll need it.

@correabuscar correabuscar reopened this Jul 12, 2024
@correabuscar
Copy link
Contributor Author

whoops, I reopened it myself, by mistake, just wanted to comment :) reopening is not up to me

@jeaye jeaye reopened this Jul 12, 2024
@jeaye jeaye merged commit e7c3e1f into jeaye:master Jul 12, 2024
@jeaye
Copy link
Owner

jeaye commented Jul 12, 2024

I've published this now. I also cherry-picked 7fd51d9, since it allowed me to build on NixOS. 😉

You've done a lot of great work with improving portability, in #220; the problem is that it's too much at once. But when I ran into issues building on NixOS, that PR was the first place I looked to see what you did to get NixOS working and if I could just cherry-pick it.

Similarly, if we're able to break it down further, and if you're interested, I think that'll make it easier to digest, review, and merge.

At any rate, thank you so much for both PRs and for the time you've put into this.

@correabuscar
Copy link
Contributor Author

correabuscar commented Jul 12, 2024

Ah you meant #218 . Can you please push your current repo state so that it reflects the published v6.0.1 crate on crates.io, the cherry pick isn't yet on github as far as I can tell, and I was wondering why did pancurses just compile for me on Gentoo when using v6.0.1 from crates.io, and that cherry pick explains it.

the problem is that it's too much at once. But when I ran into issues building on NixOS, that PR was the first place I looked to see what you did to get NixOS working and if I could just cherry-pick it.
Similarly, if we're able to break it down further, and if you're interested, I think that'll make it easier to digest, review, and merge.

Good feedback, now I'll know this for the future, also @ vwbusguy told me something similar in this comment but I had already done most of the work by that time and it kinda felt too interconnected to just split into PRs, better to know just what to remove or refactor at that point. I'll see if and what I can do about whatever was left, to only make tiny PRs that can be easy, can't promise that I will do anything though.(atm, it's best to assume that I won't)

For NixOS there were later changes too, for sure the one with the shell.nix file fixed a bunch of stuff, I don't even remember at the moment.

@jeaye
Copy link
Owner

jeaye commented Jul 12, 2024

You're right, I meant #218. Everything's been pushed now!

correabuscar added a commit to correabuscar/cursive that referenced this pull request Jul 12, 2024
which means that ncurses-rs already has the
needed changes in this PR:
jeaye/ncurses-rs#220
and/or from this PR:
jeaye/ncurses-rs#218
@vwbusguy
Copy link

Thanks @correabuscar and @jeaye !!

gyscos added a commit to gyscos/cursive that referenced this pull request Jul 12, 2024
* make it work with ncurses-rs >=6.0.1

which means that ncurses-rs already has the
needed changes in this PR:
jeaye/ncurses-rs#220
and/or from this PR:
jeaye/ncurses-rs#218

* get rid of a warning when using newterm

newterm https://github.com/jeaye/ncurses-rs/blob/3aa22bc279e4929e3ab69d49f75a18eda3e431e9/src/lib.rs#L1023-L1029
CString::new https://doc.rust-lang.org/std/ffi/struct.CString.html#method.new

bubble up this newterm error

as suggested here: #778 (comment)

Co-authored-by: Alexandre Bury <[email protected]>

preserve original error in the panic report

otherwise, we'd not know why ncurses-rs newterm errored

directly include the variable name in the format! expression

as suggested here: #778 (comment)

Co-authored-by: Alexandre Bury <[email protected]>

* get rid of unused warning for addstr

---------

Co-authored-by: Alexandre Bury <[email protected]>
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.

3 participants