-
Notifications
You must be signed in to change notification settings - Fork 284
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
povray 3.7.0.8 does not build on macOS 11.0 Big Sur #403
Comments
I have no experience with macOS and I don't consider myself a real programmer. With that disclaimer, here's my best guess at what is happening:Guessing macOS is perhaps not a case sensitive OS? Further supposing you are running a boost version of at least 1.73? This where boost starts to test for and use the c++20 headers if it finds it? (Wish the POV-Ray configure output the boost version it found instead of just that it passed the >= 'version' test. I couldn't tell what version you have with Big Sur (there is an 11.1 I saw) ) POV-Ray as an autoconf / gnu built program creates an upper case "VERSION" file in the root directory - this is a standard-ish thing. The only way I think you can get the fail is if the c++ #include is finding the autoconf VERSION file instead of its own! Perhaps my programming ignorance showing, but I thought the purpose of the '<' and '>' qualifier was to limit the header include search to c/c++ libraries? If so, no matter the case, how are we picking up the VERSION file in a parent directory? Is this a c++ pre-processor bug? We could in prebuild.sh change VERSION to some other name, but then it's no longer really an autoconf standard set up. Is C++20 really trying force changes like this on who knows how many existing autoconf built projects? Anyway still me doing a lot of guessing. To confirm we could try a couple things.
One last note.I'm running on Ubuntu 20.04.1 (g++ at c++14) and, with v3.8 at least, I'm NOT able to compile at c++17 or later as yet. No idea at the moment if this true for 3.7.0.8, but suspect it might be. |
Boost is 1.74.0, filesystem is case-insensitive. So your guess sounds right. The
|
OK. So, in some testing just now I manually added an #include to a random .cpp file. It looks like the #include <> syntax doesn't limit the scope of directories searched to those shipped with c/c++ as I thought it did. (Why both <> and "" wrappers if not...) Meaning if you have an include directory with a file name matching something in c++'s set, you include whatever is in that include directory file and not the c++ header file you really wanted. Ref: https://en.cppreference.com/w/cpp/preprocessor/include (Looks like any behaviour is allowed) Hmm, wonder if where the actual c++ version file exists, if it would always be found first? Not sure what to do here for my own coding. Every easy work around feels like a kludge. Less messy changes look like a lot of work with potential downsides to day to day coding productivity. (I cannot myself fix what's in Github for POV-Ray code in any case) The -I options as used by POV-Ray might be occasionally redundant, but none as looked at uniquely are extraneous given the code's current structure and build in place methodology. It's just what the Autotool's tools generate given where needed header files are found. I'm pretty sure the trouble is the +i.. but that's needed to get to the config.h file in the parent directory from each sub directory where compiles take place. Probably someone else has tripped on this already. I'll dig around when I next have some time. |
Boost somewhere after 1.60 breaks the POV-Ray build. I solved this by forcing brew to install Boost 1.60. Pre-requisite:
Steps:
Cheers, |
I, just now, built 3.7.0.8 with boost 3.71 on my Ubuntu 20.04.1 machine, so what you're seeing for your compile is not universal. (Changing the boost version however, might be another way to temporarily address the issue with picking up the VERSION file as the include supposing no dependency other than boost >=1.73 does this in the Big Sur environment) Some thoughts. I know the uberpov branch, last updated in 2016 I think, needs updates related to newer boost versions. If you branched off something earlier than 3.7.0.8 (this the current 3.7-stable branch) - and haven't pulled and merged later updates - you'd likely have build issues too. Or it might be what you say is true for macOS or your set up. |
Perhaps the break occured after 1.60 - I didn't actually check at which version the break starts. What I do know is after brew updated Boost from 1.60 to 1.74 my builds broke. Can you build with Boost 1.74 ? Update: I'm building POV-Ray v3.8.0 source. This break is unique to macOS. Cheers, |
@trevorsandy I don't know. I've not yet tried a build with anything beyond 1.71. Glad to hear you could build on other than macOS - it very likely means I can too. Best regards, |
Yes, the problem only occurs when building on a case-insensitive filesystem, which in practice means OS/X and potentially Windows (although I don't know if the windows build triggers this problem) Just renaming the |
I opened this homebrew PR to workaround the build issue there: Homebrew/homebrew-core#66356 |
You must rename the VERSION file to something else. If having a file of this name is a standard, then the standard must be changed. |
Well either that or keep the directories that have these |
I've not found my way back to really looking at this, but my left ear is itching. What I'm hoping is all compiler implementations have at some point implemented flag(s) to make the #include <> type search strict with respect to the source directory and file signatures for the standard c++ file names. Otherwise, isn't this completely open include search methodology a security exposure? Lots of c/c++ programmers around the planet. Forget case sensitivity, suppose someone is able to seed one or more directories on a computer with a file called "version". Imagine that file contains: ... and that the hidden ".snoop" file was stashed somewhere on the system when "version" was seeded. A new programmer sitting somewhere in Mexico writes a program with some headers in their home directory and compiles it with: g++ MyFirstTryWithBoost.cpp -I. a.out |
Exactly - you get it. This is why I reverted to Boost 1.60. Cheers, |
So just mandating older versions of boost isn't a long-term solution either; eventually that header will exist everywhere. |
OK. I had a little time today and I found a couple useful references - ones not of the screaming, why are you (using|not using) xyz, meanies variety. ;-) No one, in what I found, was concerned with the security aspect of the open #include <> method for standard c/c++ headers. I see this as the real issue behind the initial issue. Forget about the particular version/VERSION name, autotools and POV-Ray. Suppose somebody puts a few enticing projects out there who's real purpose is to seed writeable directories with landmine "version" files - or with other common-ish and commonly ignored names - and there will be programmers who will step on those land mines by using -I. or similar. I, often enough, write little test programs in whatever directory I happen to find myself. Who could resist trying out UltimaSuperExtraordinaryFastMathLib9 "... now gently massaging your tensed shoulders on every compile of your code ..." Anyway... The fix I plan to use:The good news is that clang and g++ both support the -iquote flag. Use it over the -I. and -I.. This form searches the specified directories for quote style includes only. In simple testing, this approach fixes the original issue, plus it closes off most of the potential for accidentally including common library file names from other than "official" directories. clang++ test.cpp -iquote. g++ test.cpp -iquote. Refs:Bug 42540 - "version" include wreaks havoc on case-insensitive filesystems Bug 236192 - C++20 poisoning |
An update. A few days ago started with the iquote update in my branch as being the best approach. It isn't completely working out. The iquote approach appears to require the config.h include be specified relative to the directory location in which the file being compiled was read. A pain, but all these config.h paths can be updated. Do it and the source tree directory compiles work OK because the config.h file is in the correct relative positions. Do a developer sort of thing and create build directories for compile variants. I do this by copying/linking the configure script to each of those variant directories; running configure with: ./configure --srcdir=... in each directory. What you find is that the compile is now broken because the unique config.h files gets created at the top of each build directory. In other words, config.h is no longer in the correct, relative to source file, location for iquote to work. If I want to stick with the more secure Iquote approach with these variant directory builds, the only ugly solution I see is to place/replace each build's config.h at the top level of the distributed code base for each variation. I'm thinking this not really OK as it runs the potential to break users not aware of the non-standard workings. I could do the VERSION name hack, but this doesn't address the -I. -I.. security issue. Plus there my original thought was to use Iquote for all non system include directories. Another potential option would be to force all compiles to be completely outside the distributed code base in an empty directory when configure is run. I think this latter addresses the VERSION file problem - the distribution files don't exist at the top build level in that case. It addresses the security issues with -I. and -I.. only. Of course, the "in distribution" compile would no longer work as folks expect. I too have open questions like whether "make install" works as it should and I've not worked out how to discourage (prevent?) in code distribution compiles. FWIW... |
OK. After thrashing about a long while trying stuff, my conclusion is there isn't any reasonably clean way to eliminate possible <> includes of files without file extensions. Not while being gnu/git compatible and without crippling some of the autotools developer functionality. Who knows - smaller tools with non-recursive compiles perhaps will fair better. My little test case looked OK with -Iquote, but that didn't hold up. If you are just hacking to get the end config/compile in place to work, things can also be whatever compiles and runs. What I did in the end was suffix all the gnu files with .txt in addition to eliminating file names without extensions in a reduced set of include directories. This requires autotools be run without the gnu/gnit restrictions. The default gnu setting: "The files INSTALL, NEWS, README, AUTHORS, and ChangeLog, plus one of COPYING.LIB, COPYING.LESSER or COPYING, are required at the topmost directory of the package." Turns out VERSION, LICENSE(?) and THANKS (not currently a POV-Ray file) are required only by use of gnits or --gnits which does some conformance checking beyond the 'gnu' default. On and off over the years there's been talk of POV-Ray becoming an official gnu utility, but it's not today - and my branch certainly isn't one. These gnu/gnit requirements can be relaxed. Using 'foreign,' the files aren't created for you or required for make dist/distcheck. In unix/configure.ac change: AM_INIT_AUTOMAKE([1.9 dist-bzip2 subdir-objects]) to AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2 subdir-objects]) In the unix/prebuild.sh script in the section creating the 'bootstrap' script change: automake --add-missing --warnings=all to automake --foreign --add-missing --warnings=all I also explicitly set DEFAULT_INCLUDES for each Makefile.am to exclude the typically generated -I. leaving only the build directory include where config.h is created. This override generates warnings when automake is run for each of the compile subdirectories, but, it is what it is. Those are the key changes. They drive a good many more, but should be those can be knocked down as seen. In testing everything I do developer wise is working as is the usual configure -> make -> make check - make install. Aside: I think in this thread I mentioned c++17 compiles weren't working for me. They now are - in my branch at least. Unsure what changed, but I'll take the gift... :-) |
For context on "gnits" see https://www.gnu.org/software/automake/manual/html_node/Strictness.html :
Amusingly that comment "which may never happen" was added to the statement by @tromey back in 2001 which seems to have been prophetic since it's still there in 2021: https://git.savannah.gnu.org/cgit/automake.git/commit/?id=bea5cae85c9c534a76729d30cd8ef049333aee77 I also think the only added required file is
If you read the automake docs carefully it seems to imply that gnits requires that if Finally, I would point out that the automake tarball itself doesn't have a Basically:
|
@mitchblank Thanks for the additional insight. I'm not experienced with what's really getting used out and about autotools wise. As for what gnits does by documentation at least, I ran across other bits which left me unsure what gnits was doing or not VERSION wise. The try-something -> build cycle <-- lookp while trying things was long an painful on my little two core. For example, there is this bit: "The gnits option also implies options readme-alpha and check-news." Plus, it looks like these two options can by themselves be turned on apart from gnits itself; which left me wondering whether VERSION meant a file at all! Perhaps instead meaning only the VERSION variable in config.h ? "Version info" needs to exist somewhere always, if you can run check-news by itself. Might it be the VERSION file has been a standard more or less by accident? Somebody created a VERSION file and most everyone just followed suit? In POV-Ray's build system it is used with AC_INIT. AC_INIT([POV-Ray], m4_normalize(m4_include([VERSION.txt])),...) Ref (just below green checked answer): In any case, I agree, using VERSION.txt seems pretty safe - especially given you found it not to be forced to exist in the automake code. |
I'm pretty sure there is some reason why the Unix build process would croak (on some machines, at any rate) without the Can someone test whether getting rid of the "original" - run once:
to build:
If that works, then I think the cleanest approach for all parties involved should be to just move the "original" of the While we're at it, we could do the same for all the other "originals" we're currently copying around verbatim or with modifications during the prebuild step; my suggestion would be ATTENTION: One thing that would be important to look out for though, is that (The good news is, POV-Ray v3.8 is unaffected by this issue nowadays, as it generates |
Then again, maybe let's not do that for v3.7. There are probably too many places where the file's location is explicitly documented as |
This should fix build issues with boost 1.73 or later errorneously picking up the file on some systems while looking for C++20 `<version>` header file (GitHub issue #403).
Please test whether branch |
Well, turns out v3.7 isn't the only one affected - v3.8 is suffering, too. The crux of the matter is that So the solution (besides getting |
Bravo! Welcome back @c-lipka. Cheers, |
…header. - Move `config.h` (created by `configure`) from main directory to `unix` subdirectory - Move original `VERSION` from `unix` to `unix/prebuild` subdirectory. - Fix some instances in `prebuild.sh` where we're adding the main directory to the include search path for no obvious reason. This should fix GitHub issue #403.
Should be fixed in |
…header. - Move `config.h` (created by `configure`) from main directory to `unix` subdirectory - Fix some instances in `prebuild.sh` where we're adding the main directory to the include search path for no obvious reason. This should fix GitHub issue #403 for v3.8.
…header. - Move `config.h` (created by `configure`) from main directory to `unix` subdirectory - Fix some instances in `prebuild.sh` where we're adding the main directory to the include search path for no obvious reason. This should fix GitHub issue POV-Ray#403 for v3.8.
…header. - Move `config.h` (created by `configure`) from main directory to `unix` subdirectory - Fix some instances in `prebuild.sh` where we're adding the main directory to the include search path for no obvious reason. This should fix GitHub issue #403 for v3.8.
Should be fixed in the next v3.8.0 release, too. |
…header. - Move `config.h` (created by `configure`) from main directory to `unix` subdirectory - Fix some instances in `prebuild.sh` where we're adding the main directory to the include search path for no obvious reason. This should fix GitHub issue POV-Ray#403 for v3.8.
Summary
povray 3.7.0.8 does not build on macOS 11.0 Big Sur
Environment
Unix Pre-Build Output
Full prebuild output here: https://github.com/Homebrew/homebrew-core/runs/1402560071?check_suite_focus=true
Compiler/Linker Output
make install
fails with:The text was updated successfully, but these errors were encountered: