public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement
@ 2022-04-03  9:56 Ammar Faizi
  2022-04-03  9:56 ` [PATCH liburing v1 1/2] src/int_flags.h: Add missing SPDX-License-Identifier Ammar Faizi
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ammar Faizi @ 2022-04-03  9:56 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Ammar Faizi, io-uring Mailing List, GNU/Weeb Mailing List

Hi Jens,

Two patches in this series. The first patch is SPDX-License-Identifier
fix. The second patch is a small improvement for .gitignore w.r.t. test.

When adding a new test, we often forget to add the new test binary to
`.gitignore`. Append `.test` to the test binary filename, this way we
can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
test binary files.

Goals:
  - Make the .gitignore simpler.
  - Avoid the burden of adding a new test to .gitignore.

Signed-off-by: Ammar Faizi <[email protected]>
---
Ammar Faizi (2):
  src/int_flags.h: Add missing SPDX-License-Identifier
  test/Makefile: Append `.test` to the test binary filename

 .gitignore      | 132 +-----------------------------------------------
 src/int_flags.h |   1 +
 test/Makefile   |   8 +--
 3 files changed, 7 insertions(+), 134 deletions(-)


base-commit: 314dd7ba2aa9d0ba5bb9a6ab28b7204dd319e386
-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH liburing v1 1/2] src/int_flags.h: Add missing SPDX-License-Identifier
  2022-04-03  9:56 [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement Ammar Faizi
@ 2022-04-03  9:56 ` Ammar Faizi
  2022-04-03  9:56 ` [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename Ammar Faizi
  2022-04-03 14:52 ` (subset) [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement Jens Axboe
  2 siblings, 0 replies; 9+ messages in thread
From: Ammar Faizi @ 2022-04-03  9:56 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Ammar Faizi, io-uring Mailing List, GNU/Weeb Mailing List

Signed-off-by: Ammar Faizi <[email protected]>
---
 src/int_flags.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/int_flags.h b/src/int_flags.h
index b9270ae..90505ec 100644
--- a/src/int_flags.h
+++ b/src/int_flags.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: MIT */
 #ifndef LIBURING_INT_FLAGS
 #define LIBURING_INT_FLAGS
 
-- 
Ammar Faizi


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename
  2022-04-03  9:56 [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement Ammar Faizi
  2022-04-03  9:56 ` [PATCH liburing v1 1/2] src/int_flags.h: Add missing SPDX-License-Identifier Ammar Faizi
@ 2022-04-03  9:56 ` Ammar Faizi
  2022-04-03 14:51   ` Jens Axboe
  2022-04-03 14:52 ` (subset) [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement Jens Axboe
  2 siblings, 1 reply; 9+ messages in thread
From: Ammar Faizi @ 2022-04-03  9:56 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Ammar Faizi, io-uring Mailing List, GNU/Weeb Mailing List

When adding a new test, we often forget to add the new test binary to
`.gitignore`. Append `.test` to the test binary filename, this way we
can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
test binary files.

Goals:
  - Make the .gitignore simpler.
  - Avoid the burden of adding a new test to .gitignore.

Signed-off-by: Ammar Faizi <[email protected]>
---
 .gitignore    | 132 +-------------------------------------------------
 test/Makefile |   8 +--
 2 files changed, 6 insertions(+), 134 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4a6e585..0b0add0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,137 +15,7 @@
 /examples/io_uring-test
 /examples/link-cp
 /examples/ucontext-cp
-
-/test/232c93d07b74-test
-/test/35fa71a030ca-test
-/test/500f9fbadef8-test
-/test/7ad0e4b2f83c-test
-/test/8a9973408177-test
-/test/917257daa0fe-test
-/test/a0908ae19763-test
-/test/a4c0b3decb33-test
-/test/accept
-/test/accept-link
-/test/accept-reuse
-/test/accept-test
-/test/across-fork
-/test/b19062a56726-test
-/test/b5837bd5311d-test
-/test/ce593a6c480a-test
-/test/close-opath
-/test/config.local
-/test/connect
-/test/cq-full
-/test/cq-overflow
-/test/cq-overflow-peek
-/test/cq-peek-batch
-/test/cq-ready
-/test/cq-size
-/test/d4ae271dfaae-test
-/test/d77a67ed5f27-test
-/test/defer
-/test/double-poll-crash
-/test/drop-submit
-/test/eeed8b54e0df-test
-/test/empty-eownerdead
-/test/eventfd
-/test/eventfd-disable
-/test/eventfd-reg
-/test/eventfd-ring
-/test/exit-no-cleanup
-/test/fadvise
-/test/fallocate
-/test/fc2a85cb02ef-test
-/test/file-register
-/test/file-update
-/test/file-verify
-/test/files-exit-hang-poll
-/test/files-exit-hang-timeout
-/test/fixed-buf-iter
-/test/fixed-link
-/test/fixed-reuse
-/test/fpos
-/test/fsync
-/test/hardlink
-/test/io-cancel
-/test/io_uring_enter
-/test/io_uring_register
-/test/io_uring_setup
-/test/iopoll
-/test/lfs-openat
-/test/lfs-openat-write
-/test/link
-/test/link-timeout
-/test/link_drain
-/test/madvise
-/test/mkdir
-/test/msg-ring
-/test/nop
-/test/nop-all-sizes
-/test/open-close
-/test/open-direct-link
-/test/openat2
-/test/personality
-/test/pipe-eof
-/test/pipe-reuse
-/test/poll
-/test/poll-cancel
-/test/poll-cancel-ton
-/test/poll-link
-/test/poll-many
-/test/poll-ring
-/test/poll-v-poll
-/test/pollfree
-/test/probe
-/test/read-write
-/test/recv-msgall
-/test/recv-msgall-stream
-/test/register-restrictions
-/test/rename
-/test/ring-leak
-/test/ring-leak2
-/test/self
-/test/send_recv
-/test/send_recvmsg
-/test/sendmsg_fs_cve
-/test/shared-wq
-/test/short-read
-/test/shutdown
-/test/sigfd-deadlock
-/test/socket-rw
-/test/socket-rw-eagain
-/test/socket-rw-offset
-/test/splice
-/test/sq-full
-/test/sq-full-cpp
-/test/sq-poll-dup
-/test/sq-poll-kthread
-/test/sq-poll-share
-/test/sqpoll-disable-exit
-/test/sqpoll-exit-hang
-/test/sqpoll-sleep
-/test/sq-space_left
-/test/statx
-/test/stdout
-/test/submit-reuse
-/test/symlink
-/test/teardowns
-/test/thread-exit
-/test/timeout
-/test/timeout-new
-/test/timeout-overflow
-/test/tty-write-dpoll
-/test/unlink
-/test/wakeup-hang
-/test/multicqes_drain
-/test/poll-mshot-update
-/test/rsrc_tags
-/test/rw_merge_test
-/test/sqpoll-cancel-hang
-/test/testfile
-/test/submit-link-fail
-/test/exec-target
-/test/skip-cqe
+/test/*.test
 /test/*.dmesg
 /test/output/
 
diff --git a/test/Makefile b/test/Makefile
index 1526776..80b0f37 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -183,7 +183,9 @@ endif
 all_targets += sq-full-cpp
 
 
-test_targets := $(patsubst %.c,%,$(patsubst %.cc,%,$(test_srcs)))
+test_targets := $(patsubst %.c,%,$(test_srcs))
+test_targets := $(patsubst %.cc,%,$(test_targets))
+test_targets := $(patsubst %,%.test,$(test_targets))
 all_targets += $(test_targets)
 
 #
@@ -204,10 +206,10 @@ all: $(test_targets)
 helpers.o: helpers.c
 	$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
 
-%: %.c $(helpers) helpers.h ../src/liburing.a
+%.test: %.c $(helpers) helpers.h ../src/liburing.a
 	$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(helpers) $(LDFLAGS)
 
-%: %.cc $(helpers) helpers.h ../src/liburing.a
+%.test: %.cc $(helpers) helpers.h ../src/liburing.a
 	$(QUIET_CXX)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(helpers) $(LDFLAGS)
 
 
-- 
Ammar Faizi


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename
  2022-04-03  9:56 ` [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename Ammar Faizi
@ 2022-04-03 14:51   ` Jens Axboe
  2022-04-03 14:55     ` Ammar Faizi
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2022-04-03 14:51 UTC (permalink / raw)
  To: Ammar Faizi; +Cc: io-uring Mailing List, GNU/Weeb Mailing List

On 4/3/22 3:56 AM, Ammar Faizi wrote:
> When adding a new test, we often forget to add the new test binary to
> `.gitignore`. Append `.test` to the test binary filename, this way we
> can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
> test binary files.

Did you build it?

     CC 917257daa0fe-test.test
/usr/bin/ld: /tmp/ccGrhiuN.o: in function `thread_start':
/home/axboe/git/liburing/test/35fa71a030ca-test.c:52: undefined reference to `pthread_attr_setstacksize'
/usr/bin/ld: /home/axboe/git/liburing/test/35fa71a030ca-test.c:55: undefined reference to `pthread_create'
     CC a0908ae19763-test.test
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:210: 35fa71a030ca-test.test] Error 1
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: /tmp/cc2nozDW.o: in function `main':
/home/axboe/git/liburing/test/232c93d07b74-test.c:295: undefined reference to `pthread_create'
/usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:296: undefined reference to `pthread_create'
/usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:297: undefined reference to `pthread_join'
/usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:298: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:210: 232c93d07b74-test.test] Error 1
make[1]: Leaving directory '/home/axboe/git/liburing/test'

I do like the idea of not having to keep fixing that gitignore list.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (subset) [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement
  2022-04-03  9:56 [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement Ammar Faizi
  2022-04-03  9:56 ` [PATCH liburing v1 1/2] src/int_flags.h: Add missing SPDX-License-Identifier Ammar Faizi
  2022-04-03  9:56 ` [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename Ammar Faizi
@ 2022-04-03 14:52 ` Jens Axboe
  2 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2022-04-03 14:52 UTC (permalink / raw)
  To: Ammar Faizi; +Cc: io-uring Mailing List, GNU/Weeb Mailing List

On Sun, 3 Apr 2022 16:56:00 +0700, Ammar Faizi wrote:
> Two patches in this series. The first patch is SPDX-License-Identifier
> fix. The second patch is a small improvement for .gitignore w.r.t. test.
> 
> When adding a new test, we often forget to add the new test binary to
> `.gitignore`. Append `.test` to the test binary filename, this way we
> can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
> test binary files.
> 
> [...]

Applied, thanks!

[1/2] src/int_flags.h: Add missing SPDX-License-Identifier
      commit: c0a2850e7192edbf3679265db20e2fb2a828e830

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename
  2022-04-03 14:51   ` Jens Axboe
@ 2022-04-03 14:55     ` Ammar Faizi
  2022-04-03 15:00       ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Ammar Faizi @ 2022-04-03 14:55 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring Mailing List, GNU/Weeb Mailing List

On 4/3/22 9:51 PM, Jens Axboe wrote:
> On 4/3/22 3:56 AM, Ammar Faizi wrote:
>> When adding a new test, we often forget to add the new test binary to
>> `.gitignore`. Append `.test` to the test binary filename, this way we
>> can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
>> test binary files.
> 
> Did you build it?
> 
>       CC 917257daa0fe-test.test
> /usr/bin/ld: /tmp/ccGrhiuN.o: in function `thread_start':
> /home/axboe/git/liburing/test/35fa71a030ca-test.c:52: undefined reference to `pthread_attr_setstacksize'
> /usr/bin/ld: /home/axboe/git/liburing/test/35fa71a030ca-test.c:55: undefined reference to `pthread_create'
>       CC a0908ae19763-test.test
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:210: 35fa71a030ca-test.test] Error 1
> make[1]: *** Waiting for unfinished jobs....
> /usr/bin/ld: /tmp/cc2nozDW.o: in function `main':
> /home/axboe/git/liburing/test/232c93d07b74-test.c:295: undefined reference to `pthread_create'
> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:296: undefined reference to `pthread_create'
> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:297: undefined reference to `pthread_join'
> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:298: undefined reference to `pthread_join'
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:210: 232c93d07b74-test.test] Error 1
> make[1]: Leaving directory '/home/axboe/git/liburing/test'
> 
> I do like the idea of not having to keep fixing that gitignore list.

Hmm.. weird... It builds just fine from my end.
Can you show the full commands?

This is mine:
-----------------------------------------
ammarfaizi2@integral2:~/app/liburing$ make clean
make[1]: Entering directory '/home/ammarfaizi2/app/liburing/src'
make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/src'
make[1]: Entering directory '/home/ammarfaizi2/app/liburing/test'
make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/test'
make[1]: Entering directory '/home/ammarfaizi2/app/liburing/examples'
make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/examples'
ammarfaizi2@integral2:~/app/liburing$ git log -n 2
commit 9c6343ae79a63dbddc9baf404fe6a9e07ac6fb3b (HEAD -> for-jens5)
Author: Ammar Faizi <[email protected]>
Date:   Sun Apr 3 16:35:30 2022 +0700

     test/Makefile: Append `.test` to the test binary filename
     
     When adding a new test, we often forget to add the new test binary to
     `.gitignore`. Append `.test` to the test binary filename, this way we
     can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
     test binary files.
     
     Goals:
       - Make the .gitignore simpler.
       - Avoid the burden of adding a new test to .gitignore.
     
     Signed-off-by: Ammar Faizi <[email protected]>

commit 2f72d1261e30c514ed9426c7c7a6187d15e4f75d
Author: Ammar Faizi <[email protected]>
Date:   Sun Apr 3 16:44:26 2022 +0700

     src/int_flags.h: Add missing SPDX-License-Identifier
     
     Signed-off-by: Ammar Faizi <[email protected]>
ammarfaizi2@integral2:~/app/liburing$ taskset -c 0-7 make -j8
Running configure ...
prefix                        /usr
includedir                    /usr/include
libdir                        /usr/lib
libdevdir                     /usr/lib
relativelibdir
mandir                        /usr/man
datadir                       /usr/share
stringop_overflow             yes
array_bounds                  yes
__kernel_rwf_t                yes
__kernel_timespec             yes
open_how                      yes
statx                         yes
glibc_statx                   yes
C++                           yes
has_ucontext                  yes
has_memfd_create              yes
liburing_nolibc               no
CC                            gcc
CXX                           g++
make[1]: Entering directory '/home/ammarfaizi2/app/liburing/src'
      CC setup.ol
      CC queue.ol
      CC register.ol
      CC syscall.ol
      CC setup.os
      CC queue.os
      CC register.os
      CC syscall.os
      AR liburing.a
ar: creating liburing.a
      CC liburing.so.2.2
  RANLIB liburing.a
make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/src'
make[1]: Entering directory '/home/ammarfaizi2/app/liburing/test'
      CC helpers.o
      CC ../src/syscall.o
      CC 35fa71a030ca-test.test
      CC 232c93d07b74-test.test
      CC 500f9fbadef8-test.test
      CC 7ad0e4b2f83c-test.test
      CC 8a9973408177-test.test
      CC 917257daa0fe-test.test
      CC a0908ae19763-test.test
      CC a4c0b3decb33-test.test
      CC accept.test
      CC accept-link.test
      CC accept-reuse.test
      CC accept-test.test
      CC across-fork.test
      CC b19062a56726-test.test
      CC b5837bd5311d-test.test
      CC ce593a6c480a-test.test
      CC close-opath.test
      CC connect.test
      CC cq-full.test
      CC cq-overflow.test
      CC cq-peek-batch.test
      CC cq-ready.test
      CC cq-size.test
      CC d4ae271dfaae-test.test
      CC d77a67ed5f27-test.test
      CC defer.test
      CC double-poll-crash.test
      CC drop-submit.test
      CC eeed8b54e0df-test.test
      CC empty-eownerdead.test
      CC eventfd.test
      CC eventfd-disable.test
      CC eventfd-reg.test
      CC eventfd-ring.test
      CC exec-target.test
      CC exit-no-cleanup.test
      CC fadvise.test
      CC fallocate.test
      CC fc2a85cb02ef-test.test
      CC file-register.test
      CC files-exit-hang-poll.test
      CC files-exit-hang-timeout.test
      CC file-update.test
      CC file-verify.test
      CC fixed-buf-iter.test
      CC fixed-link.test
      CC fixed-reuse.test
      CC fpos.test
      CC fsync.test
      CC hardlink.test
      CC io-cancel.test
      CC iopoll.test
      CC io_uring_enter.test
      CC io_uring_register.test
      CC io_uring_setup.test
      CC lfs-openat.test
      CC lfs-openat-write.test
      CC link.test
      CC link_drain.test
      CC link-timeout.test
      CC madvise.test
      CC mkdir.test
      CC msg-ring.test
      CC multicqes_drain.test
      CC nop-all-sizes.test
      CC nop.test
      CC openat2.test
      CC open-close.test
      CC open-direct-link.test
      CC personality.test
      CC pipe-eof.test
      CC pipe-reuse.test
      CC poll.test
      CC poll-cancel.test
      CC poll-cancel-ton.test
      CC poll-link.test
      CC poll-many.test
      CC poll-mshot-update.test
      CC poll-ring.test
      CC poll-v-poll.test
      CC pollfree.test
      CC probe.test
      CC read-write.test
      CC recv-msgall.test
      CC recv-msgall-stream.test
      CC register-restrictions.test
      CC rename.test
      CC ring-leak2.test
      CC ring-leak.test
      CC rsrc_tags.test
      CC rw_merge_test.test
      CC self.test
      CC sendmsg_fs_cve.test
      CC send_recv.test
      CC send_recvmsg.test
      CC shared-wq.test
      CC short-read.test
      CC shutdown.test
      CC sigfd-deadlock.test
      CC socket-rw.test
      CC socket-rw-eagain.test
      CC socket-rw-offset.test
      CC splice.test
      CC sq-full.test
      CXX sq-full-cpp.test
      CC sqpoll-cancel-hang.test
      CC sqpoll-disable-exit.test
      CC sq-poll-dup.test
      CC sqpoll-exit-hang.test
      CC sq-poll-kthread.test
      CC sq-poll-share.test
      CC sqpoll-sleep.test
      CC sq-space_left.test
      CC stdout.test
      CC submit-link-fail.test
      CC submit-reuse.test
      CC symlink.test
      CC teardowns.test
      CC thread-exit.test
      CC timeout.test
      CC timeout-new.test
      CC timeout-overflow.test
      CC tty-write-dpoll.test
      CC unlink.test
      CC wakeup-hang.test
      CC skip-cqe.test
      CC statx.test
make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/test'
make[1]: Entering directory '/home/ammarfaizi2/app/liburing/examples'
      CC io_uring-cp
      CC io_uring-test
      CC ucontext-cp
      CC link-cp
make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/examples'
ammarfaizi2@integral2:~/app/liburing$

-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename
  2022-04-03 14:55     ` Ammar Faizi
@ 2022-04-03 15:00       ` Jens Axboe
  2022-04-03 15:05         ` Ammar Faizi
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2022-04-03 15:00 UTC (permalink / raw)
  To: Ammar Faizi; +Cc: io-uring Mailing List, GNU/Weeb Mailing List

On 4/3/22 8:55 AM, Ammar Faizi wrote:
> On 4/3/22 9:51 PM, Jens Axboe wrote:
>> On 4/3/22 3:56 AM, Ammar Faizi wrote:
>>> When adding a new test, we often forget to add the new test binary to
>>> `.gitignore`. Append `.test` to the test binary filename, this way we
>>> can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
>>> test binary files.
>>
>> Did you build it?
>>
>>       CC 917257daa0fe-test.test
>> /usr/bin/ld: /tmp/ccGrhiuN.o: in function `thread_start':
>> /home/axboe/git/liburing/test/35fa71a030ca-test.c:52: undefined reference to `pthread_attr_setstacksize'
>> /usr/bin/ld: /home/axboe/git/liburing/test/35fa71a030ca-test.c:55: undefined reference to `pthread_create'
>>       CC a0908ae19763-test.test
>> collect2: error: ld returned 1 exit status
>> make[1]: *** [Makefile:210: 35fa71a030ca-test.test] Error 1
>> make[1]: *** Waiting for unfinished jobs....
>> /usr/bin/ld: /tmp/cc2nozDW.o: in function `main':
>> /home/axboe/git/liburing/test/232c93d07b74-test.c:295: undefined reference to `pthread_create'
>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:296: undefined reference to `pthread_create'
>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:297: undefined reference to `pthread_join'
>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:298: undefined reference to `pthread_join'
>> collect2: error: ld returned 1 exit status
>> make[1]: *** [Makefile:210: 232c93d07b74-test.test] Error 1
>> make[1]: Leaving directory '/home/axboe/git/liburing/test'
>>
>> I do like the idea of not having to keep fixing that gitignore list.
> 
> Hmm.. weird... It builds just fine from my end.
> Can you show the full commands?

Sure, here it is:

axboe@m1 ~/gi/liburing (master)> make V=1                                    0.011s
Running configure ...
prefix                        /usr
includedir                    /usr/include
libdir                        /usr/lib
libdevdir                     /usr/lib
relativelibdir                
mandir                        /usr/man
datadir                       /usr/share
stringop_overflow             yes
array_bounds                  yes
__kernel_rwf_t                yes
__kernel_timespec             yes
open_how                      yes
statx                         yes
glibc_statx                   yes
C++                           yes
has_ucontext                  yes
has_memfd_create              yes
liburing_nolibc               no
CC                            gcc
CXX                           g++
make[1]: Entering directory '/home/axboe/git/liburing/src'
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "setup.ol" -MMD -MP -MF "setup.ol.d" -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o setup.ol setup.c
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "queue.ol" -MMD -MP -MF "queue.ol.d" -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o queue.ol queue.c
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "register.ol" -MMD -MP -MF "register.ol.d" -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o register.ol register.c
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "syscall.ol" -MMD -MP -MF "syscall.ol.d" -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o syscall.ol syscall.c
ar r liburing.a setup.ol queue.ol register.ol syscall.ol
ar: creating liburing.a
ranlib liburing.a
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "setup.os" -MMD -MP -MF "setup.os.d" -fPIC -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o setup.os setup.c
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "queue.os" -MMD -MP -MF "queue.os.d" -fPIC -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o queue.os queue.c
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "register.os" -MMD -MP -MF "register.os.d" -fPIC -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o register.os register.c
gcc -D_GNU_SOURCE -Iinclude/ -include ../config-host.h -MT "syscall.os" -MMD -MP -MF "syscall.os.d" -fPIC -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -c -o syscall.os syscall.c
gcc -fPIC -g -O2 -Wall -Wextra -fno-stack-protector -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL -shared -Wl,--version-script=liburing.map -Wl,-soname=liburing.so.2 -o liburing.so.2.2 setup.os queue.os register.os syscall.os 
make[1]: Leaving directory '/home/axboe/git/liburing/src'
make[1]: Entering directory '/home/axboe/git/liburing/test'
gcc -D_GNU_SOURCE -D__SANE_USERSPACE_TYPES__ -I../src/include/ -include ../config-host.h -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wstringop-overflow=0 -Warray-bounds=0 -DLIBURING_BUILD_TEST -o helpers.o -c helpers.c
gcc -D_GNU_SOURCE -D__SANE_USERSPACE_TYPES__ -I../src/include/ -include ../config-host.h -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wstringop-overflow=0 -Warray-bounds=0 -DLIBURING_BUILD_TEST -o ../src/syscall.o -c ../src/syscall.c
gcc -D_GNU_SOURCE -D__SANE_USERSPACE_TYPES__ -I../src/include/ -include ../config-host.h -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wstringop-overflow=0 -Warray-bounds=0 -DLIBURING_BUILD_TEST -o 232c93d07b74-test.test 232c93d07b74-test.c helpers.o ../src/syscall.o -L../src/ -luring
/usr/bin/ld: /tmp/cchfKQEY.o: in function `main':
/home/axboe/git/liburing/test/232c93d07b74-test.c:295: undefined reference to `pthread_create'
/usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:296: undefined reference to `pthread_create'
/usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:297: undefined reference to `pthread_join'
/usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:298: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:210: 232c93d07b74-test.test] Error 1
make[1]: Leaving directory '/home/axboe/git/liburing/test'
make: *** [Makefile:11: all] Error 2

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename
  2022-04-03 15:00       ` Jens Axboe
@ 2022-04-03 15:05         ` Ammar Faizi
  2022-04-03 15:06           ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Ammar Faizi @ 2022-04-03 15:05 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring Mailing List, GNU/Weeb Mailing List

On 4/3/22 10:00 PM, Jens Axboe wrote:
> On 4/3/22 8:55 AM, Ammar Faizi wrote:
>> On 4/3/22 9:51 PM, Jens Axboe wrote:
>>> On 4/3/22 3:56 AM, Ammar Faizi wrote:
>>>> When adding a new test, we often forget to add the new test binary to
>>>> `.gitignore`. Append `.test` to the test binary filename, this way we
>>>> can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
>>>> test binary files.
>>>
>>> Did you build it?
>>>
>>>        CC 917257daa0fe-test.test
>>> /usr/bin/ld: /tmp/ccGrhiuN.o: in function `thread_start':
>>> /home/axboe/git/liburing/test/35fa71a030ca-test.c:52: undefined reference to `pthread_attr_setstacksize'
>>> /usr/bin/ld: /home/axboe/git/liburing/test/35fa71a030ca-test.c:55: undefined reference to `pthread_create'
>>>        CC a0908ae19763-test.test
>>> collect2: error: ld returned 1 exit status
>>> make[1]: *** [Makefile:210: 35fa71a030ca-test.test] Error 1
>>> make[1]: *** Waiting for unfinished jobs....
>>> /usr/bin/ld: /tmp/cc2nozDW.o: in function `main':
>>> /home/axboe/git/liburing/test/232c93d07b74-test.c:295: undefined reference to `pthread_create'
>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:296: undefined reference to `pthread_create'
>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:297: undefined reference to `pthread_join'
>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:298: undefined reference to `pthread_join'
>>> collect2: error: ld returned 1 exit status
>>> make[1]: *** [Makefile:210: 232c93d07b74-test.test] Error 1
>>> make[1]: Leaving directory '/home/axboe/git/liburing/test'
>>>
>>> I do like the idea of not having to keep fixing that gitignore list.
>>
>> Hmm.. weird... It builds just fine from my end.
>> Can you show the full commands?
> 
> Sure, here it is:
> 
> axboe@m1 ~/gi/liburing (master)> make V=1                                    0.011s

OK, it now makes sense to me.

These pthread stuff are appended for the test binary files without "*.test" suffix.

35fa71a030ca-test: override LDFLAGS += -lpthread
232c93d07b74-test: override LDFLAGS += -lpthread
send_recv: override LDFLAGS += -lpthread
send_recvmsg: override LDFLAGS += -lpthread
poll-link: override LDFLAGS += -lpthread
accept-link: override LDFLAGS += -lpthread
submit-reuse: override LDFLAGS += -lpthread
poll-v-poll: override LDFLAGS += -lpthread
across-fork: override LDFLAGS += -lpthread
ce593a6c480a-test: override LDFLAGS += -lpthread
wakeup-hang: override LDFLAGS += -lpthread
pipe-eof: override LDFLAGS += -lpthread
timeout-new: override LDFLAGS += -lpthread
thread-exit: override LDFLAGS += -lpthread
ring-leak2: override LDFLAGS += -lpthread
poll-mshot-update: override LDFLAGS += -lpthread
exit-no-cleanup: override LDFLAGS += -lpthread
pollfree: override LDFLAGS += -lpthread
msg-ring: override LDFLAGS += -lpthread
recv-msgall: override LDFLAGS += -lpthread
recv-msgall-stream: override LDFLAGS += -lpthread

I don't know why my linker doesn't complain about that.

What about appending -lpthread to all tests and remove all of these
override stuff? Are you okay with that?

Or do you prefer to append -lpthread for only test that needs pthread?

-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename
  2022-04-03 15:05         ` Ammar Faizi
@ 2022-04-03 15:06           ` Jens Axboe
  0 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2022-04-03 15:06 UTC (permalink / raw)
  To: Ammar Faizi; +Cc: io-uring Mailing List, GNU/Weeb Mailing List

On 4/3/22 9:05 AM, Ammar Faizi wrote:
> On 4/3/22 10:00 PM, Jens Axboe wrote:
>> On 4/3/22 8:55 AM, Ammar Faizi wrote:
>>> On 4/3/22 9:51 PM, Jens Axboe wrote:
>>>> On 4/3/22 3:56 AM, Ammar Faizi wrote:
>>>>> When adding a new test, we often forget to add the new test binary to
>>>>> `.gitignore`. Append `.test` to the test binary filename, this way we
>>>>> can use a wildcard matching "test/*.test" in `.gitignore` to ignore all
>>>>> test binary files.
>>>>
>>>> Did you build it?
>>>>
>>>>        CC 917257daa0fe-test.test
>>>> /usr/bin/ld: /tmp/ccGrhiuN.o: in function `thread_start':
>>>> /home/axboe/git/liburing/test/35fa71a030ca-test.c:52: undefined reference to `pthread_attr_setstacksize'
>>>> /usr/bin/ld: /home/axboe/git/liburing/test/35fa71a030ca-test.c:55: undefined reference to `pthread_create'
>>>>        CC a0908ae19763-test.test
>>>> collect2: error: ld returned 1 exit status
>>>> make[1]: *** [Makefile:210: 35fa71a030ca-test.test] Error 1
>>>> make[1]: *** Waiting for unfinished jobs....
>>>> /usr/bin/ld: /tmp/cc2nozDW.o: in function `main':
>>>> /home/axboe/git/liburing/test/232c93d07b74-test.c:295: undefined reference to `pthread_create'
>>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:296: undefined reference to `pthread_create'
>>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:297: undefined reference to `pthread_join'
>>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:298: undefined reference to `pthread_join'
>>>> collect2: error: ld returned 1 exit status
>>>> make[1]: *** [Makefile:210: 232c93d07b74-test.test] Error 1
>>>> make[1]: Leaving directory '/home/axboe/git/liburing/test'
>>>>
>>>> I do like the idea of not having to keep fixing that gitignore list.
>>>
>>> Hmm.. weird... It builds just fine from my end.
>>> Can you show the full commands?
>>
>> Sure, here it is:
>>
>> axboe@m1 ~/gi/liburing (master)> make V=1                                    0.011s
> 
> OK, it now makes sense to me.
> 
> These pthread stuff are appended for the test binary files without "*.test" suffix.
> 
> 35fa71a030ca-test: override LDFLAGS += -lpthread
> 232c93d07b74-test: override LDFLAGS += -lpthread
> send_recv: override LDFLAGS += -lpthread
> send_recvmsg: override LDFLAGS += -lpthread
> poll-link: override LDFLAGS += -lpthread
> accept-link: override LDFLAGS += -lpthread
> submit-reuse: override LDFLAGS += -lpthread
> poll-v-poll: override LDFLAGS += -lpthread
> across-fork: override LDFLAGS += -lpthread
> ce593a6c480a-test: override LDFLAGS += -lpthread
> wakeup-hang: override LDFLAGS += -lpthread
> pipe-eof: override LDFLAGS += -lpthread
> timeout-new: override LDFLAGS += -lpthread
> thread-exit: override LDFLAGS += -lpthread
> ring-leak2: override LDFLAGS += -lpthread
> poll-mshot-update: override LDFLAGS += -lpthread
> exit-no-cleanup: override LDFLAGS += -lpthread
> pollfree: override LDFLAGS += -lpthread
> msg-ring: override LDFLAGS += -lpthread
> recv-msgall: override LDFLAGS += -lpthread
> recv-msgall-stream: override LDFLAGS += -lpthread
> 
> I don't know why my linker doesn't complain about that.
> 
> What about appending -lpthread to all tests and remove all of these
> override stuff? Are you okay with that?
> 
> Or do you prefer to append -lpthread for only test that needs pthread?

Nah I think that's fine, also saves some hassle when you add a new test
that does use pthread.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-04-03 15:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-03  9:56 [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement Ammar Faizi
2022-04-03  9:56 ` [PATCH liburing v1 1/2] src/int_flags.h: Add missing SPDX-License-Identifier Ammar Faizi
2022-04-03  9:56 ` [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename Ammar Faizi
2022-04-03 14:51   ` Jens Axboe
2022-04-03 14:55     ` Ammar Faizi
2022-04-03 15:00       ` Jens Axboe
2022-04-03 15:05         ` Ammar Faizi
2022-04-03 15:06           ` Jens Axboe
2022-04-03 14:52 ` (subset) [PATCH liburing v1 0/2] SPDX fix and .gitignore improvement Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox