GithubHelp home page GithubHelp logo

Gir submodules alternative about gtk3-rs HOT 10 CLOSED

gkoz avatar gkoz commented on August 25, 2024
Gir submodules alternative

from gtk3-rs.

Comments (10)

gkoz avatar gkoz commented on August 25, 2024

A possible alternative.

Use an ignored local-gir directory and a gir.txt with commit hashes. The makefile would know how to

  • mkdir local-gir; git clone $GIR_URL local-gir/gir; git clone $GIR_FILES_URL local-gir/gir-files if they're absent but not clobber existing ones
  • check out the commits set in gir.txt (basically what git submodule update does)

You could either let make gir do the default thing or symlink local-gir somewhere and it would only check out the necessary commits if asked to (e.g. make reset-gir) or just build run the existing gir it finds.

from gtk3-rs.

EPashkin avatar EPashkin commented on August 25, 2024

Other alternative: optionally make gir/target symlink to base gir/target, may be ever add make target to do that.

from gtk3-rs.

gkoz avatar gkoz commented on August 25, 2024

Something like this can be achieved with cargo config.

workdir
├── gdk
│   └── gir
├── gtk
│   └── gir
├── .cargo
│   └── config
└── target

Put target-dir = "./target" in config to make all crates use the same target directory. Just need to make make aware of where to find the binary somehow, or rewrite it to use cargo run.

from gtk3-rs.

EPashkin avatar EPashkin commented on August 25, 2024

Hard making all target to same directory IMHO not good idea as modules can have different version of gir.
If you think that gir better be always same then better just add new module with gtk, gdk, ..., gir, gir-files as sub-modules.

from gtk3-rs.

gkoz avatar gkoz commented on August 25, 2024

You'll still have to rebuild gir when jumping between crates but none of its dependencies (if the lockfiles don't differ). This can be avoided by getting even more creative and using cargo install to make this independent of where the target directory is and let each crate have its own gir binary:

GIR = gir/target/bin/gir
# ...
$(GIR) : gir/Cargo.toml gir/Cargo.lock gir/build.rs $(shell find gir/src -name '*.rs')
    # This line can be removed once we have `cargo install --force`
    cargo uninstall --root gir/target gir 2&>1 > /dev/null || true
    cargo install --root gir/target --path gir

from gtk3-rs.

EPashkin avatar EPashkin commented on August 25, 2024

I not understand how cargo install be better.

PS. We need full rebuild gir on update local rustc version (every 6 week).

from gtk3-rs.

gkoz avatar gkoz commented on August 25, 2024

I'll probably add a PR to make the install idea easier to understand. As to rustc upgrades the benefit of static linking by default is gir the binary isn't dependent on libstd-blahblah.so, you don't need to rebuild it just because rustc is upgraded.

from gtk3-rs.

EPashkin avatar EPashkin commented on August 25, 2024

Yes, it static linked, so when we try build gir under new rustc it do full rebuild as std version changed.

from gtk3-rs.

EPashkin avatar EPashkin commented on August 25, 2024

Last only true if not using make.

from gtk3-rs.

sdroege avatar sdroege commented on August 25, 2024

We don't have them per module any more as everything's merged into one.

from gtk3-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.