Git Product home page Git Product logo

Comments (9)

zeux avatar zeux commented on July 17, 2024 1

I've reopened this issue because I believe we still need the patch for the code to compile.

from luau.

zeux avatar zeux commented on July 17, 2024

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.

endo4x avatar endo4x commented on July 17, 2024

kid why are you trying to compile on android LOL

from luau.

ThePotato97 avatar ThePotato97 commented on July 17, 2024

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
             }

This patch works for me

from luau.

zeux avatar zeux commented on July 17, 2024

Great, thanks for confirming.

from luau.

RealEthanPlayzDev avatar RealEthanPlayzDev commented on July 17, 2024

Managed to get it working after realising what I was doing was incorrect (talking about the second comment)

Screenshot_20211106-142327_Termux
Screenshot_20211106-142445_Termux

from luau.

ThePotato97 avatar ThePotato97 commented on July 17, 2024

Managed to get it working after realising what I was doing was incorrect (talking about the second comment)

Screenshot_20211106-142327_Termux Screenshot_20211106-142445_Termux

You got it working without the patch?

from luau.

ThePotato97 avatar ThePotato97 commented on July 17, 2024

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.

zeux avatar zeux commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.