dazwilkin / rust-googleapis Goto Github PK
View Code? Open in Web Editor NEWRust SDK for Google APIs
License: Apache License 2.0
Rust SDK for Google APIs
License: Apache License 2.0
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:
protoc .... *.proto
to catch everything not just those specifiedmod.rs
and this should be auto-generatedRerunning cargo build
fails if the clone directory exists.
Check for existence and handle it.
This is particularly bothersome for crates that reference this crate.
The repo requires protoc
for 2 reasons:
build.rs
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.