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

Autogenerate the manpages with the current date. #35438

Closed
wants to merge 4 commits into from

Conversation

dns2utf8
Copy link
Contributor

@dns2utf8 dns2utf8 commented Aug 6, 2016

Requires date and cat

Follow-up to #35287

r? @nikomatsakis

@dns2utf8
Copy link
Contributor Author

dns2utf8 commented Aug 6, 2016

This adds the doc-man target which is included in the docs target.

@nagisa
Copy link
Member

nagisa commented Aug 6, 2016

cc @alexcrichton what should we do with rustbuild for this?

@alexcrichton
Copy link
Member

Yeah @dns2utf8 could you be sure to update rustbuild as well? I believe the relevant support would go here

@dns2utf8
Copy link
Contributor Author

dns2utf8 commented Aug 7, 2016

So would you like me to generate the complete correctly timestamped manpage with the /src/bootstrap/dist.rs or just update it so it copies only the generated man pages?

@dns2utf8
Copy link
Contributor Author

dns2utf8 commented Aug 7, 2016

I just noticed: there is no way to realy reliably calculate the month or year with the rust stdlib, because of TIMEZONES.

So I prepared a little vote 😉 :

🎉 So should I implement it with modulo? Pro: Simple; Con: May lead to an inacurate result near the border of a month?
😄 Or use the chrono crate? Is it even possible that early in the build process? Pro: Accurate; Con: needs a crate;
❤️ Or should I just filter the generated man pages and copy them? Pro: simple; Con: requires more external resources

I prepared the dist.rs and plan to finish it tomorrow.

@nagisa
Copy link
Member

nagisa commented Aug 7, 2016

I do not think the accuracy matters much here. It took people a bunch of years to notice the date is out-of-date (…ehem…), and even if month is off-by-one we can always lie a bit and tell build was done early or late.

@nikomatsakis
Copy link
Contributor

@dns2utf8 I'm confused, are you talking about specifically for the rustbuild modifications? You could shell out to date or whatever (and manually specify a time-zone...), right? Or invoke some libc routine or other?

@alexcrichton
Copy link
Member

@dns2utf8 yeah the manpages will need to be generated by dist.rs, if that build system is being used the makefiles aren't even touched. I also agree with @nagisa that accuracy isn't too important here, and @nikomatsakis is also right that either shelling out is fine or pulling a dependency on chrono/time should also be fine.

@dns2utf8
Copy link
Contributor Author

dns2utf8 commented Aug 9, 2016

Okay, working on it 😄

@bors
Copy link
Contributor

bors commented Aug 13, 2016

☔ The latest upstream changes (presumably #35414) made this pull request unmergeable. Please resolve the merge conflicts.

@dns2utf8 dns2utf8 force-pushed the man_page_rustc branch 2 times, most recently from 23a6e3f to 6c2d247 Compare August 15, 2016 21:49
@nikomatsakis
Copy link
Contributor

@dns2utf8 is this ready for review? If not, can we close it and just re-open when it is?

@dns2utf8
Copy link
Contributor Author

It is still in progress. I will reopen it when it is done.

@dns2utf8 dns2utf8 closed this Aug 16, 2016
@dns2utf8 dns2utf8 mentioned this pull request Aug 30, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
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.

5 participants