Repository navigation
documentation/migration guide needed for breaking change in 0.26.0 #2851
Copy link
Copy link
Open
Description
Activity
@KrisThielemans
I ended up just throwing together a little regex find-replace script that did the job. Feel free to use/modify as you see fit. You can dump this in your top level repo directory and run it from there. Just update the path in the script and it should "just work".The main change in 0.26.0 is the include directory structure refactor. This script will update the include paths in a git repo you run it from to the new xtensor include structure.
https://gist.github.com/ThisIsFineTM/0058dc85cbd4df9977c459762ae2415b
#!/bin/sh # Author: github.com/ThisIsFineTM # Date: 2025-May-14 # # Licence: The Unlicense # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or distribute # this software, either in source code form or as a compiled binary, for any # purpose, commercial or non-commercial, and by any means. # # In jurisdictions that recognize copyright laws, the author or authors of # this software dedicate any and all copyright interest in the software to # the public domain. We make this dedication for the benefit of the public # at large and to the detriment of our heirs and successors. We intend this # dedication to be an overt act of relinquishment in perpetuity of all # present and future rights to this software under copyright law. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # For more information, please refer to <https://unlicense.org/> XTENSOR_INCLUDE_DIR="/path/to/xtensor/include" # search for each hpp file in the new xtensor/include directory # and trim the excess path characters, and for each hpp file that is found for NEW_PATH in $(find "${XTENSOR_INCLUDE_DIR}" -name "*.hpp" | sed 's/.*\(xtensor\/[[:alpha:]]\+\/.*\.hpp\)/\1/') ; do # reconstruct the old path from the new one OLD_PATH=$(echo "${NEW_PATH}" | awk -F '/' '{printf "%s/%s", $1, $3}') # git grep to list tracked files in your repo that have the # individual "#include" strings present. Then pipe to sed to # remove the color codes because git-grep's --no-color # misbehaves around files with a `-` in the name. for MY_FILE in $(git grep --no-color -l "#include <${OLD_PATH}>" | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g') ; do # the first character after the 's' in a sed command specifies the escape character, # so use @ as the escape so the slashes in the path don't confuse it sed -i "s@#include <${OLD_PATH}>@#include <${NEW_PATH}>@" "${MY_FILE}" done done
Reacted by Joe Naegele, Jichen Li and Pietro FantiReacted by Pietro Fanti- added 2 commits that reference this issue
on Feb 16, 2026
Metadata
Metadata
Assignees
Labels
No labels
#2829 moved included files (and I don't know what else). Of course, this code is still v0.x, but we depend on it nevertheless. Can someone give some advice on how to update our code?