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

Provide a bundled feature #465

Open
weiznich opened this issue Nov 15, 2023 · 6 comments · May be fixed by #517
Open

Provide a bundled feature #465

weiznich opened this issue Nov 15, 2023 · 6 comments · May be fixed by #517

Comments

@weiznich
Copy link
Contributor

weiznich commented Nov 15, 2023

This is mostly a feature request. Many *-sys crates provide a bundled or vendored feature that builds and links static version of the corresponding C dependency as part of the build process. It would be great if gdal would provide a similar feature as well.

The main motivation for such a feature is that it would greatly simplify setting up the development/deploy environment as everything would be build as part of the build process.

@lnicola
Copy link
Member

lnicola commented Nov 16, 2023

I'm not sure how feasible this is. GDAL can link to dozens of external libraries, and I don't think it reliably auto-detects all of them (haven't played much with the new CMake-based build system, though). Even if detection worked, you'd still have to install other libraries.

proj-sys managed to make it work, but it still depends on SQLite, libtiff and probably even cURL.

@weiznich
Copy link
Contributor Author

I'm aware that gdal itself has quite a lot of external dependencies, as I've a local setup that statically links gdal anyway. What we do there is to disable as many of the external dependencies as possible. That's feasible for us as we don't require much of the optional functionality anyway.

For SQLlite it should be as simple as optionally including the libsqlite3-sys crate with the "bundled" feature behind a feature flag.

If bundling support is something that would be acceptable for the gdal crate as well I might give it a try someday and open a PR if that is successful.

@lnicola
Copy link
Member

lnicola commented Nov 27, 2023

I think it would be nice to have, but I don't know how configuring it would ideally work. E.g. I'd find it sweet if I could build GDAL from source, but with the system SQLite.

@metasim
Copy link
Contributor

metasim commented Dec 19, 2023

We build GDAL from scratch all the time (we license the JPKAK driver). The new cmake system is much much better, particularly given it has a principled way of allowing you to override paths, settings, etc.

One thing I've never been able to do is statically link GDAL into Rust code. @weiznich Any tips/tricks you can share?

@lnicola
Copy link
Member

lnicola commented Dec 19, 2023

IIRC static linking worked for me in the past, but I can't easily try it on my current distro because of a package (libgta) that's missing a static library.

weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 25, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds a minimal version from source via `build.rs`

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 25, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds a minimal version from source via `build.rs`

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 25, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds a minimal version from source via `build.rs`

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 26, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds a minimal version from source via `build.rs`

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 26, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds a minimal version from source via `build.rs`

Fixes georust#465
@weiznich weiznich linked a pull request Jan 26, 2024 that will close this issue
2 tasks
@weiznich
Copy link
Contributor Author

I've opened #517 That builds a more or less minimal version of gdal during cargo build. proj seems to be the only required external dependency, and there we can just use proj-sys + the bundled feature there to get a in tree build + static linking.

weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 26, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds a minimal version from source via `build.rs`

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 26, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds a minimal version from source via `build.rs`

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 30, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 30, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Jan 30, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Feb 5, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Feb 5, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Feb 9, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue Feb 12, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue May 14, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
weiznich added a commit to GiGainfosystems/gdal that referenced this issue May 23, 2024
This commit introduces a new `gdal-src` crate which bundles gdal and
builds by default a minimal version from source via `build.rs`. It
exposes feature flags for many drivers and adds the neccesary
dependencies to keep the build fully static.

Fixes georust#465
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 a pull request may close this issue.

3 participants