Add hint to update build tools when the smart string check is triggered
The information below is out of date: refer to @tobil4sk 's response and commits below that
~ ~
I'm unable to compile hxcpp without removing the smart string check, on the latest Haxe nightly version, and newest git version for hxcpp.
Haxe Compiler 5.0.0-preview.1+ff3f3ef
% haxelib git hxcpp https://github.com/haxefoundation/hxcpp
You already have hxcpp version git installed.
Library hxcpp version git already up to date
Current version is now git
Done
% haxe build.hxml
haxelib run hxcpp Build.xml haxe -Danalyzer_optimize="1" -Ddump.stage="dce" -Ddump_ignore_var_ids="1" -Ddump_path="dump" -Deval_call_stack_depth="1000" -Deval_print_depth="5" -Dhaxe="5.0.0-preview.1" -Dhaxe3="1" -Dhaxe4="1" -Dhaxe5="1" -Dhaxe_ver="5.000" -Dhxcpp_api_level="500" -Dhxcpp_smart_strings="1" -Dloop_unroll_max_cost="250" -Dmessage.log_format="indent" -Dmessage.reporting="pretty" -Dsource_header="Generated by Haxe 5.0.0-preview.1+ff3f3ef" -Dstatic="1" -Dtarget.atomics="1" -Dtarget.name="cpp" -Dtarget.static="1" -Dtarget.sys="1" -Dtarget.threaded="1" -Dtarget.unicode="1" -Dtarget.utf16="1" -Dutf16="1" -Isrc/ -I -I/usr/local/lib/haxe/std/cpp/_std/ -I/usr/local/lib/haxe/std/
Error: Hxcpp is out of date - please update
[ERROR] (unknown position)
| Error: Build failed
-Dhxcpp_smart_strings="1" is still in the compilation.
This is the build.hxml:
-cp src
-D analyzer-optimize
-main Main # simple hello world
--cpp bin/cpp
This message exists to catch issues which would manifest later on as C++ errors from internal hxcpp files. It's not a good idea to disable this check because it will turn a readable api mismatch error into more complicated errors that people will be more confused about.
If it's useful we could change the error message to be more helpful in the case where the user just needs to rebuild their hxcpp tools.
Originally it was only features related to hxcpp_smart_strings that needed additionally support from the hxcpp api, hence why the condition exists rather than it being on by default. Now it probably makes more sense to just enable it always because it is already very rare to compile without smart strings and there have been other api changes to hxcpp unrelated to them. The alternative would be to have a more robust system which can keep track of which features require which api version and only require a higher api version if it is strictly needed.
@tobil4sk thanks for the detailed explanation. A per feature api version, sounds like the best solution indeed.
For now I'll add back the check with a hint about the build tool system potentially being out of date.
Is this intentional? HxcppSmartStings and not HxcppSmartStrings (with an r)
HxcppSmartStings and not HxcppSmartStrings (with an r)
Seems like a typo: https://github.com/HaxeFoundation/haxe/blob/bb569d9b99c23a9db3809eb760784d7f3a51735d/src-json/define.json#L473
Another PR or can I put it in here?
I think it would be fine as part of this PR