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

build script was missing platform-specific deps #243

Merged
merged 1 commit into from
Oct 13, 2020

Conversation

dae
Copy link
Contributor

@dae dae commented Oct 11, 2020

Prior to #212 being merged, the following in Cargo.toml was included the resulting BUILD file:

[target.'cfg(target_env = "msvc")'.build-dependencies]
vcpkg = { version = "0.2", optional = true }

This patch makes it work again, gated with a platform check, eg:

cargo_build_script(
    name = "libsqlite3_sys_build_script",
    srcs = glob(["**/*.rs"]),
    crate_root = "build.rs",
    edition = "2018",
    deps = [
        "@raze__cc__1_0_61//:cc",
        "@raze__pkg_config__0_3_18//:pkg_config",
    ] + selects.with_or({
        # cfg(target_env = "msvc")
        (
            "@io_bazel_rules_rust//rust/platform:i686-pc-windows-msvc",
            "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc",
        ): [
            "@raze__vcpkg__0_2_10//:vcpkg",
        ],
        "//conditions:default": [],
    }),

@google-cla
Copy link

google-cla bot commented Oct 11, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@dae
Copy link
Contributor Author

dae commented Oct 11, 2020

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Oct 11, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@dae
Copy link
Contributor Author

dae commented Oct 11, 2020

@googlebot I signed it!

Copy link
Member

@acmcarther acmcarther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, though I'd like a second opinion from @UebelAndre on this if available.

@UebelAndre
Copy link
Collaborator

This does appear to be a regression so this LGTM! Thanks for fixing that 😄 🙏

@dae dae force-pushed the plat-deps-in-build-script branch from 707768d to 063449e Compare October 13, 2020 00:04
@UebelAndre
Copy link
Collaborator

LGTM! Thanks for updating the PR 😄

@UebelAndre
Copy link
Collaborator

@acmcarther will have to do final sign off though

@dae dae force-pushed the plat-deps-in-build-script branch from 063449e to 0edd153 Compare October 13, 2020 02:38
@dae
Copy link
Contributor Author

dae commented Oct 13, 2020

The trailing comma was missing in the targeted deps case; I've moved it outside the endif to fix this.

@acmcarther
Copy link
Member

LGTM! Thanks for putting this together!

@acmcarther acmcarther merged commit 35c4fef into google:master Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants