weixin_39978696
weixin_39978696
2020-12-08 21:16

split into gdal-sys and gdal crate

Split rust-gdal into a gdal-sys and a (rust-) gdal crate.

(I'm currently working on this)

该提问来源于开源项目:georust/gdal

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39887961 weixin_39887961 5月前

    Sounds great! I've been meaning to do this for a while.

    点赞 评论 复制链接分享
  • weixin_39978696 weixin_39978696 5月前

    should i add the rust-sys repository to georust? ;)

    点赞 评论 复制链接分享
  • weixin_39887961 weixin_39887961 5月前

    I'd recommend having both gdal and gdal-sys library crates exist within the same repository. This way, if there are ever updates to gdal-sys, gdal will get updated to reflect the changes at the same time.

    There a couple strategies for doing this:

    gdal-sys within gdal

    
    /Cargo.toml (config for 'gdal')
    /src/ (source files for 'gdal')
    /gdal-sys/ (crate for 'gdal-sys')
    /gdal-sys/Cargo.toml (config for 'gdal-sys')
    /gdal-sys/src/ (source files for 'gdal-sys')
    

    An example: https://github.com/alexcrichton/git2-rs

    gdal-sys and gdal separate w/ cargo workspace

    cargo workspaces are relatively new: https://github.com/rust-lang/rfcs/blob/master/text/1525-cargo-workspace.md

    
    /Cargo.toml (workspace config)
    /gdal/ (crate for 'gdal')
    /gdal/Cargo.toml (config for 'gdal')
    /gdal/src/ (source files for 'gdal')
    /gdal-sys/ (crate for 'gdal-sys')
    /gdal-sys/Cargo.toml (config for 'gdal-sys')
    /gdal-sys/src/ (source files for 'gdal-sys')
    

    An example: https://github.com/servo/webrender

    Nowadays I prefer the second option

    点赞 评论 复制链接分享
  • weixin_39978696 weixin_39978696 5月前

    I've been wondering how to do this and the examples are really helpful, thanks! Cargo workspaces look really nice.

    点赞 评论 复制链接分享

相关推荐