Skip to content

Commit 4d92a2a

Browse files
committed
Update
[ghstack-poisoned]
2 parents 765d77b + d3a2516 commit 4d92a2a

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,13 @@ def _write_cmake_version_file(destination: str) -> None:
367367
"""Generate the CMake package version file next to the package config.
368368
369369
Read from version.txt so the version CMake reports is the same one the wheel and
370-
the runtime SONAME use. Written by hand rather than with
371-
write_basic_package_version_file because that helper needs a CMake run, and this
372-
file is produced while assembling the wheel.
370+
the runtime SONAME use.
371+
372+
Written by hand rather than from CMake's own template because the rule here is
373+
deliberately stricter than any stock one: a request above the package version is
374+
refused, not just a different major. A delegate built against one release cannot be
375+
assumed to work with a later one, so accepting a higher request would let a consumer
376+
match a package that does not satisfy it.
373377
"""
374378
root = os.path.dirname(os.path.abspath(__file__))
375379
with open(os.path.join(root, "version.txt")) as handle:

tools/cmake/executorch-wheel-config.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
# find_package(executorch REQUIRED)
1313
# target_link_libraries(my_app PRIVATE executorch::runtime)
1414
# ~~~
15+
#
16+
# This file describes the same contract as the in-tree package config, but is written by hand
17+
# rather than generated, because the wheel copies build products out of the build tree instead
18+
# of running an install step. That leaves two descriptions of one contract, which is why a
19+
# target already defined by an in-tree build has to be detected and left alone below.
20+
#
21+
# The end state that removes the duplication is a staged install whose generated targets file
22+
# the wheel ships, so the source and wheel contracts become the same object rather than two
23+
# things that must agree.
1524
# -------
1625
#
1726
# Finds the ExecuTorch library

0 commit comments

Comments
 (0)