Closed geoffreygarrett closed 4 years ago
https://gitter.im/conda-forge/conda-forge.github.io/archives/2019/01/22
Isuru Fernando @isuruf Jan 22 2019 21:59 UTC
Returning the prefix as a compile time constant std::string might lead to issues with prefix replacement
Chris Burr @chrisburr Jan 22 2019 22:07 UTC
Because it can end up having lots of null bytes in the middle of a string like /my/prefix/sysroot\x00\x00\x00/usr/include?
This does not occur on linux, perhaps this is clang specific?
>>> get_spice_kernel_path()
'/home/ggarrett/miniconda3/envs/tenv1/resource/spice_kernels/'
>>> print(get_spice_kernel_path())
/home/ggarrett/miniconda3/envs/tenv1/resource/spice_kernels/
Not an elegant fix, but I'm grateful the 1 hour builds on TravisCI in an attempt to fix this is over. (I do not have access to a mac at the moment). Setting up a VM on my desktop at home is definitely on the to-do list.
https://github.com/conda/conda-build/issues/1674
#define MYPREFIX "/some/path/with/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla"
std::string p_wrong = MYPREFIX;
std::string p_correct = std::string(MYPREFIX).c_str();
Issue is specifically with clangxx as mentioned by tovrstra here.
Attempting to load any kernels using default file path strings in tudatpy in osx will result in the following error:
The path which is passed to spice is in actual fact
get_resource_path()
, without the final '/'.Initial thoughts were that there was an issue with the path concatenation inside
tudat-resources/include/tudat/resource.h
and the way that filepaths are padded withplaceholder
in conda.Further investigation:
Which is correct, although when observing the raw string:
It seems that the size of the variable containing the path information needs to be defined beforehand (I assume using char types rather than std::string). The following was found when printing a filepath stored in tudatpy. A temporary fix is to redefine 'spice_interface.load_standard_kernels()
with a higher level function
load_standard_spice_kernels()` which redefines the function in python, removing the escape sequence.