-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Allow internal drivers with no dependencies to be disabled at compile time #1250
Conversation
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.
Thanks for tackling this. A bit hard to review given the amount of lines changed though
- I have perhaps missed it, but I didn't see where the OGR Curl drivers were enabled only if curl is enabled itself.
- More fundamentally, the reality of driver interdependency is much more complicated. For example frmts/iso8211 is used by a number of other drivers. This is just an example. I'm not sure if we want to track driver interdependency, or just accept (and warn !) that this is a advanced functionality and users must be ready to have compilation failures if they disable wrong combinations of drivers.
- More complicated, and perhaps more theoretical drivers: some drivers or algorithms may require, at runtime, another driver (using GDALGetDriverByName("foo")), but this is generally base drivers like MEM, GTiff, etc. Normally the code properly null-checks the result to error out (since the user can exclude at runtime any driver)
- From a user point of view, I'm not sure the naming --disable-format-foo vs --disable-driver-foo is really needed. Yes this is how things have been traditionnaly divided, bt I'd prefer --disable-driver-foo both for frmts/ and ogr/ drivers (ok, some have the same name, but in that case we can disable/enable both)
- Still from user point of view, I believe we need a --disable-all flag to be used in combination with a few --enable-driver-foo invokation. I guess this is how this functionnality will be used by 99% of people.
- We'll probably need to add in CONTRIBUTING.md guidelines of what is needed now when adding a new driver.
gdal/aclocal.m4
Outdated
@@ -12,44 +12,6 @@ | |||
# PARTICULAR PURPOSE. | |||
|
|||
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) | |||
# =========================================================================== |
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.
is this change needed ?
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.
probably not, I'll check
I'm reworking the change to use looping in configure.ac, should cut down the size of the diff
yeah, the gdal and ogr build stretgies are somewhat different. The curl stuff in OGR is (as of now) done by the
lines in ogrsf_frmts/GnuMakefile. I'm planning on moving that to a more explicit check in the configure script.
Correct, there are many more. I'd be OK with marking this feature as advanced usage. We can also add some specific checks at configure time, but that would have to be done case-by-case. The mitab ogr driver and raw gdal ones are specific cases, as they seem to be used in other places than just other drivers, I'll try to dig a bit more
I left in mem, vrt and raw drivers for that reason. kml and geojson are also somewhat related to this, and they have been left in. If there are others we can also leave them out of this patch.
given that the build setup for gdal and ogr are quite different, handling the disabling of both ogr and gdal drivers with the same name is going to prove a bit tricky. I'll see what I can do.
Agreed. Not sure how to handle this in practice, but I'll have a look also
Hopefully this will just sum up to adding the name of the directory in configure.ac |
I've heavily refactored my first draft to take into account your remarks:
Still remaining to do:
Still remaining to do, but I'd prefer to add this in a following pull request
|
@rouault I've fixed the indentation part, however I fail to understand why the (only python?) tests are failing on some platforms |
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.
A few minor questions/notes, but LGTM !
Once you're done, please squash the commits in a single one.
https://trac.osgeo.org/gdal/wiki/BuildingOnUnixWithMinimizedDrivers will need to be updated |
PR squashed and ready for merge. --disable-all-drivers has been renamed to --disable-all-optional-drivers. |
make bsb, grib and mrf follow disabling standard of #1250
This PR modifies the autotools build system to allow a user to selectively enable or disable some drivers that were previously always enabled and compiled.
Allows for smaller builds e.g when creating docker images
Example configure invocation to build a gdal image use only for accessing COGs (supposing the result is written to a MEM dataset)
OGR drivers that cannot be disabled and will always be built: generic geojson kml mem mitab vrt
GDAL drivers that cannot be disabled and will always be built: derived gtiff hfa mem raw vrt