File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1111import os
1212import shutil
1313import subprocess
14+ import sys
1415from enum import Enum
1516from pathlib import Path
1617from tempfile import mkdtemp
@@ -51,6 +52,19 @@ class BuildType(Enum):
5152 FACEBOOK = "facebook"
5253
5354
55+ def _custom_linker_option (pyre_directory : Path , build_type : BuildType ) -> str :
56+ # HACK: This is a temporary workaround for inconsistent OS installations
57+ # in FB-internal CI. Can be removed once all fleets are upgraded.
58+ if build_type == BuildType .FACEBOOK and sys .platform == "linux" :
59+ return (
60+ (pyre_directory / "facebook" / "scripts" / "custom_linker_options.txt" )
61+ .read_text ()
62+ .rstrip ()
63+ )
64+ else :
65+ return ""
66+
67+
5468class Setup (NamedTuple ):
5569 opam_root : Path
5670
@@ -91,7 +105,12 @@ def produce_dune_file(
91105 with open (pyre_directory / "source" / "dune.in" ) as dune_in :
92106 with open (pyre_directory / "source" / "dune" , "w" ) as dune :
93107 dune_data = dune_in .read ()
94- dune .write (dune_data .replace ("%VERSION%" , build_type .value ))
108+ dune .write (
109+ dune_data .replace ("%VERSION%" , build_type .value ).replace (
110+ "%CUSTOM_LINKER_OPTION%" ,
111+ _custom_linker_option (pyre_directory , build_type ),
112+ )
113+ )
95114
96115 def check_if_preinstalled (self ) -> None :
97116 if self .environment_variables .get (
Original file line number Diff line number Diff line change 207207 ppx_compare ppx_sexp_conv))
208208 (ocamlc_flags
209209 (:standard -custom))
210+ %CUSTOM_LINKER_OPTION%
210211 (libraries pyrelib))
211212
212213(alias
You can’t perform that action at this time.
0 commit comments