-
Notifications
You must be signed in to change notification settings - Fork 4
chore: remove dead intrinsic surface and unify the ABI version default #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cdd3b1a
705b29f
2377cb5
ccdfe55
55e77c0
7a10f46
dd9ccdf
8d94682
9f9473b
b5394ff
b82df2f
d0c406f
c28fe9a
995de04
edabb09
9c35d1d
ec3b84d
c3be9d7
fc675ed
5578e17
482e2ed
511b1ad
97756f9
5f7d0c6
3cc7752
0729b54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # Stage the CDT-owned parts of the build tree -- headers into <build>/include and the | ||
| # native archives in <build>/lib -- pruning first. | ||
| # | ||
| # Run in script mode (`cmake -P`) from the `stage_cdt_tree` build target, not at | ||
| # configure time. Configure-time `file(COPY)` is additive: it never removes a staged | ||
| # copy whose source has been deleted, so a removed header stayed in <build>/include | ||
| # forever -- shipped by install/CPack, and visible to native consumers whose compiled | ||
| # view could then disagree with the rebuilt library. Reusing a build tree across such | ||
| # a deletion is the case this exists to handle, and a configure-time copy cannot, | ||
| # because the ExternalProject's configure step is stamped and does not re-run. | ||
| # | ||
| # The two destinations OVERLAP: sysiolib owns include/sysiolib, and native's second | ||
| # copy lands in include/sysiolib/native, a subdirectory of it. Pruning and copying | ||
| # from one ordered script is what makes that safe -- two independent steps would race | ||
| # to delete each other's output. | ||
| # | ||
| # `file(COPY)` preserves source timestamps, so re-running every build neither churns | ||
| # mtimes nor triggers downstream rebuilds. (It also skips files already current at the | ||
| # destination, but that never applies here: both destinations are REMOVE_RECURSE'd | ||
| # below before either is repopulated.) | ||
| # | ||
| # EVERY tree staged into <build>/include is handled here. The four vendored ones -- libc, | ||
| # libcxx, boost/preprocessor and bluegrass -- were left as configure-time copies in an | ||
| # earlier revision, which meant deleting a header from the cdt-musl or cdt-libcxx submodule | ||
| # left the staged copy shipping forever, exactly the bug this script exists to fix. They are | ||
| # pruned and recopied on the same schedule now. | ||
| # | ||
| # Inputs (via -D): | ||
| # STAGE_SOURCE_DIR - the repo's libraries/ directory | ||
| # STAGE_BINARY_DIR - BASE_BINARY_DIR, whose include/ subtree is staged into | ||
| # STAGE_NATIVE - truthy when ENABLE_NATIVE_COMPILER is on | ||
|
|
||
| foreach(var STAGE_SOURCE_DIR STAGE_BINARY_DIR) | ||
| if(NOT DEFINED ${var}) | ||
| message(FATAL_ERROR "stage_cdt_tree.cmake: ${var} is required") | ||
| endif() | ||
| endforeach() | ||
|
|
||
| set(header_patterns FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") | ||
|
|
||
| # Prune BOTH trees before either is repopulated, and prune the native tree whether or | ||
| # not native mode is on. Pruning it inside the STAGE_NATIVE branch left the previous | ||
| # build's native headers staged when a reused tree flipped ENABLE_NATIVE_COMPILER from | ||
| # ON to OFF -- and since InstallCDT.cmake installs the whole include tree, an OFF build | ||
| # then packaged an API it was configured not to build. (include/sysiolib/native happens | ||
| # to vanish with its parent; include/sysio/native has no such parent.) | ||
| file(REMOVE_RECURSE "${STAGE_BINARY_DIR}/include/sysiolib") | ||
| file(REMOVE_RECURSE "${STAGE_BINARY_DIR}/include/sysio/native") | ||
| file(REMOVE_RECURSE "${STAGE_BINARY_DIR}/include/libc") | ||
| file(REMOVE_RECURSE "${STAGE_BINARY_DIR}/include/libcxx") | ||
| file(REMOVE_RECURSE "${STAGE_BINARY_DIR}/include/boost/preprocessor") | ||
| file(REMOVE_RECURSE "${STAGE_BINARY_DIR}/include/bluegrass") | ||
|
|
||
| # sysiolib -> include/sysiolib | ||
| file(COPY "${STAGE_SOURCE_DIR}/sysiolib" | ||
| DESTINATION "${STAGE_BINARY_DIR}/include" | ||
| ${header_patterns}) | ||
|
|
||
| # The native-host archives are copied into lib/ by POST_BUILD commands that exist only while | ||
| # ENABLE_NATIVE_COMPILER is on. Reconfiguring a reused tree to OFF removes those targets but | ||
| # not the files they already copied, and InstallCDT.cmake installs lib/ wholesale -- so an OFF | ||
| # build packaged archives its own configuration never produced, still carrying whatever symbols | ||
| # the last ON build put in them. | ||
| # | ||
| # libnative* ONLY. libsf.a is a WebAssembly archive, not a native-host one: cdt-ld links it | ||
| # with -lsf for --use-rt and every --fquery mode (compiler_options.hpp.in), and the base | ||
| # install ships it. It is declared in libraries/native/CMakeLists.txt but OUTSIDE that file's | ||
| # native-only guard, so every configuration builds and stages it -- deleting it here would | ||
| # strip the copy an OFF package needs to link those modes. | ||
| if(NOT STAGE_NATIVE) | ||
| file(GLOB stale_native "${STAGE_BINARY_DIR}/lib/libnative*") | ||
| if(stale_native) | ||
| file(REMOVE ${stale_native}) | ||
| endif() | ||
| endif() | ||
|
|
||
| if(STAGE_NATIVE) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Prune the native tree when native mode is disabled Because
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed and fixed in 2377cb5. Both trees are now pruned unconditionally, before either is repopulated — You were also right that the staging test could not catch it: its invariant is "no staged file without a source counterpart", and these files have counterparts — they simply should not be staged in that configuration. Those are orthogonal properties, so it needed a separate assertion rather than a stronger version of the same one. |
||
| # native -> include/sysio/native | ||
| file(COPY "${STAGE_SOURCE_DIR}/native" | ||
| DESTINATION "${STAGE_BINARY_DIR}/include/sysio" | ||
| ${header_patterns} PATTERN "softfloat" EXCLUDE) | ||
|
|
||
| # native/native -> include/sysiolib/native (inside the tree pruned above) | ||
| file(COPY "${STAGE_SOURCE_DIR}/native/native" | ||
| DESTINATION "${STAGE_BINARY_DIR}/include/sysiolib" | ||
| ${header_patterns} PATTERN "softfloat" EXCLUDE) | ||
| endif() | ||
|
|
||
| # The vendored trees. libc and libcxx copy whole directories rather than header-matching, | ||
| # because musl and libc++ both ship extensionless headers (<cstdint>, <vector>, ...) that a | ||
| # "*.h;*.hpp" filter would drop. | ||
| file(COPY "${STAGE_SOURCE_DIR}/libc/cdt-musl/include/" DESTINATION "${STAGE_BINARY_DIR}/include/libc/") | ||
| file(COPY "${STAGE_SOURCE_DIR}/libc/cdt-musl/src/internal/" DESTINATION "${STAGE_BINARY_DIR}/include/libc/") | ||
| file(COPY "${STAGE_SOURCE_DIR}/libc/cdt-musl/arch/eos/" DESTINATION "${STAGE_BINARY_DIR}/include/libc/") | ||
| file(COPY "${STAGE_SOURCE_DIR}/libc++/cdt-libcxx/include/" DESTINATION "${STAGE_BINARY_DIR}/include/libcxx") | ||
| file(COPY "${STAGE_SOURCE_DIR}/boost/include/boost/preprocessor" | ||
| DESTINATION "${STAGE_BINARY_DIR}/include/boost") | ||
| file(COPY "${STAGE_SOURCE_DIR}/meta_refl/include/bluegrass" | ||
| DESTINATION "${STAGE_BINARY_DIR}/include") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,6 @@ | |
| #include <sysio/system.h> | ||
| #include <sysio/transaction.h> | ||
| #include <sysio/types.h> | ||
| #include <sysio/security_group.h> | ||
|
|
||
| #include <type_traits> | ||
| #include <functional> | ||
|
|
@@ -102,10 +101,6 @@ intrinsic_macro(send_context_free_inline) \ | |
| intrinsic_macro(get_context_free_data) \ | ||
| intrinsic_macro(get_sender) \ | ||
| intrinsic_macro(set_action_return_value) \ | ||
| intrinsic_macro(add_security_group_participants) \ | ||
| intrinsic_macro(remove_security_group_participants) \ | ||
| intrinsic_macro(in_active_security_group) \ | ||
| intrinsic_macro(get_active_security_group) \ | ||
| intrinsic_macro(blake2_f) \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Refresh the staged headers when removing these entries.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed, and fixed here in 705b29f. You were right about more than the mechanism: the two deleted headers were still staged in my own build tree after the rebuild that produced the "29/29 green" in the PR body. So the green run was against a partially stale staging area — thanks for catching it. Staging moves out of the three configure-time One thing worth flagging from doing it: the destinations overlap. Verified the upgrade case specifically, since a green ctest does not demonstrate it — I planted both removed headers back into the existing tree and rebuilt without reconfiguring:
New |
||
| intrinsic_macro(blake2b_256) \ | ||
| intrinsic_macro(sha3) \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Remove stale native archives before packaging an OFF rebuild
This dependency runs the nested build, but reconfiguring a reused tree from native ON to OFF only removes the native targets; it does not delete the archives they previously copied into
${CMAKE_BINARY_DIR}/lib.InstallCDT.cmakestill picks up stalelibnative*.afor dev/TGZ and stalelibsf.afor base/TGZ. In an existing tree,libnative.astill contains all four security-group symbols removed by this PR, so the documented upgrade/package path can ship the old implementation even after this dependency runs. Please prune those outputs when native mode is off (or make installation configuration-aware) and cover the ON→OFF package payload.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in 7a10f46, and I agree this one mattered most — it meant the documented upgrade path could ship the very API this PR deletes.
Two layers:
stage_cdt_tree(renamed fromstage_headers, since it no longer stages only headers) pruneslib/libnative*andlib/libsf.awhen native mode is off. That target already runs at build time and already prunes the header trees for exactly this reason, so it is the same mechanism rather than a new one.libnative*install inInstallCDT.cmakeis now guarded onENABLE_NATIVE_COMPILER, so a stale file cannot be packaged even if something reintroduces one.Verified the prune against a scratch tree seeded the way an earlier ON build leaves one:
libsf.awas the easy one to miss — it goes to the base component, notdev, so it would have shipped in the plain package too.staged_headers_tests.shnow asserts those archives are absent when native is off, alongside the header trees.