##// END OF EJS Templates
rust: enable Python 3 support unconditionally...
Simon Sapin -
r49697:649ff7f8 default
parent child Browse files
Show More
@@ -151,12 +151,9 b' testpy-%:'
151 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
151 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
152 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
152 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
153
153
154 rust-tests: py_feature = $(shell $(PYTHON) -c \
155 'import sys; print(["python27-bin", "python3-bin"][sys.version_info[0] >= 3])')
156 rust-tests:
154 rust-tests:
157 cd $(HGROOT)/rust/hg-cpython \
155 cd $(HGROOT)/rust/hg-cpython \
158 && $(CARGO) test --quiet --all \
156 && $(CARGO) test --quiet --all --features "$(HG_RUST_FEATURES)"
159 --no-default-features --features "$(py_feature) $(HG_RUST_FEATURES)"
160
157
161 check-code:
158 check-code:
162 hg manifest | xargs python contrib/check-code.py
159 hg manifest | xargs python contrib/check-code.py
@@ -40,8 +40,8 b' binding crates like a hypothetical ``HGW'
40 Special features
40 Special features
41 ================
41 ================
42
42
43 You might want to check the `features` section in ``hg-cpython/Cargo.toml``.
43 In the future, compile-time opt-ins may be added
44 It may contain features that might be interesting to try out.
44 to the `features` section in ``hg-cpython/Cargo.toml``.
45
45
46 To use features from the Makefile, use the `HG_RUST_FEATURES` environment
46 To use features from the Makefile, use the `HG_RUST_FEATURES` environment
47 variable: for instance `HG_RUST_FEATURES="some-feature other-feature"`
47 variable: for instance `HG_RUST_FEATURES="some-feature other-feature"`
@@ -8,18 +8,8 b' edition = "2018"'
8 name='rusthg'
8 name='rusthg'
9 crate-type = ["cdylib"]
9 crate-type = ["cdylib"]
10
10
11 [features]
12 default = ["python3"]
13
14 # Features to build an extension module:
15 python3 = ["cpython/python3-sys", "cpython/extension-module"]
16
17 # Enable this feature to build a test executable linked to libpython:
18 # e.g. cargo test --no-default-features --features python3-bin
19 python3-bin = ["cpython/python3-sys"]
20
21 [dependencies]
11 [dependencies]
22 cpython = { version = "0.7.0", default-features = false }
12 cpython = { version = "0.7.0", features = ["extension-module"] }
23 crossbeam-channel = "0.4"
13 crossbeam-channel = "0.4"
24 hg-core = { path = "../hg-core"}
14 hg-core = { path = "../hg-core"}
25 libc = "0.2"
15 libc = "0.2"
@@ -1380,15 +1380,9 b' class RustExtension(Extension):'
1380
1380
1381 cargocmd = ['cargo', 'rustc', '--release']
1381 cargocmd = ['cargo', 'rustc', '--release']
1382
1382
1383 feature_flags = ['python3']
1384
1385 cargocmd.append('--no-default-features')
1386
1387 rust_features = env.get("HG_RUST_FEATURES")
1383 rust_features = env.get("HG_RUST_FEATURES")
1388 if rust_features:
1384 if rust_features:
1389 feature_flags.append(rust_features)
1385 cargocmd.extend(('--features', rust_features))
1390
1391 cargocmd.extend(('--features', " ".join(feature_flags)))
1392
1386
1393 cargocmd.append('--')
1387 cargocmd.append('--')
1394 if sys.platform == 'darwin':
1388 if sys.platform == 'darwin':
General Comments 0
You need to be logged in to leave comments. Login now