Skip to content

Commit f1bdc77

Browse files
committed
Merge branch 'tim/ignore_vcvars' into 'master'
maint: Remove usage of vcvars for bindgen See merge request TankerHQ/sdk-rust!182
2 parents 885c9c7 + 410d0ec commit f1bdc77

File tree

2 files changed

+59
-61
lines changed

2 files changed

+59
-61
lines changed

run-ci.py

Lines changed: 58 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,8 @@ def get_android_bin_path() -> Path:
110110

111111

112112
def bind_gen(
113-
*, header_source: Path, output_file: Path, include_path: Path, dynamic_loading: bool
113+
*, header_source: Path, output_file: Path, include_path: Path, dynamic_loading: bool
114114
) -> None:
115-
# bindgen will call clang, which needs vcvarsall to be set
116-
# otherwise, it will fail to find stdbool.h
117-
tankerci.cpp.set_build_env()
118115
args = []
119116
if dynamic_loading:
120117
args += [
@@ -136,7 +133,7 @@ def bind_gen(
136133

137134
class Builder:
138135
def __init__(
139-
self, *, src_path: Path, build_profile: Profile, host_profile: Profile
136+
self, *, src_path: Path, build_profile: Profile, host_profile: Profile
140137
):
141138
self.src_path = src_path
142139
self.host_profile = host_profile
@@ -192,47 +189,47 @@ def _copy_includes(self, package_path: Path, depsConfig: DepsConfig) -> None:
192189
@staticmethod
193190
def _armerge_soft_float128_compiler_rt_builtins(compiler_rt_lib: Path, output_path: Path, env: dict[str, str]):
194191
f128_builtins = [
195-
"__addtf3",
196-
"__subtf3",
197-
"__multf3",
198-
"__divtf3",
199-
"__negtf2",
200-
"__extenddftf2",
201-
"__extendsftf2",
202-
"__trunctfdf2",
203-
"__trunctfsf2",
204-
"__fixdfti",
205-
"__fixsfti",
206-
"__fixunsdfti",
207-
"__fixunssfti",
208-
"__fixtfdi",
209-
"__fixtfsi",
210-
"__fixtfti",
211-
"__fixunstfdi",
212-
"__fixunstfsi",
213-
"__fixunstfti",
214-
"__floattidf",
215-
"__floattisf",
216-
"__floatuntidf",
217-
"__floatuntisf",
218-
"__floatditf",
219-
"__floatsitf",
220-
"__floattitf",
221-
"__floatunditf",
222-
"__floatunsitf",
223-
"__floatuntitf",
224-
"__cmptf2",
225-
"__unordtf2",
226-
"__eqtf2",
227-
"__getf2",
228-
"__gttf2",
229-
"__letf2",
230-
"__lttf2",
231-
"__netf2",
232-
"__powitf2",
233-
"__multc3",
234-
"__divtc3",
235-
]
192+
"__addtf3",
193+
"__subtf3",
194+
"__multf3",
195+
"__divtf3",
196+
"__negtf2",
197+
"__extenddftf2",
198+
"__extendsftf2",
199+
"__trunctfdf2",
200+
"__trunctfsf2",
201+
"__fixdfti",
202+
"__fixsfti",
203+
"__fixunsdfti",
204+
"__fixunssfti",
205+
"__fixtfdi",
206+
"__fixtfsi",
207+
"__fixtfti",
208+
"__fixunstfdi",
209+
"__fixunstfsi",
210+
"__fixunstfti",
211+
"__floattidf",
212+
"__floattisf",
213+
"__floatuntidf",
214+
"__floatuntisf",
215+
"__floatditf",
216+
"__floatsitf",
217+
"__floattitf",
218+
"__floatunditf",
219+
"__floatunsitf",
220+
"__floatuntitf",
221+
"__cmptf2",
222+
"__unordtf2",
223+
"__eqtf2",
224+
"__getf2",
225+
"__gttf2",
226+
"__letf2",
227+
"__lttf2",
228+
"__netf2",
229+
"__powitf2",
230+
"__multc3",
231+
"__divtc3",
232+
]
236233
keep_symbol_args = [e for sym_name in f128_builtins for e in ['-k', sym_name]]
237234

238235
tankerci.run(
@@ -246,7 +243,7 @@ def _armerge_soft_float128_compiler_rt_builtins(compiler_rt_lib: Path, output_pa
246243
)
247244

248245
def _merge_all_libs(
249-
self, depsConfig: DepsConfig, package_path: Path, native_path: Path
246+
self, depsConfig: DepsConfig, package_path: Path, native_path: Path
250247
) -> None:
251248
with tankerci.working_directory(package_path):
252249
env = os.environ.copy()
@@ -377,10 +374,10 @@ def _prepare_profile(self) -> None:
377374
shutil.copyfile(native_path / "ctanker.rs", mingw_path / "ctanker.rs")
378375

379376
def prepare(
380-
self,
381-
update: bool,
382-
tanker_source: TankerSource,
383-
tanker_ref: Optional[str] = None,
377+
self,
378+
update: bool,
379+
tanker_source: TankerSource,
380+
tanker_ref: Optional[str] = None,
384381
) -> None:
385382
tanker_deployed_ref = tanker_ref
386383
if tanker_source == TankerSource.DEPLOYED and not tanker_ref:
@@ -472,11 +469,11 @@ def test(self) -> None:
472469

473470

474471
def prepare(
475-
tanker_source: TankerSource,
476-
*,
477-
profiles: List[Profile],
478-
update: bool = False,
479-
tanker_ref: Optional[str] = None,
472+
tanker_source: TankerSource,
473+
*,
474+
profiles: List[Profile],
475+
update: bool = False,
476+
tanker_ref: Optional[str] = None,
480477
) -> None:
481478
build_profile = tankerci.conan.get_build_profile()
482479
for host_profile in profiles:
@@ -487,9 +484,9 @@ def prepare(
487484

488485

489486
def build(
490-
*,
491-
profiles: List[Profile],
492-
test: bool = False,
487+
*,
488+
profiles: List[Profile],
489+
test: bool = False,
493490
) -> None:
494491
build_profile = tankerci.conan.get_build_profile()
495492
if os.environ.get("CI"):
@@ -594,7 +591,7 @@ def main() -> None:
594591
if args.command == "build":
595592
profiles = [Profile(p) for p in args.profiles]
596593
with tankerci.conan.ConanContextManager(
597-
[args.remote, "conancenter"], conan_home=user_home
594+
[args.remote, "conancenter"], conan_home=user_home
598595
):
599596
build(
600597
profiles=profiles,
@@ -604,7 +601,7 @@ def main() -> None:
604601
deploy(args)
605602
elif args.command == "prepare":
606603
with tankerci.conan.ConanContextManager(
607-
[args.remote, "conancenter"], conan_home=user_home
604+
[args.remote, "conancenter"], conan_home=user_home
608605
):
609606
profiles = [Profile(p) for p in args.profiles]
610607
prepare(

src/ctanker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub type LogHandlerCallback = Box<dyn Fn(LogRecord) + Send>;
4141
pub type CHttpRequestHandle = *mut tanker_http_request_handle_t;
4242

4343
#[derive(Debug)]
44+
#[cfg_attr(not(feature = "http"), allow(dead_code))]
4445
pub struct CHttpRequest(pub(crate) *mut tanker_http_request_t);
4546

4647
// SAFETY: ctanker is thread-safe

0 commit comments

Comments
 (0)