HaxeFoundation / HaxeFoundation/haxe

[cpp] output an error for incompatible hxcpp versions

Open
#6,012 0 comments 7 reactions 1 assignee Claimed by @hughsando View on GitHub
platform-cpp
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Updating Haxe is not a very user-friendly process. For a lot of users, it goes like this:

1. Download and run the installer.
2. Compile something to cpp.
3. Be greeted with random native compiler errors, such as:

```
C:/HaxeToolkit/haxe/lib/hxcpp/3,3,49/include\hx/LessThanEq.h(4): note: see declaration of 'hx'
include\Std.h(35): error C2061: syntax error: identifier 'Ctx'
include\Std.h(36): error C3083: 'Ctx': the symbol to the left of a '::' must be a type
include\Std.h(36): error C2039: 'alloc': is not a member of 'hx'
[...]
```

The issue is of course that the user didn't update hxcpp, but not all users are aware of all the moving parts in the Haxe ecosystem (and this still happens to Haxe "veterans"). Either way, I've seen this time and time again, [this](https://github.com/HaxeFlixel/flixel/issues/2036) is just one example.

The obvious solution is to **define the minimum required hxcpp version in Haxe** whenever a release is made. In that case, if you attempt to compile to cpp with Haxe 3.4.0 and hxcpp < 3.4.49, a helpful error message could be presented to the user. for instance:

>Haxe 3.4.0 requires hxcpp 3.4.49 or higher. Please run 'haxelib update hxcpp'.

There might be one issue here: if the version check is based on haxelib, care has to be taken not to break git "versions" etc (since haxelib allows arbitrary strings to be used as versions IIRC).

A Haxe 3.4.1 release, if there is one, might be a good time to start with this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.