-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
make: build the docs subdir only from within src #1591
Conversation
docs/Makefile.am
Outdated
@@ -35,8 +35,8 @@ HTMLPAGES = $(GENHTMLPAGES) index.html | |||
|
|||
# Build targets in this file (.) before cmdline-opts to ensure that | |||
# the curl.1 rule below runs first | |||
SUBDIRS = libcurl . cmdline-opts | |||
DIST_SUBDIRS = $(SUBDIRS) examples | |||
SUBDIRS = cmdline-opts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change conflicts with the comment above. As far as I understand the comment and the $(abs_builddir)/curl.1:
rule in the same file, we need . before cmdline-opts.
@@ -43,6 +43,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ | |||
|
|||
bin_PROGRAMS = curl | |||
|
|||
SUBDIRS = ../docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not find a reference stating if SUBDIRS works for external directories. If it does, great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'll restore that, thanks for pointing it out. That's part of the magic fix necessary to make things build on non-gnu makes on *BSDs...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this the answer to the SUBDIRS = ../docs
comment? Or to the other one, which you fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That became really weird. My response was regarding the docs/Makefile.am comment. I think the ../docs
approach should work...
d458a9d
to
fa39432
Compare
Hm, it didn't really work out that simple. It broke the build as seen in the CI. I had to put back the explicit |
With the current diff, there are still two ways building curl.1: To avoid having two ways to archive one goal, I tried to come up with an alternative implementation of the |
Yeah, that makes me nervous about this change. Mac OS has gnu make and we have no BSD machines in the CI setup... |
I tried having a /src/hugehelp/Makefile.am building all the dependencies for tool_hugehelp.c, but in that place, I do not have paths to the curl.1 dependencies available ( Thus we can only build curl.1 from /docs/cmdline-opts and /src depends on /docs. Automake cannot model this, since /docs is not a subdir of /src. Is this pre-build code generation of curl.1 a good idea at all? It somehow mixes maintainer jobs and user jobs. I think there are two clean ways to code generation: either generate at build time by the user or pre-generate for the user. The first way does not work if Perl should not be required. The other way means duplication in the git repo and a maintainer script to generate curl.1. If we have a CI script checking that all generated code is up-to-date, I think this is a good solution. Assuming pre-build code generation is a good idea, as far as I can see, the only proper way is to move the command line tool documentation into /src/docs |
You mean if it is sensible to allow people to build curl from source without requiring perl? Or alternatively, rewrite gen.pl in another language. I think it is worth it mostly for the Windows people, as they're usually the ones least likely to have perl around already.
How would that make things better? I don't have any formal objections to that if it means an improved build setup. |
I mean half-done code generation of curl.1, that is part of the main build system but ships a pre-build file curl.1 that is not built with the first
/src/Makefile.am gets This way, the commandline tool is rebuild, if any of the .d files changes because automake's SUBDIRS allows a clean recursive dependency setup. |
Won't it still have exactly the same challenges as now, with a file that can't get updated if perl is missing and shouldn't get updated if newer than its dependencies and the problem with non-gnu make on in-tree vs out-of-tree builds? I don't see why |
fa39432
to
f1ec13d
Compare
repushed the same patch again to have it tested on the updated CI distcheck which also does an out-of-tree-build |
From the CI failure log of the commit in this PR without the explicit rule, where curl.1 was not available when /src/tool_hugehelp.c was build I think, external dirs in SUBDIRS like |
The problem there is that we're solving the problem in two different Makefiles, it won't matter if the other makefile is in docs/ or in ../docs. Neither is "external", but both are separate from the one in src/. If we would merge the generation of curl.1 and the generation hugehelp.c into the same makefile, things would be much cleaner! |
SUBDIRS does indeed work for external directories, such as I was having another look into https://travis-ci.org/curl/curl/builds/244466563 (diff: 8621b61...d458a9d), which should work. It turns out that tool_hugehelp.c is built before any of the SUBDIRS because it is in BUILT_SOURCES. When I now apply 8621b61...d458a9d and remove
|
f1ec13d
to
bcc1c42
Compare
Thanks! I committed your change now and pushed to verify the CI likes this. |
LGTM. This now removes the second way of building curl.1, which was my main point in #1590, in a minimal way. Regarding other discussion:
|
That's also complicated since we want users who download the tarball to be able to write patches, improve things and be able to regenerate the man page as well to see how their local changes end up looking...
Yeah, we might as well do that... |
... and don't build at all in include Prompted-by-work-by: Simon Warta Ref: #1590
Suggested-by: Simon Warta
bcc1c42
to
de769c0
Compare
Now I've also verified that this PR builds fine on these setups using the default (non-GNU) make:
|
Thanks for all the help on this @webmaster128! |
... and don't build at all in include
Prompted-by-work-by: Simon Warta
Ref: #1590