Fix path encoding issues (#1153)#2654
Conversation
nickclark2016
left a comment
There was a problem hiding this comment.
I see a lot of what feels like duplicate code for handling MBCS conversions. Can we make a utility function somewhere that handles all of this in one spot? Definitely in favor of this change. It'll be nice having better UTF support within Premake.
I was doing a self-review and realized that as well. Going to make it an actual Lua auxiliary extension that hopefully I can work back into the Lua upstream. Working on that now. |
Shall we defer this PR until it's in the Lua upstream, figure out what work needs to be done to bring in the latest Lua version, then readdress within Premake? I'd like to get this change landed before 5.0 stabilizes, so we don't break any ABIs that may be relied upon by native Premake addons post 5.0. |
Personally I'd like to land it here first. Premake already is on an older version of Lua and has Lua modifications, plus I think it's a longer task to get any changes in Lua upstream.
100% agree, there shouldn't be any API/ABI affect with this other than making UTF-8 work for filenames |
29547fe to
5ec46ca
Compare
|
@nickclark2016 alright, take a look now. All tests pass for me on linux and windows |
|
Looks like there are still a fair amount of compilation failures. It's also worth noting that we attempt to support system installs of our vendored libraries, so we can't really change the interface without risking breaking that. |
Got it; I didn't previously realize that. I guess this support would be conditional based on whether one builds with the |
5ec46ca to
aba02b0
Compare
|
@nickclark2016 can you kick off another CI run? I've rewritten history to only 3 commits, but also fixed several issues with mingw/system libs/clang on windows/etc. |
|
Thanks, much closer. I'll look into the solaris compile issue and failing netbsd test tomorrow. Is there any way for me to be able to start CI jobs without adding a comment to request it manually? |
|
I don't have permissions to allow that, but as soon as you land this, I believe any future PRs would not have this problem. Also, those VM based actions are flakey. Looks like the issue was the action itself, not the build. Only thing left appears to be issues in the web actions. |
You might enable actions in your Clone repo. |
aba02b0 to
b87c647
Compare
|
Alright, I think all the fixes are in now. Please kick off another build. I believe that the website build issue is unrelated. Looks like the root cause is: which doesn't seem related to my changes. Might need a fix like pinning the node version or a docusaurus update or a package-lock.json or something to lock the versions 🤷 |
|
Ah yeah, looks like we need to actually use a package-lock.json (pretty sure none of the core contributors are actually web devs) |
Added another PR to fix the website here. I enabled actions on my fork and it passes there now (at least the check part; i obviously cannot publish) |
b87c647 to
0ed0638
Compare
|
Oh good. The auto jobs are working now. |
yeah i just needed to land a change 😅 |
|
The dragonflybsd check that failed timed out while booting QEMU. Can you manually restart just that one job? |
|
Giving this a deep dive now that everything is built and the tests are happy. Are the tests in a state where they should catch regressions? I'm looking at going in to update the dependencies in the very near future, so I don't want to break the improvements you've made here. |
Yes, the tests should validate all of the changed functionality so regressions should be caught. Plus we define If you have any issues updating dependencies just lmk. Next step is for me to try to get the Lua changes upstreamed there too. |
|
https://premake.github.io/docs/Building-Premake If we had better documentation on how to build with the contrib folder vs system, it would live here. To not dump that additional work on you after this massive lift, would you mind just opening an issue, dumping a blurb there about UTF8 support, and setting me as the assignee (if you have permission to do so)? Then I can get it massaged into an fuller section on the various build options. |
|
@nickclark2016 can't assign, but mentioned you: #2658 If I get some spare time I can try to help out too. |
On my list to address before 5.0 stable (hopefully soon), thanks! |
nickclark2016
left a comment
There was a problem hiding this comment.
Overall, very happy with the state of this. General question to chew on:
Should we have the UTF8 changes better macro-ed off? This would let us turn on and off UTF8 support, which would be a nice to have for building using system dependencies instead of the contrib modules.
| filter { "system:windows", "configurations:Release" } | ||
| incrementallink "Off" | ||
|
|
||
| filter { "system:windows" } |
There was a problem hiding this comment.
Does characterset "Unicode" not work?
There was a problem hiding this comment.
Overall, very happy with the state of this.
Should we have the UTF8 changes better macro-ed off? This would let us turn on and off UTF8 support, which would be a nice to have for building using system dependencies instead of the contrib modules.
I don't think it's really necessary. If you build with system Lua on Windows, the _UTF8_ENABLED doesn't get set (will evaluate as nil) which is how you know if you have UTF-8 support. You still get some UTF-8 support but it cannot be relied upon (which is kind of how it was before this change). But ideally I manage to get the Lua changes upstream and we can update to that, so it might be a moot point.
Does characterset "Unicode" not work?
It does for vs (i tried with vs2022), but not for mingw. I'll push an update and I can make an issue if you want.
There was a problem hiding this comment.
Let's go ahead an open an issue and have it reference this, I don't want to block this.
0ed0638 to
02866be
Compare
|
I'm going to leave this open for a few days for others to review, but LGTM at this point. Thanks!! |
|
approved |
- Fix the regression introduced in premake#2654 - Update the document to match the long-standing existing behavior
What does this PR do?
Solves #1153 by adding complete UTF-8 path support to both the embedded Lua 5.3 and premake5 functions
closes #1153
How does this PR change Premake's behavior?
Existing behavior should remain unchanged. There are a few other minor fixes that I will enumerate later
Anything else we should know?
Don't think so, but feel free to ask away.
Can squash if necessary before merging. Also probably need to take a look at the documentation.
Did you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged)You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!