You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/13 15:11:01 UTC

[GitHub] [incubator-nuttx] kassane opened a new pull request #5732: Zig build on NuttX

kassane opened a new pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732


   [Zig](https://ziglang.org) is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
   
   # Summary
   I made an example of [hello_zig](https://github.com/apache/incubator-nuttx-apps/pull/1059) in reference to the rust example accepted earlier.
   
   Zig besides building from the language itself is also currently a clang wrapper (allow cross-compilation) allowing you to compile C and C++(libc++ only) projects.
   
   # Impact
   
   none.
   
   # Testing
   
   Arch Linux - simulation (latest version 0.9.x & master/nightly)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r825649981



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       Will the next works?
   ```
   curl -Sl https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xC ${prebuilt}/zig/ --strip 1
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1071188589


   @kassane please rework the changes and issue the PR again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826080529



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       Sorry I made a typo.`l` must be `L`: `curl -SL`

##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       Sorry I made a typo.`l` must be `L`: `curl -SL`. Please try




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r825470083



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +70,30 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && mkdir $ZIG_HOME \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN curl -s https://ziglang.org/download/index.json \
+    | jq --raw-output '.master."x86_64-linux".tarball' \
+    | wget -q --show-progress -i -; \

Review comment:
       In this case curl just recv the json string to jq read info.
   You can change it, but I couldn't tell you how it would behave!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1071257935






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1066131198


   @kassane could you reorg your patch to remove the temporary change?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826288875



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,25 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp

Review comment:
       ```suggestion
   ```
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r825470083



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +70,30 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && mkdir $ZIG_HOME \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN curl -s https://ziglang.org/download/index.json \
+    | jq --raw-output '.master."x86_64-linux".tarball' \
+    | wget -q --show-progress -i -; \

Review comment:
       In this case curl just reads the json to transmit the info.
   You can change it, but I couldn't tell you how it would behave!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826333303



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN \
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin && \
+    curl -O -s $(curl -s https://ziglang.org/download/index.json \
+    | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
+    | jq -r .tarball); \
+    file=$(ls | grep '.tar.xz') && \
+    tar -xf $file &&\
+    folder=${file%.*.*} &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && \
+    echo "Zig version: $($ZIG_HOME/bin/zig version)\n Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)"

Review comment:
       I'm not sure if we have a consumer for that `echo` during the Docker image rebuild




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1066159421


   > > @kassane could you reorg your patch to remove the temporary change?
   > 
   > Rebase?
   
   yes, please:
   git remote add apache git@github.com:apache/incubator-nuttx.git
   ```
   git fetch apache
   git rebase apache/master
   git rebase --interactive HEAD~9
   [adjust your patchset in editor]
   git push -f origin zig-build
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826911719



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,24 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+        # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+	curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC "${prebuilt}"/zig --strip-components=1

Review comment:
       ```suggestion
           export ZIG_HOME=${prebuilt}/zig
           curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC "${prebuilt}"/zig --strip-components=1
   ```

##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,12 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+RUN mkdir -p $ZIG_HOME && \
+   curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC $ZIG_HOME --strip-components=1 

Review comment:
       ```suggestion
   RUN mkdir -p $ZIG_HOME \
     && curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC $ZIG_HOME --strip-components=1 
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1069195958


   Look like the CI doesn't get the last change from apps git, let retrigger CI again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826841771



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN \
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin && \
+    curl -O -s $(curl -s https://ziglang.org/download/index.json \
+    | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
+    | jq -r .tarball); \
+    file=$(ls | grep '.tar.xz') && \
+    tar -xf $file &&\
+    folder=${file%.*.*} &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && \
+    echo "Zig version: $($ZIG_HOME/bin/zig version)\n Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)"

Review comment:
       changed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826084745



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       I try `curl -Os`, it does not solve?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826318633



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN \
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin && \
+    curl -O -s $(curl -s https://ziglang.org/download/index.json \
+    | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
+    | jq -r .tarball); \
+    file=$(ls | grep '.tar.xz') && \
+    tar -xf $file &&\
+    folder=${file%.*.*} &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && \
+    echo "Zig version: $($ZIG_HOME/bin/zig version)\n Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)"

Review comment:
       But if that's the case, I can change it. It would be necessary?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826334053



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN \
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin && \
+    curl -O -s $(curl -s https://ziglang.org/download/index.json \
+    | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
+    | jq -r .tarball); \
+    file=$(ls | grep '.tar.xz') && \
+    tar -xf $file &&\
+    folder=${file%.*.*} &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && \
+    echo "Zig version: $($ZIG_HOME/bin/zig version)\n Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)"

Review comment:
        think that it is better to have tools version controlled, so it will not pick tools randomly from one image rebuild to another




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r825468945



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -89,10 +88,11 @@ RUN curl -s https://ziglang.org/download/index.json \
     file=$(ls | grep 'zig*.*.*') && \
     tar -xvf $file &&\
     folder=$file \
-    folder=${folder%.*.*} \
-    && mkdir -p $ZIG_HOME &&\
-    mv $folder/* $ZIG_HOME &&\
-    rm -rf $folder && echo "Zig version: " && $ZIG_HOME/bin/zig version
+    folder=${folder%.*.*} &&\

Review comment:
       merge to previous patch

##########
File path: tools/ci/cibuild.sh
##########
@@ -395,7 +395,7 @@ function zig {
         export ZIG_HOME=${prebuilt}/zig
         cd /tmp
 	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz
-	tar -xf zig-linux-x86_64-0.9.1.tar.xz && rm zig-linux-x86_64-0.9.1.tar.xz && mv zig-linux-x86_64-.0.9.1/* "${prebuilt}"/zig && rm -fr zig-linux-x86_64-0.9.1
+	tar -xf zig-linux-x86_64-0.9.1.tar.xz && rm zig-linux-x86_64-0.9.1.tar.xz && mv zig-linux-x86_64-0.9.1/* "${prebuilt}"/zig && rm -fr zig-linux-x86_64-0.9.1

Review comment:
       merge to previous patch

##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +70,30 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && mkdir $ZIG_HOME \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN curl -s https://ziglang.org/download/index.json \
+    | jq --raw-output '.master."x86_64-linux".tarball' \
+    | wget -q --show-progress -i -; \

Review comment:
       can we replace wget with curl here?

##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -90,7 +90,7 @@ RUN curl -s https://ziglang.org/download/index.json \
     folder=$file \
     folder=${folder%.*.*} &&\
     mkdir -p $ZIG_HOME/{bin,lib/zig} &&\
-    mv $folder/lib/* ~/.local/lib/zig &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig &&\

Review comment:
       ditto

##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -84,15 +84,15 @@ ENV ZIG_HOME=/tools/zig
 # Nightly
 RUN curl -s https://ziglang.org/download/index.json \
     | jq --raw-output '.master."x86_64-linux".tarball' \
-    | wget -q --show-progress -i -; \
+    | wget -q -i -; \
     file=$(ls | grep 'zig*.*.*') && \
-    tar -xvf $file &&\
+    tar -xf $file &&\
     folder=$file \
     folder=${folder%.*.*} &&\
-    mkdir -p $ZIG_HOME/{bin,lib/zig} &&\
-    mv $folder/lib/* $ZIG_HOME/lib/zig &&\
-    mv $folder/zig $ZIG_HOME/bin &&\
-    rm -rf $folder && echo -e "Zig version: $($ZIG_HOME/bin/zig version)\n"
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && echo "Zig version: $($ZIG_HOME/bin/zig version)\n" && echo "Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)\n"

Review comment:
       merge too




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1066155234


   > @kassane could you reorg your patch to remove the temporary change?
   
   Rebase?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826106927



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       with `curl -SL` you can do all in a single line without need to do `tar && rm && mv && rm -rf`. I did it some time ago and it was working. Maybe this is not the case here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826969875



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -43,6 +43,7 @@ ARCHDEFINES += -U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
 ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
   ARCHOPTIMIZATION = -g
   ARCHOPTIMIZATIONRUST = -g
+  ARCHOPTIMIZATIONZIG = -O Debug

Review comment:
       CONFIG_DEBUG_SYMBOLS is for symbol generation, not for optimization.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1066288585


   @kassane I think the change for docker is also needed, you can create another patch for docker.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r825870707



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       replaced




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826315809



##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN \
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin && \
+    curl -O -s $(curl -s https://ziglang.org/download/index.json \
+    | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
+    | jq -r .tarball); \
+    file=$(ls | grep '.tar.xz') && \
+    tar -xf $file &&\
+    folder=${file%.*.*} &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && \
+    echo "Zig version: $($ZIG_HOME/bin/zig version)\n Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)"

Review comment:
       In docker there would be a continuous update without having to specify versions manually. Since zig has no updater.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1069188579


   cc: @pkarashchenko @xiaoxiang781216 
   
   I try:
   
   ```bash
   $> ./tools/refresh.sh --silent sim:zig && git status
     Normalize sim:zig
   On branch zig-build
   Your branch is up to date with 'origin/zig-build'.
   
   nothing to commit, working tree clean
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1069210050


   I found some errors in app rules:
   
   - https://github.com/apache/incubator-nuttx-apps/pull/1080


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r825868208



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       I don't know what version of curl you have, but here it reports an error and suggests `-J` for extracting the tar file.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826303635



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,24 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+	curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC "${prebuilt}"/zig --strip-components=1

Review comment:
       ```suggestion
           # Currently Debian don't install zig (only built)
           export ZIG_HOME=${prebuilt}/zig
   	curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC "${prebuilt}"/zig --strip-components=1
   ```

##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN \
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin && \
+    curl -O -s $(curl -s https://ziglang.org/download/index.json \
+    | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
+    | jq -r .tarball); \
+    file=$(ls | grep '.tar.xz') && \
+    tar -xf $file &&\
+    folder=${file%.*.*} &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && \
+    echo "Zig version: $($ZIG_HOME/bin/zig version)\n Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)"

Review comment:
       ```suggestion
   RUN mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin \
     && curl -O -s $(curl -s https://ziglang.org/download/index.json \
     | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
     | jq -r .tarball) \
     && file=$(ls | grep '.tar.xz') \
     && tar -xf $file \
     && folder=${file%.*.*} \
     && mv $folder/lib/* $ZIG_HOME/lib/zig/ \
     && mv $folder/zig $ZIG_HOME/bin/ \
     && rm -rf $folder
   ```

##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version
+
+# Nightly
+RUN \
+    mkdir -p $ZIG_HOME/lib/zig && mkdir $ZIG_HOME/bin && \
+    curl -O -s $(curl -s https://ziglang.org/download/index.json \
+    | jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
+    | jq -r .tarball); \
+    file=$(ls | grep '.tar.xz') && \
+    tar -xf $file &&\
+    folder=${file%.*.*} &&\
+    mv $folder/lib/* $ZIG_HOME/lib/zig/ &&\
+    mv $folder/zig $ZIG_HOME/bin/ &&\
+    rm -rf $folder && \
+    echo "Zig version: $($ZIG_HOME/bin/zig version)\n Zig/Clang version: $($ZIG_HOME/bin/zig cc --version)"

Review comment:
       BTW why we can't use `curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC $(ZIG_HOME) --strip-components=1` ?

##########
File path: tools/ci/docker/linux/Dockerfile
##########
@@ -68,6 +69,31 @@ RUN mkdir -p $CARGO_HOME \
   && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
   && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
 
+
+# Install Zig from NuttX
+ENV ZIG_HOME=/tools/zig
+
+# Stable
+#RUN apt-get install -y -qq \
+#  python3 \
+#  python3-pip \
+#  && pip3 install ziglang \
+#  && python3 -m ziglang version

Review comment:
       ```suggestion
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r825560041



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,26 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz

Review comment:
       change wget to curl?

##########
File path: tools/ci/cibuild.sh
##########
@@ -395,7 +395,7 @@ function zig {
         export ZIG_HOME=${prebuilt}/zig
         cd /tmp
 	wget --quiet https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz
-	tar -xf zig-linux-x86_64-0.9.1.tar.xz && rm zig-linux-x86_64-0.9.1.tar.xz && mv zig-linux-x86_64-.0.9.1/* "${prebuilt}"/zig && rm -fr zig-linux-x86_64-0.9.1

Review comment:
       merge to previous commit




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1067855575


   Please squash intermediate commits. Other parts LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1071188589


   @kassane please rework the changes and issue the PR again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1071267465


   # Status
   
   - Actually, on yesterday I had done a manual test, after building libapps with zig hello_example and it worked.
   But during build systems, I realized that zig was not invoked by `Application.mk`, although in the test also enabled rust_example (ref) and it was invoked normally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1066703605


   @kassane please merge the fix for the previous patch into one. We need ensure each patch in the final shape.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826110474



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,46 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	curl -Os https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz
+	tar -xf zig-linux-x86_64-0.9.1.tar.xz && rm zig-linux-x86_64-0.9.1.tar.xz && mv zig-linux-x86_64-0.9.1/* "${prebuilt}"/zig && rm -fr zig-linux-x86_64-0.9.1
+	;;
+    esac
+  fi
+}
+
+function zig {

Review comment:
       I will check! There may have been a problem during the merge. affz




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826132751



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,46 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	curl -Os https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz
+	tar -xf zig-linux-x86_64-0.9.1.tar.xz && rm zig-linux-x86_64-0.9.1.tar.xz && mv zig-linux-x86_64-0.9.1/* "${prebuilt}"/zig && rm -fr zig-linux-x86_64-0.9.1
+	;;
+    esac
+  fi
+}
+
+function zig {

Review comment:
       Follow my previous suggestion will simplify your life:
   https://thoughtbot.com/blog/git-interactive-rebase-squash-amend-rewriting-history




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] kassane commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
kassane commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1071257935


   > @kassane please rework the changes and issue the PR again.
   
   OK. I'm working on it! After solving the problem, the new PR will be requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1068979408


   There are some troubles with `boards/sim/sim/sim/configs/zig/defconfig`. Please regenerate it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#discussion_r826108305



##########
File path: tools/ci/cibuild.sh
##########
@@ -381,6 +381,46 @@ function rust {
   fi
 }
 
+function zig {
+  mkdir -p "${prebuilt}"/zig
+  add_path "${prebuilt}"/zig
+
+  if ! type zig &> /dev/null; then
+    case ${os} in
+      Darwin)
+        brew install zig
+        ;;
+      Linux)
+      # Currently Debian don't install zig (only built)
+        export ZIG_HOME=${prebuilt}/zig
+        cd /tmp
+	curl -Os https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz
+	tar -xf zig-linux-x86_64-0.9.1.tar.xz && rm zig-linux-x86_64-0.9.1.tar.xz && mv zig-linux-x86_64-0.9.1/* "${prebuilt}"/zig && rm -fr zig-linux-x86_64-0.9.1
+	;;
+    esac
+  fi
+}
+
+function zig {

Review comment:
       So why do we need two definitions of the same function `zig`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5732: Zig build on NuttX

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5732:
URL: https://github.com/apache/incubator-nuttx/pull/5732#issuecomment-1069094542


   > There are some troubles with `boards/sim/sim/sim/configs/zig/defconfig`. Please regenerate it.
   
   @kassane you can run "./tools/refresh.sh --silent sim:zig" to normalize defconfig.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org