Skip to content

Commit c77fdab

Browse files
committed
undo non-relevant changes
1 parent 4083ae9 commit c77fdab

File tree

4 files changed

+21
-27
lines changed

4 files changed

+21
-27
lines changed

build/resolve_buck.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ class BuckInfo:
9595
"c7d378f3f307e9590f0b29a5f7f1b21b8e784f4e4bd30a0160b2a69df50d2ee0"
9696
],
9797
),
98-
("windows", "x86_64"): BuckInfo(
99-
archive_name="buck2-x86_64-pc-windows-msvc.exe.zst",
100-
target_versions=[
101-
"bf1685c4c4ddd9de4592b5a955cb7326fd01e6c4d5f561643422bed961a17401"
102-
],
103-
),
10498
}
10599

106100

install_executorch.bat

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ rem This batch file provides a basic functionality similar to the bash script.
77

88
cd /d "%~dp0"
99

10-
rem Under windows it's always python
11-
set PYTHON_EXECUTABLE=python
10+
rem Find the names of the python tools to use (replace with your actual python installation)
11+
if "%PYTHON_EXECUTABLE%"=="" (
12+
if "%CONDA_DEFAULT_ENV%"=="" OR "%CONDA_DEFAULT_ENV%"=="base" OR NOT EXIST "python" (
13+
set PYTHON_EXECUTABLE=python3
14+
) else (
15+
set PYTHON_EXECUTABLE=python
16+
)
17+
)
1218

1319
"%PYTHON_EXECUTABLE%" install_executorch.py %*
1420

runtime/platform/compiler.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,14 @@
100100
#endif // (__cplusplus) >= 202002L
101101

102102
/// Define a C symbol with weak linkage.
103-
// Building on Windows also need this. Windows build uses clang-cl compiler,
104-
// which supports __attribute__((weak)).
103+
#ifdef _MSC_VER
104+
// There currently doesn't seem to be a great way to do this in Windows and
105+
// given that weak linkage is not really critical on Windows, we'll just leave
106+
// it as a stub.
107+
#define ET_WEAK
108+
#else
105109
#define ET_WEAK __attribute__((weak))
110+
#endif
106111

107112
/**
108113
* Annotation marking a function as printf-like, providing compiler support

setup.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,7 @@ def src_path(self, installer: "InstallerBuildExt") -> Path:
243243
src_path = src_path.replace("%BUILD_TYPE%", cfg)
244244
else:
245245
# Remove %BUILD_TYPE% from the path.
246-
<<<<<<< HEAD
247246
src_path = src_path.replace("/%BUILD_TYPE%", "")
248-
=======
249-
self.src = self.src.replace("%BUILD_TYPE%/", "")
250-
>>>>>>> 038fa5307 (fix windows build issue)
251247

252248
# Construct the full source path, resolving globs. If there are no glob
253249
# pattern characters, this will just ensure that the source file exists.
@@ -295,7 +291,7 @@ def __init__(
295291
output is in a subdirectory named after the build type. For single-
296292
config generators (like Makefile Generators or Ninja), this placeholder
297293
will be removed.
298-
src_name: The name of the file to install.
294+
src_name: The name of the file to install
299295
dst: The path to install to, relative to the root of the pip
300296
package. If dst ends in "/", it is treated as a directory.
301297
Otherwise it is treated as a filename.
@@ -349,25 +345,20 @@ def inplace_dir(self, installer: "InstallerBuildExt") -> Path:
349345
class BuiltExtension(_BaseExtension):
350346
"""An extension that installs a python extension that was built by cmake."""
351347

352-
def __init__(self, src_dir: str, src_name: str, modpath: str):
348+
def __init__(self, src: str, modpath: str):
353349
"""Initializes a BuiltExtension.
354350
355351
Args:
356-
src_dir: The directory of the file to install, relative to the cmake-out
357-
directory. A placeholder %BUILD_TYPE% will be replaced with the build
358-
type for multi-config generators (like Visual Studio) where the build
359-
output is in a subdirectory named after the build type. For single-
360-
config generators (like Makefile Generators or Ninja), this placeholder
361-
will be removed.
362-
src_name: The name of the file to install. If the path ends in `.so`,
352+
src: The path to the file to install (typically a shared library),
353+
relative to the cmake-out directory. May be an fnmatch-style
354+
glob that matches exactly one file. If the path ends in `.so`,
363355
this class will also look for similarly-named `.dylib` files.
364356
modpath: The dotted path of the python module that maps to the
365357
extension.
366358
"""
367359
assert (
368360
"/" not in modpath
369361
), f"modpath must be a dotted python module path: saw '{modpath}'"
370-
src = os.path.join(src_dir, src_name)
371362
# This is a real extension, so use the modpath as the name.
372363
super().__init__(src=f"%CMAKE_CACHE_DIR%/{src}", dst=modpath, name=modpath)
373364

@@ -792,9 +783,7 @@ def get_ext_modules() -> List[Extension]:
792783
# portable kernels, and a selection of backends. This lets users
793784
# load and execute .pte files from python.
794785
BuiltExtension(
795-
src_dir="%BUILD_TYPE%/",# Set the src directory based on build configuration for windows.
796-
src_name="_portable_lib.cp*",# Rename _portable_lib.* to _portable_lib.cp* to avoid _portable_lib.lib is selected on windows.
797-
modpath="executorch.extension.pybindings._portable_lib",
786+
"_portable_lib.*", "executorch.extension.pybindings._portable_lib"
798787
)
799788
)
800789
if ShouldBuild.training():

0 commit comments

Comments
 (0)