diff --git a/DEPS b/DEPS index 37f80b237ee1..0e5d717cf063 100644 --- a/DEPS +++ b/DEPS @@ -19,7 +19,7 @@ deps = { "components/brave_sync/extension/brave-crypto": "https://github.com/brave/crypto@7e391cec6975106fa9f686016f494cb8a782afcd", "vendor/bat-native-ads": "https://github.com/brave-intl/bat-native-ads.git@96e452545aa49b410a0f96fd264db8d8820e145b", "vendor/bat-native-usermodel": "https://github.com/brave-intl/bat-native-usermodel.git@c3b6111aa862c5c452c84be8a225d5f1df32b284", - "vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@7d0fdeb137e32bcbcf90ebb6c5b0b878e9a6f02e", + "vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@0a9320a061b77f7682261eb7303ddfa4fc734595", } hooks = [ diff --git a/build/cargo.gni b/build/cargo.gni index 9f70dd281f6d..207b83957053 100644 --- a/build/cargo.gni +++ b/build/cargo.gni @@ -17,7 +17,7 @@ template("cargo_build") { "--cargo_home=" + rebase_path("//brave/build/rustup/", root_build_dir), "--manifest_path=" + rebase_path(manifest_path, root_build_dir), "--build_path=" + rebase_path(build_path, root_build_dir), - "--platform=" + platform, + "--target=" + target, "--is_debug=$is_debug" ] } diff --git a/script/cargo.py b/script/cargo.py index 30e0714c0c1a..d7b45a0dbee8 100755 --- a/script/cargo.py +++ b/script/cargo.py @@ -19,10 +19,10 @@ def main(): cargo_home = args.cargo_home[0] manifest_path = args.manifest_path[0] build_path = args.build_path[0] - platform = args.platform[0] + target = args.target[0] is_debug = args.is_debug[0] - build(rustup_home, cargo_home, manifest_path, build_path, platform, is_debug) + build(rustup_home, cargo_home, manifest_path, build_path, target, is_debug) def parse_args(): @@ -32,7 +32,7 @@ def parse_args(): parser.add_argument('--cargo_home', nargs=1) parser.add_argument('--manifest_path', nargs=1) parser.add_argument('--build_path', nargs=1) - parser.add_argument('--platform', nargs=1) + parser.add_argument('--target', nargs=1) parser.add_argument('--is_debug', nargs=1) args = parser.parse_args() @@ -64,11 +64,11 @@ def parse_args(): if "out" not in args.build_path[0]: raise Exception("build_path did not contain 'out'") - # Validate platform args - if (args.platform is None or - len(args.platform) is not 1 or - len(args.platform[0]) is 0): - raise Exception("platform argument was not specified correctly") + # Validate target args + if (args.target is None or + len(args.target) is not 1 or + len(args.target[0]) is 0): + raise Exception("target argument was not specified correctly") # Validate is_debug args if (args.is_debug is None or @@ -83,30 +83,7 @@ def parse_args(): return args -def build(rustup_home, cargo_home, manifest_path, build_path, platform, is_debug): - targets = [] - - if platform == "Windows x86": - targets = ["i686-pc-windows-msvc"] - elif platform == "Windows x64": - targets = ["x86_64-pc-windows-msvc"] - elif platform == "macOS x64": - targets = ["x86_64-apple-darwin"] - elif platform == "Linux x64": - targets = ["x86_64-unknown-linux-gnu"] - elif platform == "Android arm": - targets = ["arm-linux-androideabi"] - elif platform == "Android arm64": - targets = ["aarch64-linux-android"] - elif platform == "Android x86": - targets = ["i686-linux-android"] - elif platform == "Android x64": - targets = ["x86_64-linux-android"] - elif platform == "iOS": - targets = ["aarch64-apple-ios", "x86_64-apple-ios"] - else: - raise ValueError('Cannot build due to unknown platform') - +def build(rustup_home, cargo_home, manifest_path, build_path, target, is_debug): # Set environment variables for rustup env = os.environ.copy() @@ -125,21 +102,20 @@ def build(rustup_home, cargo_home, manifest_path, build_path, platform, is_debug env['NDEBUG'] = "1" # Build targets - for target in targets: - args = [] - args.append("cargo") - args.append("build") - if is_debug == "false": - args.append("--release") - args.append("--manifest-path=" + manifest_path) - args.append("--target-dir=" + build_path) - args.append("--target=" + target) - - try: - subprocess.check_call(args, env=env) - except subprocess.CalledProcessError as e: - print e.output - raise e + args = [] + args.append("cargo") + args.append("build") + if is_debug == "false": + args.append("--release") + args.append("--manifest-path=" + manifest_path) + args.append("--target-dir=" + build_path) + args.append("--target=" + target) + + try: + subprocess.check_call(args, env=env) + except subprocess.CalledProcessError as e: + print e.output + raise e if __name__ == '__main__':