Giter VIP home page Giter VIP logo

rust-googleapis's People

Contributors

dazwilkin avatar

Watchers

 avatar

rust-googleapis's Issues

Hypothesis: fragile `build.rs`

If any build step fails, the crate build, fails. This is good.

However, the way I've structured build.rs is fragile.

E.g.:

Could not make proto path relative: googleapis/google/type/quarternion.proto: ...
thread 'main' panicked at 'protoc: ...

This is because in build.rs, I'd mistyped quaternion (one r not 2)

Solution:

  1. Better to emulate protoc .... *.proto to catch everything not just those specified
  2. The list must be duplicated in each mod.rs and this should be auto-generated

Can't assume `protoc.../include` for well-known types

The repo requires protoc for 2 reasons:

  • build.rs
  • protobuf well-known types

For the build.rs, as long as crates that depend upon this, have protoc in the path, all's good.

But for the well-known types, these must be present.

Because I've been unable to get the protobuf crate's well-known types working correctly, I need these cloned too.

Perhaps clone these types from their source too?

Embedding 'protoc' in `Repository::clone` is problematic

I've switched to, e.g:

match Repository::clone(
    "https://github.com/googleapis/googleapis.git",
    Path::new(googleapis),
) {
    Ok(_) => {
        println!("[{}] cloned", googleapis);
        google::api();
        google::rpc();
        google::container();
        google::iam();
        google::cloud::iot();
        grafeas::v1();
    }
    Err(e) => match e.code() {
        ErrorCode::Exists => println!("[{}] exists", googleapis),
        _ => panic!(
            "[{}] unexpected: {:?} {:?}",
            googleapis,
            e.code(),
            e.message()
        ),
    },
}

The fns e.g. google::api() are now explicitly called within the Ok branch of the Result.

This is because, it appears (!) that the clone command doesn't block entirely on the completion of the git clone. If e.g. google::api() is placed after the clone, it occasionally fails.

Placing e.g. google::api() within the match block means that the protoc is only run if the directory did not exist when the build.rs was run.

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.