Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4edab8

Browse filesBrowse files
richardlauRafaelGSS
authored andcommitted
build: use CARGO environment variable if set
When enabling support for Temporal, check for the `CARGO` environment variable to locate the `cargo` binary (defaulting to `cargo` if not set) and use this to build `deps/crates`. This will allow using Cargo on systems where the Cargo binary name is suffixed with the version, e.g. `cargo-1.82` on Ubuntu 24.04. PR-URL: #62421 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent ce0f498 commit a4edab8
Copy full SHA for a4edab8

2 files changed

+13-4Lines changed: 13 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎configure.py‎

Copy file name to clipboardExpand all lines: configure.py
+11-3Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,9 @@ def get_cargo_version(cargo):
14521452
except OSError:
14531453
error('''No acceptable cargo found!
14541454
1455-
Please make sure you have cargo installed on your system.''')
1455+
Please make sure you have cargo installed on your system and/or
1456+
consider adjusting the CARGO environment variable if you have installed
1457+
it in a non-standard prefix.''')
14561458

14571459
with proc:
14581460
cargo_ret = to_utf8(proc.communicate()[0])
@@ -1540,8 +1542,9 @@ def check_compiler(o):
15401542
# Minimum cargo and rustc versions should match values in BUILDING.md.
15411543
min_cargo_ver_tuple = (1, 82)
15421544
min_rustc_ver_tuple = (1, 82)
1543-
cargo_ver = get_cargo_version('cargo')
1544-
print_verbose(f'Detected cargo: {cargo_ver}')
1545+
cargo = os.environ.get('CARGO', 'cargo')
1546+
cargo_ver = get_cargo_version(cargo)
1547+
print_verbose(f'Detected cargo (CARGO={cargo}): {cargo_ver}')
15451548
cargo_ver_tuple = tuple(map(int, cargo_ver.split('.')))
15461549
if cargo_ver_tuple < min_cargo_ver_tuple:
15471550
warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}')
@@ -2751,6 +2754,11 @@ def make_bin_override():
27512754
# will fail to run python scripts.
27522755
gyp_args += ['-Dpython=' + python]
27532756

2757+
if options.v8_enable_temporal_support and not options.shared_temporal_capi:
2758+
cargo = os.environ.get('CARGO')
2759+
if cargo:
2760+
gyp_args += ['-Dcargo=' + cargo]
2761+
27542762
if options.use_ninja:
27552763
gyp_args += ['-f', 'ninja-' + flavor]
27562764
elif flavor == 'win' and sys.platform != 'msys':
Collapse file

‎deps/crates/crates.gyp‎

Copy file name to clipboardExpand all lines: deps/crates/crates.gyp
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
'variables': {
3+
'cargo%': 'cargo',
34
'cargo_vendor_dir': './vendor',
45
},
56
'conditions': [
@@ -48,7 +49,7 @@
4849
'<(node_crates_libpath)'
4950
],
5051
'action': [
51-
'cargo',
52+
'<(cargo)',
5253
'rustc',
5354
'<@(cargo_build_flags)',
5455
'--frozen',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.