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

Plan9 port to Bill-Gray fork #172

Merged
merged 11 commits into from
Jul 10, 2020
Merged

Conversation

staalmannen
Copy link
Contributor

Dear, I saw that you had far more target platforms than upstream PDCurses so I was thinking that you might be interested in Plan9 too...

@GitMensch
Copy link
Collaborator

I like that idea in general. In any case this likely still needs some time to be in a state where I'd find it possible to pull (which is of course @Bill-Gray's decision in any case).

I'll drop some notes in the suggested file changes in the meantime.

Copy link
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

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

The general approach looks fine. I suggest to first check if there's a possible CI build option for Plan9/pcc, otherwise this port may be broken now or at any time later.

Some documentation stuff (starting with comments, extending to the Makefile and C headers, ending in the README) should be updated before the port, too.

Question @staalmannen: did you recheck all the demos? Can you share screenshots?
Do you know if there was a PR to PDCurses before and if yes can reference it?

demos/mkfile Outdated Show resolved Hide resolved
plan9/README.Plan9 Outdated Show resolved Hide resolved
plan9/header.patch Outdated Show resolved Hide resolved
plan9/pdcplan9.c Outdated Show resolved Hide resolved
demos/mkfile Outdated
tuidemo\
worm\
xmas\

Copy link
Collaborator

Choose a reason for hiding this comment

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

misses the newer demos, newtest, speed and possibly picsview

Copy link
Contributor Author

Choose a reason for hiding this comment

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

speed could not be built since I am missing sys/timeb.h

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you check with an option to build without sys/timeb.h? Maybe @benavento has an idea?

Copy link
Owner

Choose a reason for hiding this comment

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

sys/timeb.h is required by ftime(), for which the man page says

This function is obsolete.  Don't use it... gettimeofday(2)
gives microseconds;...

(Which is my fault; I wrote speed.c.) I'll revise the code to use gettimeofday().

Copy link
Owner

Choose a reason for hiding this comment

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

Should work now (see commit 0b34997). Turns out my use of ftime() was not totally stupid; in fact, that was the only solution that works on some older compilers, and we can't get rid of it completely. But it's now only used on those older compilers, and it should compile/run correctly everywhere, including Plan9.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@staalmannen can you please update from master, add the speed demo and test it on plan9?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

speed now builds (I got 19 fps). I had to disable wchar.h since that is not present by default, but it seems like nothing in speed.c depended on it.

Copy link
Owner

Choose a reason for hiding this comment

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

You are correct. Compiled speed.c without wchar.h on X11, VT, DOS, DOSVGA, SDL1, SDL2, and WinGUI, and everything worked. I've removed that line (commit 348d53f).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok great! I will just import that one so that there are no merge conflicts if you decide to take this pull request.

@staalmannen
Copy link
Contributor Author

I like that idea in general. In any case this likely still needs some time to be in a state where I'd find it possible to pull (which is of course @Bill-Gray's decision in any case).

I'll drop some notes in the suggested file changes in the meantime.

The general approach looks fine. I suggest to first check if there's a possible CI build option for Plan9/pcc, otherwise this port may be broken now or at any time later.

Some documentation stuff (starting with comments, extending to the Makefile and C headers, ending in the README) should be updated before the port, too.

Question @staalmannen: did you recheck all the demos? Can you share screenshots?
Do you know if there was a PR to PDCurses before and if yes can reference it?

Yes. In fact I directly imported the Plan9-related files from that PR ( wmcbrine/PDCurses#93 ). I did not expect that the two had diverged so much. I will definitely have to fix up the code specifically for the Bill-Gray fork and test-compile the new demos.

As soon as I have access to my Plan9 VM again I will try it and let you know if it works.

@staalmannen
Copy link
Contributor Author

for a CI build option for Plan9 I only know of this one:
https://sourcehut.org/blog/2020-05-11-sourcehut-plus-plan-9/

but that is on an alternative git hosting site ( https://sr.ht/ )

@GitMensch
Copy link
Collaborator

Hm, actually I think the PR upstream would benefit of most of these adjustments, too :-)

test  speed  can not work, missing sys/timeb.h
@staalmannen
Copy link
Contributor Author

9front_pdcurses4_demos

@GitMensch
Copy link
Collaborator

@staalmannen Thank you for the screenshot, looks interesting. I assume that is a CHTYPE32 build, correct? Does the CHTYPE64 one with its additional attributes look different or aren't those supported yet (in this case: do you plan to add them)?

@staalmannen
Copy link
Contributor Author

@staalmannen Thank you for the screenshot, looks interesting. I assume that is a CHTYPE32 build, correct? Does the CHTYPE64 one with its additional attributes look different or aren't those supported yet (in this case: do you plan to add them)?

reading curses.h, CHTYPE_64 seems to be the default so most likely that. I did not define PDC_WIDE though.

Copy link
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

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

pdcplan9.c should be integrated in pdcutil.c to match with the other ports.
Other than this the PR is fine (still up to @Bill-Gray to include or not).

plan9/header.patch Show resolved Hide resolved
plan9/mkfile Show resolved Hide resolved
@GitMensch
Copy link
Collaborator

@Bill-Gray Do you see any issues with this new port or can I pull it for upcoming 4.2 (and add the one-line entry to docs/HISTORY.md, a file I'd still like you to come back)?

@Bill-Gray Bill-Gray merged commit 254fee8 into Bill-Gray:master Jul 10, 2020
@Bill-Gray
Copy link
Owner

Simon's good with this port, and I see no problems (must confess I've not looked all that hard, but it looks as if Simon has, so I'll go with that.) I may have to add a Plan9 system to my OS menagerie...

@GitMensch
Copy link
Collaborator

After this is settled @staalmannen can now go upstream with more points solved, this is good.
@Bill-Gray I guess you'll do the History.md entry (possibly with the other points we found [or: I was whining over] and possibly with the preparation of PDCursesX)?

@staalmannen staalmannen deleted the Plan9-bg branch August 13, 2020 06:43
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.

4 participants