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

chore: bump shadow-rs version to set the path to find the correct git repo #4494

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ schemars = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["float_roundtrip"] }
serde_with = "3"
shadow-rs = "0.31"
smallvec = { version = "1", features = ["serde"] }
snafu = "0.8"
sysinfo = "0.30"
Expand Down
4 changes: 2 additions & 2 deletions src/common/version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ codec = ["dep:serde", "dep:schemars"]
const_format = "0.2"
schemars = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
shadow-rs = "0.29"
shadow-rs.workspace = true

[build-dependencies]
build-data = "0.2"
shadow-rs = "0.29"
shadow-rs.workspace = true
11 changes: 10 additions & 1 deletion src/common/version/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::env;

use build_data::{format_timestamp, get_source_time};

fn main() -> shadow_rs::SdResult<()> {
Expand All @@ -25,5 +27,12 @@ fn main() -> shadow_rs::SdResult<()> {
}
);
build_data::set_BUILD_TIMESTAMP();
shadow_rs::new()

// The "CARGO_WORKSPACE_DIR" is set manually (not by Rust itself) in Cargo config file, to
// solve the problem where the "CARGO_MANIFEST_DIR" is not what we want when this repo is
// made as a submodule in another repo.
let src_path = env::var("CARGO_WORKSPACE_DIR").or_else(|_| env::var("CARGO_MANIFEST_DIR"))?;
let out_path = env::var("OUT_DIR")?;
let _ = shadow_rs::Shadow::build_with(src_path, out_path, Default::default())?;
Ok(())
MichaelScofield marked this conversation as resolved.
Show resolved Hide resolved
}