Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error in TimeTrace.h when LUAU_ENABLE_TIME_TRACE enabled on ubuntu 20.04 #1437

Closed
JohnnyMorganz opened this issue Sep 23, 2024 · 1 comment · Fixed by #1440
Closed
Assignees
Labels
bug Something isn't working

Comments

@JohnnyMorganz
Copy link
Contributor

https://github.com/JohnnyMorganz/luau-lsp/actions/runs/10985940566/job/30498561508

In file included from /home/runner/work/luau-lsp/luau-lsp/luau/Ast/src/TimeTrace.cpp:2:
/home/runner/work/luau-lsp/luau-lsp/luau/Ast/include/Luau/TimeTrace.h: In member function ‘void Luau::TimeTrace::ThreadContext::eventArgument(const char*, const char*)’:
/home/runner/work/luau-lsp/luau-lsp/luau/Ast/include/Luau/TimeTrace.h:121:46: error: ‘strlen’ was not declared in this scope
  121 |         data.insert(data.end(), name, name + strlen(name) + 1);
      |                                              ^~~~~~
/home/runner/work/luau-lsp/luau-lsp/luau/Ast/include/Luau/TimeTrace.h:8:1: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
    7 | #include <memory>
  +++ |+#include <cstring>
    8 | 
/home/runner/work/luau-lsp/luau-lsp/luau/Ast/src/TimeTrace.cpp: In function ‘void Luau::TimeTrace::releaseThread(Luau::TimeTrace::GlobalContext&, Luau::TimeTrace::ThreadContext*)’:
/home/runner/work/luau-lsp/luau-lsp/luau/Ast/src/TimeTrace.cpp:139:24: error: ‘find’ is not a member of ‘std’
  139 |     if (auto it = std::find(context.threads.begin(), context.threads.end(), threadContext); it != context.threads.end())
      |                        ^~~~
make[3]: *** [luau/CMakeFiles/Luau.Ast.dir/build.make:163: luau/CMakeFiles/Luau.Ast.dir/Ast/src/TimeTrace.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/runner/work/luau-lsp/luau-lsp/build'
make[2]: *** [CMakeFiles/Makefile2:311: luau/CMakeFiles/Luau.Ast.dir/all] Error 2
make[2]: Leaving directory '/home/runner/work/luau-lsp/luau-lsp/build'
make[1]: *** [CMakeFiles/Makefile2:206: CMakeFiles/Luau.LanguageServer.CLI.dir/rule] Error 2
make[1]: Leaving directory '/home/runner/work/luau-lsp/luau-lsp/build'

Let me know if this is user error

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Sep 23, 2024
@vegorov-rbx vegorov-rbx self-assigned this Sep 23, 2024
@vegorov-rbx
Copy link
Collaborator

We have a fix prepared, it will be included in the release this week.

To resolve it locally until then, you can add includes for string.h in TimeTrace.h and <algorithm> in TimeTrace.cpp.

aatxe added a commit that referenced this issue Sep 27, 2024
In this update, we continue to improve the overall stability of the new
type solver. We're also shipping some early bits of two new features,
one of the language and one of the analysis API: user-defined type
functions and an incremental typechecking API.

If you use the new solver and want to use all new fixes included in this
release, you have to reference an additional Luau flag:
```c++
LUAU_DYNAMIC_FASTINT(LuauTypeSolverRelease)
```
And set its value to `645`:
```c++
DFInt::LuauTypeSolverRelease.value = 645; // Or a higher value for future updates
```

## New Solver

* Fix a crash where scopes are incorrectly accessed cross-module after
they've been deallocated by appropriately zeroing out associated scope
pointers for free types, generic types, table types, etc.
* Fix a crash where we were incorrectly caching results for bound types
in generalization.
* Eliminated some unnecessary intermediate allocations in the constraint
solver and type function infrastructure.
* Built some initial groundwork for an incremental typecheck API for use
by language servers.
* Built an initial technical preview for [user-defined type
functions](https://rfcs.luau-lang.org/user-defined-type-functions.html),
more work still to come (including calling type functions from other
type functions), but adventurous folks wanting to experiment with it can
try it out by enabling `FFlag::LuauUserDefinedTypeFunctionsSyntax` and
`FFlag::LuauUserDefinedTypeFunction` in their local environment. Special
thanks to @joonyoo181 who built up all the initial infrastructure for
this during his internship!

## Miscellaneous changes

* Fix a compilation error on Ubuntu (fixes #1437)

---

Internal Contributors:

Co-authored-by: Aaron Weiss <[email protected]>
Co-authored-by: Hunter Goldstein <[email protected]>
Co-authored-by: Jeremy Yoo <[email protected]>
Co-authored-by: Vighnesh Vijay <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>

---------

Co-authored-by: Alexander McCord <[email protected]>
Co-authored-by: Andy Friesen <[email protected]>
Co-authored-by: Vighnesh <[email protected]>
Co-authored-by: Aviral Goel <[email protected]>
Co-authored-by: David Cope <[email protected]>
Co-authored-by: Lily Brown <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
Co-authored-by: Junseo Yoo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants