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

Release update #974

Merged
merged 4 commits into from
Feb 5, 2024
Merged

Release update #974

merged 4 commits into from
Feb 5, 2024

Conversation

phlptp
Copy link
Collaborator

@phlptp phlptp commented Jan 8, 2024

Update the Readme and the changelog in preparation for a release.

@phlptp phlptp requested a review from henryiii January 8, 2024 16:46
@phlptp
Copy link
Collaborator Author

phlptp commented Jan 8, 2024

@henryiii I think it is time to make a release, been over a year since the the last one, and some bigger features in place that should be in a release version. Is there anything else you want in a release? I know you talked about something with Unicode but not sure what exactly that was.

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b8edd50) 100.00% compared to head (3bdebd8) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #974   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         4546      4546           
=========================================
  Hits          4546      4546           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 11, 2024

@henryiii pinging you again if there is anything else in a release and to check over the changelog.

@henryiii
Copy link
Collaborator

henryiii commented Jan 11, 2024

The unicode thing I'd like to check before release was here, I think. Basically, now we have (2), (3), and (4):

// 1 (not supported today)
app.ensure_utf8(argc, argv);
CLI11_PARSE(app);  // Uses stored argv vector on all platforms

// 2 (almost supported in main only - missing argc)
argv = app.ensure_utf8(argc, argv);
CLI11_PARSE(app, argc, argv);  // Uses produced argv vector

// 3 (supported in all versions)
CLI11_PARSE(app, argc, argv); // Not unicode

// 4 (supported in main only)
CLI11_PARSE(app); // Not portable, but unicode

I'm not fond of (4), since it requires non-standard trickery that sometimes fails, and the reluctance to release is because we'd be making that a supported way to operate. We could get rid of this and add (1), which is a bit more code, but doesn't have any non-standard trickery and is still simpler than (2).

We could also leave it as is. We could also just remove (4), and only allow (2) and (3), as more ways to do things just to save a few characters isn't necessarily better.

@henryiii
Copy link
Collaborator

henryiii commented Jan 11, 2024

Actually, we currently have:

argv = app.ensure_utf8(argv);
CLI11_PARSE(app, argc, argv);  // Uses produced argv vector

Which is not compatible with (1) at all.

@henryiii
Copy link
Collaborator

henryiii commented Jan 11, 2024

Here are the possibilities, IMO:

  1. Change argv = app.ensure_utf8(argv); into argv = app.ensure_utf8(argc, argv); and have it store argc/argv in App (on UNIX), so that CLI11_PARSE(app) no longer does non-standard magic to get these values on UNIX. Remove the magic version of CLI11_PARSE(app) (without running ensure_utf8 first).
  2. Remove CLI11_PARSE(app); and the only way to do this is with argv = app.ensure_utf8(argv);.
  3. Leave as is; two ways to get unicode (one being shorter but not working on some systems).

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 11, 2024

Longer term we should figure out the best means of not using MACROS as recommended. It does serve a purpose so fine leaving it for now. But in my opinion 1 and 4 should not be supported macros, they hide too much. I don't see a good means of getting rid of them completely in C++11 so there should only be 1 form of the macro, that is fairly simple.

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 11, 2024

What we are really talking about whether to keep the parse() method on app. That is what allows the macro to work with CLI11_PARSE(app) with no arguments.

@henryiii
Copy link
Collaborator

Yes, it's really about .parse(...). The macros are always easy to replace, it's just 4 lines, it's just a bit annoying to have to type out the four lines. It's also nice as eventually I want to try to avoid requiring exception catching, and when that happens, CLI11_PARSE can still be supported, but the thing it expands to will change.

So you like Option 2?

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 11, 2024

I think that would be my preference but I don't use much unicode,

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 11, 2024

Looking at it, I think the simplest immediate solution would be rename the parse() method to something else e.g. parse_from_cli_args or something to that effect to match something like parse_from_stream, which does the parsing but does something a little different than the typical parsing.

@henryiii
Copy link
Collaborator

henryiii commented Jan 12, 2024

I'm looking at the code removable if we drop the no-argument parse() (this includes dropping CLI11::argc() and CLI11::argv()). The ugliest code is the Windows code, which we have to keep for any unicode support (app.ensure_utf8), so nothing changes there. The macOS removal drops *_NSGetArgc usage, which I assume is pretty stable; IMO the main issue is the Linux use of fp_unique(std::fopen("/proc/self/cmdline", "r"), deleter);, which can fail if /proc is missing (#845), such as is the case if a user calls chroot. (Plus I'm not sure how this handles other operating systems, like FreeBSD and such?)

IMO, having CLI11_PARSE(app) but having hidden pitfalls that an application user could fall into is not a great idea, when we could instead just have a app.ensure_utf8 call and no pitfalls. It's CLI11's fault if a user of a tool using CLI11 reports that their application fails due to chroot usage, for example. I don't even mind adding it to all example usages of CLI11; it's pretty obvious from the name that you could remove it to remove unicode support.

@henryiii
Copy link
Collaborator

(Currently distracted by fixing Catch2 3 support, which seems to have broken)

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 23, 2024

@henryiii any chance we can finish this up this week. I am working on a release for another project and would be nice to include an actual release of CLI11 in it.

@henryiii
Copy link
Collaborator

We can try. I’m likely to not have time tomorrow, but Thursday Friday I should. I’m still very worried about Unicode and want to strip the “simple” form out before release. I’d also like to know if it supports wmain on windows, and what happens if you aren’t expecting Unicode.

@phlptp
Copy link
Collaborator Author

phlptp commented Jan 31, 2024

Anything we need to change in this PR? @henryiii

@henryiii
Copy link
Collaborator

henryiii commented Feb 3, 2024

I'll try to do final review this weekend, release on Monday.

phlptp and others added 4 commits February 4, 2024 22:34
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii merged commit 88e9bb1 into main Feb 5, 2024
54 checks passed
@henryiii henryiii deleted the release-notes branch February 5, 2024 03:59
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