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

Add running cicd 32bit #3119

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Add running cicd 32bit #3119

merged 1 commit into from
Aug 29, 2024

Conversation

badumbatish
Copy link
Contributor

Macbook can't make use of https://github.com/nektos/act so i'm trying this out on PRs, sorry :)

@badumbatish badumbatish force-pushed the ccpp32.yml branch 10 times, most recently from d9a1a2b to 478f9d7 Compare August 5, 2024 06:37
@badumbatish
Copy link
Contributor Author

dejagnu installed but not found

@P-E-P
Copy link
Member

P-E-P commented Aug 6, 2024

dejagnu installed but not found

Do you have the logs for this ? I've seen this before but I can't remember how I fixed it, seing the logs might help me.

@badumbatish
Copy link
Contributor Author

dejagnu installed but not found

Do you have the logs for this ? I've seen this before but I can't remember how I fixed it, seing the logs might help me.

hi Pierre! yes this happens directly in the build log, in the run test section

make[2]: Entering directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd ../../gcc; ${PWDCMD-pwd}` ; export srcdir ; \
if [ -n "" ] \
   && [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] \
   && [ -f testsuite/rust-parallel/finished ]; then \
  rm -rf testsuite/rust; \
else \
  cd testsuite/rust; \
  rm -f tmp-site.exp; \
  sed '/set tmpdir/ s|testsuite$|testsuite/rust|' \
	< ../../site.exp > tmp-site.exp; \
  /bin/bash ${srcdir}/../move-if-change tmp-site.exp site.exp; \
  EXPECT=expect ; export EXPECT ; \
  if [ -f ${rootme}/../expect/expect ] ; then  \
    TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWDCMD-pwd}` ; \
    export TCL_LIBRARY ; \
  fi ; \
  `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo ${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool rust --target_board=unix\{-m[32](https://github.com/Rust-GCC/gccrs/actions/runs/10243880552/job/28335868981?pr=3119#step:11:33)}; \
  if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
    touch ${rootme}/testsuite/rust-parallel/finished; \
  fi ; \
fi )
/bin/bash: line 18: runtest: command not found
make[2]: Leaving directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'
make[1]: Leaving directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'

The CI will see green probably because we don't check for the return status yet

@P-E-P
Copy link
Member

P-E-P commented Aug 7, 2024

dejagnu installed but not found

Do you have the logs for this ? I've seen this before but I can't remember how I fixed it, seing the logs might help me.

hi Pierre! yes this happens directly in the build log, in the run test section

make[2]: Entering directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd ../../gcc; ${PWDCMD-pwd}` ; export srcdir ; \
if [ -n "" ] \
   && [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] \
   && [ -f testsuite/rust-parallel/finished ]; then \
  rm -rf testsuite/rust; \
else \
  cd testsuite/rust; \
  rm -f tmp-site.exp; \
  sed '/set tmpdir/ s|testsuite$|testsuite/rust|' \
	< ../../site.exp > tmp-site.exp; \
  /bin/bash ${srcdir}/../move-if-change tmp-site.exp site.exp; \
  EXPECT=expect ; export EXPECT ; \
  if [ -f ${rootme}/../expect/expect ] ; then  \
    TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWDCMD-pwd}` ; \
    export TCL_LIBRARY ; \
  fi ; \
  `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo ${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool rust --target_board=unix\{-m[32](https://github.com/Rust-GCC/gccrs/actions/runs/10243880552/job/28335868981?pr=3119#step:11:33)}; \
  if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
    touch ${rootme}/testsuite/rust-parallel/finished; \
  fi ; \
fi )
/bin/bash: line 18: runtest: command not found
make[2]: Leaving directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'
make[1]: Leaving directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'

The CI will see green probably because we don't check for the return status yet

I believe it is because runtest is in the dejagnu package but not symlinked to local bin directory or something along this. We don't want to symlink it ourselve because it'll probably break on next update. Does ubuntu provide any alternative dejagnu package ?

@P-E-P
Copy link
Member

P-E-P commented Aug 7, 2024

You could try installing it from source ?

RUN mkdir -p /tmp/dejagnu && cd /tmp/dejagnu && \
    wget https://ftp.gnu.org/gnu/dejagnu/dejagnu-1.6.2.tar.gz && \
    tar xf dejagnu-1.6.2.tar.gz && cd dejagnu-1.6.2 && \
    ./configure && make && make install && \
    cd /tmp && rm -rf dejagnu

@badumbatish
Copy link
Contributor Author

You could try installing it from source ?

RUN mkdir -p /tmp/dejagnu && cd /tmp/dejagnu && \
    wget https://ftp.gnu.org/gnu/dejagnu/dejagnu-1.6.2.tar.gz && \
    tar xf dejagnu-1.6.2.tar.gz && cd dejagnu-1.6.2 && \
    ./configure && make && make install && \
    cd /tmp && rm -rf dejagnu

sounds good i'll try, alpine gh actions also supply alpine.sh but i'm actually not sure if it makes any difference

runs-on: ubuntu-latest
steps:
  - uses: actions/checkout@v2

  - name: Setup latest Alpine Linux
    uses: jirutka/setup-alpine@v1

  - name: Run script inside Alpine chroot as root
    run: |
      cat /etc/alpine-release
      apk add nodejs npm
    shell: alpine.sh --root {0}

  - name: Run script inside Alpine chroot as the default user (unprivileged)
    run: |
      ls -la  # as you would expect, you're in your workspace directory
      npm build
    shell: alpine.sh {0}

  - name: Run script on the host system (Ubuntu)
    run: |
      cat /etc/os-release
    shell: bash
    ```

@dkm
Copy link
Member

dkm commented Aug 8, 2024

I believe it is because runtest is in the dejagnu package but not symlinked to local bin directory or something along this. We don't want to symlink it ourselve because it'll probably break on next update. Does ubuntu provide any alternative dejagnu package ?

I'm only following this from far away, but IIUC, everything is executed within the alpine chroot, so installing anything on ubuntu host should be useless. Don't you need to install dejagnu in the alpine chroot, using apk add dejagnu ?

@P-E-P
Copy link
Member

P-E-P commented Aug 8, 2024

I believe it is because runtest is in the dejagnu package but not symlinked to local bin directory or something along this. We don't want to symlink it ourselve because it'll probably break on next update. Does ubuntu provide any alternative dejagnu package ?

I'm only following this from far away, but IIUC, everything is executed within the alpine chroot, so installing anything on ubuntu host should be useless. Don't you need to install dejagnu in the alpine chroot, using apk add dejagnu ?

Yes you're right, in fact it's even worse as I have been looking at the commented file.

@badumbatish badumbatish force-pushed the ccpp32.yml branch 7 times, most recently from 9bbdacf to f6a5d28 Compare August 9, 2024 00:08
@badumbatish
Copy link
Contributor Author

I believe it is because runtest is in the dejagnu package but not symlinked to local bin directory or something along this. We don't want to symlink it ourselve because it'll probably break on next update. Does ubuntu provide any alternative dejagnu package ?

I'm only following this from far away, but IIUC, everything is executed within the alpine chroot, so installing anything on ubuntu host should be useless. Don't you need to install dejagnu in the alpine chroot, using apk add dejagnu ?

ah yes i mistook it the first time around :)

@badumbatish
Copy link
Contributor Author

got some linking error around libc, not sure how to handle this

/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: cannot find -lc: file in wrong format
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc

@P-E-P
Copy link
Member

P-E-P commented Aug 9, 2024

got some linking error around libc, not sure how to handle this

/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: cannot find -lc: file in wrong format
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc

where does your /usr/lib/libc.so comes from ?

@badumbatish
Copy link
Contributor Author

tbh i'm not so sure, the build step is run with the alpine shell and before that I added the packages for alpine to be able to run on 32bit:

          gcompat
          libc6-compat
          libc-dev

@badumbatish
Copy link
Contributor Author

Ill use 'file' to inspect it soon, might be that we have to install some layer of glibc for alpine

@dkm
Copy link
Member

dkm commented Aug 12, 2024

How did you configure gcc? That's usually the message you get when you're missing required lib for a particular multilib (x86_64-linux-gcc trying to build for x86-linux without the 32-bits lib: gcc finds the 64-bits and emits the message "skipping incompatible....").

Beware that Alpine is not GNU based. You'll also test against the musl libc (it has some difference compared with glibc). Not sure installing glibc on top on musl will just work®. I would really try to make it work with the regular setup of Alpine instead.

@thesamesam
Copy link
Contributor

thesamesam commented Aug 12, 2024

Introducing musl here feels like asking for trouble -- having musl in CI is worth doing, but I wouldn't mix that up with the general issue of 32-bit testing. You should be able to get a 32-bit toolchain via multilib on Ubuntu using the GH worker. Do you need help with doing that? I can spend a bit of time on it if so.

Note that musl does not do multilib and configure is also finding a tuple with x32 which looks wrong (x32 != 32-bit x86, it's a separate niche ABI).

Broadly, there's two options for any env:

  1. Get a 32-bit toolchain installed and use that to build another GCC;
  2. Cross-compile from whatever toolchain is available to 32-bit.

Option 1 is going to be easier, and it'll be easier still with just using Ubuntu's multilib.

@badumbatish
Copy link
Contributor Author

How did you configure gcc? That's usually the message you get when you're missing required lib for a particular multilib (x86_64-linux-gcc trying to build for x86-linux without the 32-bits lib: gcc finds the 64-bits and emits the message "skipping incompatible....").

Beware that Alpine is not GNU based. You'll also test against the musl libc (it has some difference compared with glibc). Not sure installing glibc on top on musl will just work®. I would really try to make it work with the regular setup of Alpine instead.

i'm configuring gcc like this, disabling multilib since alpine doesn't handle multilib

           mkdir -p gccrs-build;
           cd gccrs-build;
           ../configure \
               --enable-languages=rust \
               --disable-bootstrap \
               --disable-multilib

@badumbatish
Copy link
Contributor Author

Introducing musl here feels like asking for trouble -- having musl in CI is worth doing, but I wouldn't mix that up with the general issue of 32-bit testing. You should be able to get a 32-bit toolchain via multilib on Ubuntu using the GH worker. Do you need help with doing that? I can spend a bit of time on it if so.

Note that musl does not do multilib and configure is also finding a tuple with x32 which looks wrong (x32 != 32-bit x86, it's a separate niche ABI).

Broadly, there's two options for any env:

  1. Get a 32-bit toolchain installed and use that to build another GCC;
  2. Cross-compile from whatever toolchain is available to 32-bit.

Option 1 is going to be easier, and it'll be easier still with just using Ubuntu's multilib.

i think i can just get the 32 bit toolchain via sudo apt install gcc-multilib g++-multilib libc6-dev-i386 but i'm not sure what's the next step is in relation to the building, do i just build them using alpine.sh instead of the normal shell?

@thesamesam
Copy link
Contributor

thesamesam commented Aug 12, 2024

If you are running things inside Alpine, you need to use apk add, but if you're running things inside Ubuntu, you need to use apt install. If you're going to take the Alpine approach (which I don't recommend here), then you only need to apt install any commands needed to get to an Alpine shell, nothing else.

I don't see why you're using Alpine if you already installed the 32-bit toolchain via Ubuntu...

@thesamesam
Copy link
Contributor

thesamesam commented Aug 12, 2024

So, next, it's the same error (https://github.com/Rust-GCC/gccrs/actions/runs/10357507543/job/28669671025?pr=3119#step:8:19755).

Try passing --host=i586-alpine-linux-musl --build=i586-alpine-linux-musl --target=i586-alpine-linux-musl to configure (configure is detecting ...-x32 which is a totally different thing). If that doesn't work, please consider my suggestion of removing Alpine from the equation, unless I'm missing something.

@badumbatish
Copy link
Contributor Author

So, next, it's the same error (https://github.com/Rust-GCC/gccrs/actions/runs/10357507543/job/28669671025?pr=3119#step:8:19755).

Try passing --host=i586-alpine-linux-musl --build=i586-alpine-linux-musl --target=i586-alpine-linux-musl to configure (configure is detecting ...-x32 which is a totally different thing). If that doesn't work, please consider my suggestion of removing Alpine from the equation, unless I'm missing something.

ah ok i see what you're talking about now. I didn't know configure allows the options of --host and --build and --target. Can I also ask you some questions:

  • With your first option, does this mean I just don't need alpine altogether, just get 32 bit toolchain from ubuntu and build it normal?

@badumbatish
Copy link
Contributor Author

@thesamesam :) hi Sam your tip with building with --host, --build and --target works

@badumbatish
Copy link
Contributor Author

badumbatish commented Aug 12, 2024

codebase related new warnings?! not sure if i should fix these warnings or let it break ci and fix it in another patch?

+../../gcc/rust/resolve/rust-ast-resolve.cc:66:15: warning: possibly dangling reference to a temporary [-Wdangling-reference]
+/usr/include/c++/13.2.1/bits/new_allocator.h:172:33: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_start' may be used uninitialized [-Wmaybe-uninitialized]
+/usr/include/c++/13.2.1/bits/stl_vector.h:367:49: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&resolved + offsetof(tl::optional<Rust::Resolver2_0::Rib::Definition>,tl::optional<Rust::Resolver2_0::Rib::Definition>::<unnamed>.tl::detail::optional_move_assign_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_move_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_copy_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_operations_base<Rust::Resolver2_0::Rib::Definition>::<unnamed>.tl::detail::optional_storage_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_end_of_storage' may be used uninitialized [-Wmaybe-uninitialized]
+/usr/include/c++/13.2.1/bits/stl_vector.h:367:49: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_end_of_storage' may be used uninitialized [-Wmaybe-uninitialized]
+/usr/include/c++/13.2.1/bits/stl_vector.h:367:49: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_end_of_storage' may be used uninitialized [-Wmaybe-uninitialized]
+/usr/include/c++/13.2.1/bits/stl_vector.h:367:49: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_end_of_storage' may be used uninitialized [-Wmaybe-uninitialized]
+/usr/include/c++/13.2.1/bits/stl_vector.h:367:49: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_start' may be used uninitialized [-Wmaybe-uninitialized]
+/usr/include/c++/13.2.1/bits/stl_vector.h:367:49: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_start' may be used uninitialized [-Wmaybe-uninitialized]
+/usr/include/c++/13.2.1/bits/stl_vector.h:386:9: warning: '*(const std::vector<unsigned int, std::allocator<unsigned int> >*)((char*)&resolved + offsetof(tl::optional<Rust::Resolver2_0::Rib::Definition>,tl::optional<Rust::Resolver2_0::Rib::Definition>::<unnamed>.tl::detail::optional_move_assign_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_move_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_copy_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>.tl::detail::optional_operations_base<Rust::Resolver2_0::Rib::Definition>::<unnamed>.tl::detail::optional_storage_base<Rust::Resolver2_0::Rib::Definition, false>::<unnamed>)).std::vector<unsigned int>::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_start' may be used uninitialized [-Wmaybe-uninitialized]

@thesamesam
Copy link
Contributor

Really glad it worked @badumbatish! And yes btw, I think your understanding in #3119 (comment) was right for that question, but no need for it now.

@thesamesam
Copy link
Contributor

re #3119 (comment): I am not sure how the CI setup here works, but they should be okay to ignore (somehow, I don't know how to mark it as such).

Those are noisy middle-end warnings and those shouldn't be coming from the Rust frontend.

@badumbatish
Copy link
Contributor Author

re #3119 (comment): I am not sure how the CI setup here works, but they should be okay to ignore (somehow, I don't know how to mark it as such).

Those are noisy middle-end warnings and those shouldn't be coming from the Rust frontend.

the warnings before i think is logged by me building the CI on ubuntu. It is logged into a file called alpine32bit_warnings and this is compared to newly triggered builds. The warnings log on ubuntu https://github.com/Rust-GCC/gccrs/blob/master/.github/bors_log_expected_warnings doesn't have any gccrs-related warnings so i'm not sure if i should also allow these warnings to go through or not

@thesamesam
Copy link
Contributor

Thanks for explaining! IMO, they can be safely ignored, but let's see what @dkm and others say about what to do next.

@dkm
Copy link
Member

dkm commented Aug 14, 2024

Thanks @thesamesam for giving us a hand here 👍

@badumbatish, you would need to check that nothing comes from the Rust frontend in your error log and save this file as the baseline + add corresponding comparison after each build (i.e. do the same as we have with the bors_log_expected_warnings) as I doubt you can directly reuse the existing baseline used on amd64.
Looks very close, thanks @badumbatish !

@badumbatish badumbatish force-pushed the ccpp32.yml branch 6 times, most recently from fff732a to 9ec14e5 Compare August 16, 2024 09:36
ChangeLog:

	* .github/alpine_32bit_log_warnings: New file.
	* .github/workflows/ccpp32alpine.yml: New file.

gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve.cc (NameResolution::go):
	Fix warnings from const auto& to const auto
../../gcc/text-art/style.cc:160:25: warning: spurious leading punctuation sequence ';' in format [-Wformat-diag]
../../gcc/text-art/table.cc:981:62: warning: unquoted keyword 'char' in format [-Wformat-diag]
../../gcc/text-art/table.cc:981:69: warning: spurious trailing punctuation sequence '])' in format [-Wformat-diag]
/usr/include/c++/13.2.1/bits/new_allocator.h:172:33: warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_start' may be used uninitialized [-Wmaybe-uninitialized]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a couple of warnings like this one which seem to spruce from our code even though the warning seems to come form a std header. we should either fix them now or open up an issue and take care of them later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i'd opt to open up an issue for it to be fixed later. although i thought our code is only from gcc/rust and gcc/testsuite, is text-art/ also involved?

Copy link
Contributor

@thesamesam thesamesam Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badumbatish Note that the list here is, I think, from grep warning:, which means it misses the context lines GCC shows. It might be that e.g. there's a template in text-art which gcc/rust instantiates (just guessing but trying to say how it might be misleading).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll dig up the build log but it's just complaining about formatting issues, quite weird. In one instance it's giving a warning about a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text-art/style.cc:160

2024-08-16T10:34:27.2120743Z make[2]: Entering directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'
2024-08-16T10:34:27.2129865Z i586-alpine-linux-musl-g++  -fno-PIE -c   -g -O2     -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -fno-common  -DHAVE_CONFIG_H -fno-PIE -I. -Itext-art -I../../gcc -I../../gcc/text-art -I../../gcc/../include -I ./../gettext/intl -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/home/runner/work/gccrs/gccrs/gccrs-build/./gmp -I/home/runner/work/gccrs/gccrs/gmp -I/home/runner/work/gccrs/gccrs/gccrs-build/./mpfr/src -I/home/runner/work/gccrs/gccrs/mpfr/src -I/home/runner/work/gccrs/gccrs/mpc/src  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -I/home/runner/work/gccrs/gccrs/gccrs-build/./isl/include -I/home/runner/work/gccrs/gccrs/isl/include  -o text-art/style.o -MT text-art/style.o -MMD -MP -MF text-art/.deps/style.TPo ../../gcc/text-art/style.cc
2024-08-16T10:34:27.2138466Z ../../gcc/text-art/style.cc: In member function 'void text_art::style::color::print_sgr(pretty_printer*, bool, bool&) const':
2024-08-16T10:34:27.2140554Z ../../gcc/text-art/style.cc:150:25: warning: spurious leading punctuation sequence ';' in format [-Wformat-diag]
2024-08-16T10:34:27.2145045Z   150 |         pp_printf (pp, ";5;%i", (int)u.m_8bit);
2024-08-16T10:34:27.2146093Z       |                         ^
2024-08-16T10:34:27.2147619Z ../../gcc/text-art/style.cc:160:25: warning: spurious leading punctuation sequence ';' in format [-Wformat-diag]
2024-08-16T10:34:27.2149088Z   160 |         pp_printf (pp, ";2;%i;%i;%i",
2024-08-16T10:34:27.2149894Z       |                         ^
2024-08-16T10:34:27.2151028Z make[2]: Leaving directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'

text-art/table.cc:981

2024-08-16T10:34:31.2073593Z make[2]: Entering directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'
2024-08-16T10:34:31.2083000Z i586-alpine-linux-musl-g++  -fno-PIE -c   -g -O2     -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -fno-common  -DHAVE_CONFIG_H -fno-PIE -I. -Itext-art -I../../gcc -I../../gcc/text-art -I../../gcc/../include -I ./../gettext/intl -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/home/runner/work/gccrs/gccrs/gccrs-build/./gmp -I/home/runner/work/gccrs/gccrs/gmp -I/home/runner/work/gccrs/gccrs/gccrs-build/./mpfr/src -I/home/runner/work/gccrs/gccrs/mpfr/src -I/home/runner/work/gccrs/gccrs/mpc/src  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -I/home/runner/work/gccrs/gccrs/gccrs-build/./isl/include -I/home/runner/work/gccrs/gccrs/isl/include  -o text-art/table.o -MT text-art/table.o -MMD -MP -MF text-art/.deps/table.TPo ../../gcc/text-art/table.cc
2024-08-16T10:34:31.2091207Z ../../gcc/text-art/table.cc: In function 'void selftest::test_spans_3()':
2024-08-16T10:34:31.2092701Z ../../gcc/text-art/table.cc:981:62: warning: unquoted keyword 'char' in format [-Wformat-diag]
2024-08-16T10:34:31.2094222Z   981 |                                                      "'buf' (char[%i])",
2024-08-16T10:34:31.2094941Z       |                                                              ^~~~
2024-08-16T10:34:31.2096219Z ../../gcc/text-art/table.cc:981:69: warning: spurious trailing punctuation sequence '])' in format [-Wformat-diag]
2024-08-16T10:34:31.2097501Z   981 |                                                      "'buf' (char[%i])",
2024-08-16T10:34:31.2098198Z       |                                                                     ^~
2024-08-16T10:34:31.2099178Z make[2]: Leaving directory '/home/runner/work/gccrs/gccrs/gccrs-build/gcc'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badumbatish I was talking about this line specifically:

warning: '*(std::_Vector_base<unsigned int, std::allocator<unsigned int> >*)((char*)&saved + offsetof(Rust::BIR::PatternBindingBuilder::SavedState, Rust::BIR::PatternBindingBuilder::SavedState::regions.tl::optional<Rust::FreeRegions>::<unnamed>.tl::detail::optional_move_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_assign_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_move_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_copy_base<Rust::FreeRegions, false>::<unnamed>.tl::detail::optional_operations_base<Rust::FreeRegions>::<unnamed>.tl::detail::optional_storage_base<Rust::FreeRegions, false>::<unnamed>)).std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_impl.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl_data::_M_start' may be used uninitialized [-Wmaybe-uninitialized]

that's a gccrs type, that we are using wrong I guess? I agree with you that it can be fixed separately though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's ok with you i'll resolve the issue Arthur :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but i'm not sure if i should remove the warnings from the expected file or is the current state ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you manage to fix the warning you should delete the warning from the expected file, we want to keep warning count as low as possible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, as @P-E-P said. so keep that PR in its current state but when you fix the warning make sure to remove it from the file 👍 good work!

@CohenArthur CohenArthur added this pull request to the merge queue Aug 29, 2024
Merged via the queue into Rust-GCC:master with commit 369b515 Aug 29, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants