Comments (9)
I've reopened this issue because I believe we still need the patch for the code to compile.
from luau.
Does something like this make it work?
diff --git a/CLI/FileUtils.cpp b/CLI/FileUtils.cpp
index 0702b74..fff5e42 100644
--- a/CLI/FileUtils.cpp
+++ b/CLI/FileUtils.cpp
@@ -142,6 +142,7 @@ static bool traverseDirectoryRec(const std::string& path, const std::function<vo
joinPaths(buf, path.c_str(), data.d_name);
int type = data.d_type;
+ int mode = -1;
// we need to stat DT_UNKNOWN to be able to tell the type
if (type == DT_UNKNOWN)
@@ -153,18 +154,18 @@ static bool traverseDirectoryRec(const std::string& path, const std::function<vo
lstat(buf.c_str(), &st);
#endif
- type = IFTODT(st.st_mode);
+ mode = st.st_mode;
}
- if (type == DT_DIR)
+ if (type == DT_DIR || mode == S_IFDIR)
{
traverseDirectoryRec(buf, callback);
}
- else if (type == DT_REG)
+ else if (type == DT_REG || mode == S_IFREG)
{
callback(buf);
}
- else if (type == DT_LNK)
+ else if (type == DT_LNK || mode == S_IFLNK)
{
// Skip symbolic links to avoid handling cycles
}
from luau.
kid why are you trying to compile on android LOL
from luau.
Does something like this make it work?
diff --git a/CLI/FileUtils.cpp b/CLI/FileUtils.cpp index 0702b74..fff5e42 100644 --- a/CLI/FileUtils.cpp +++ b/CLI/FileUtils.cpp @@ -142,6 +142,7 @@ static bool traverseDirectoryRec(const std::string& path, const std::function<vo joinPaths(buf, path.c_str(), data.d_name); int type = data.d_type; + int mode = -1; // we need to stat DT_UNKNOWN to be able to tell the type if (type == DT_UNKNOWN) @@ -153,18 +154,18 @@ static bool traverseDirectoryRec(const std::string& path, const std::function<vo lstat(buf.c_str(), &st); #endif - type = IFTODT(st.st_mode); + mode = st.st_mode; } - if (type == DT_DIR) + if (type == DT_DIR || mode == S_IFDIR) { traverseDirectoryRec(buf, callback); } - else if (type == DT_REG) + else if (type == DT_REG || mode == S_IFREG) { callback(buf); } - else if (type == DT_LNK) + else if (type == DT_LNK || mode == S_IFLNK) { // Skip symbolic links to avoid handling cycles }
from luau.
Great, thanks for confirming.
from luau.
Managed to get it working after realising what I was doing was incorrect (talking about the second comment)
from luau.
Managed to get it working after realising what I was doing was incorrect (talking about the second comment)
You got it working without the patch?
from luau.
I've reopened this issue because I believe we still need the patch for the code to compile.
Yeah, the patch is still needed for compiling on Android.
from luau.
Ok - if someone with the device can test that with the patch, you can still run luau-analyze on a folder of source code (as a commandline argument) and can then make a PR that would be appreciated.
from luau.
Related Issues (20)
- What to do with Autocomplete? I wanted to ask it here, it gets seen more I believe HOT 4
- Annotate function with inferred types HOT 7
- setmetatable isn't inferring correct return type with generics HOT 1
- "Late definitions" - define members AFTER asserting type HOT 3
- Build a shared library and install headers HOT 1
- This module breaks type checking and crashes studio HOT 2
- Add support for generic table indexers HOT 5
- Track the local binding that a prefixed type reference is linked to
- Weird behaviour with a slot created by `lua_createtable()` being treated like it does not even exist. HOT 1
- Introduce a stable sorting method for `table` HOT 1
- The engine penalizes for annotating `typeof` type, but not for creating it. HOT 3
- BytecodeDistributionPerFunctionTest crashes HOT 2
- Remove the limitation that prevents type casting for named functions HOT 3
- Build releases for M1 via GitHub Actions
- Unable to create a class instance type from the instance table being a union type HOT 2
- Record type locations for definition files types (AstDeclaredClassProp and AstStatDeclareFunction)
- Table passed across modules flagged by type checker for missing optional property HOT 3
- luau-analyze should support loading in type definition files through a command line switch HOT 5
- Intersection types cant be used properly as parameters in other functions HOT 1
- Any remote debugger for luau?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luau.