Re: [Tinycc-devel] randomly failing tests

2022-12-28 Thread NightStrike
On Wed, Dec 28, 2022, 11:58 Vincent Lefevre  wrote:

> On 2022-12-28 10:07:19 -0500, NightStrike wrote:
> > On Wed, Dec 28, 2022, 06:46 Vincent Lefevre  wrote:
> > > Perhaps, but the issue with ".NOTPARALLEL" is that it applies to
> > > the full Makefile, in case one just wants to serialize some tests.
> >
> > You can give it prerequisites to overcome that.
>
> This is not possible. From the GNU make manual:
>
>   '.NOTPARALLEL'
>
> If '.NOTPARALLEL' is mentioned as a target, then this invocation of
> 'make' will be run serially, even if the '-j' option is given.  Any
> recursively invoked 'make' command will still run recipes in
> parallel (unless its makefile also contains this target).  Any
> prerequisites on this target are ignored.
>

The current documentation on the link I sent says otherwise, so I guess
this is a newer feature.

The NEWS file has this to say, which implies WAIT can also be used to
similar effect:

* New feature: .NOTPARALLEL accepts prerequisites
  If the .NOTPARALLEL special target has prerequisites then all
prerequisites
  of those targets will be run serially (as if .WAIT was specified between
  each prerequisite).

>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-28 Thread Vincent Lefevre
On 2022-12-28 10:07:19 -0500, NightStrike wrote:
> On Wed, Dec 28, 2022, 06:46 Vincent Lefevre  wrote:
> > Perhaps, but the issue with ".NOTPARALLEL" is that it applies to
> > the full Makefile, in case one just wants to serialize some tests.
> 
> You can give it prerequisites to overcome that.

This is not possible. From the GNU make manual:

  '.NOTPARALLEL'

If '.NOTPARALLEL' is mentioned as a target, then this invocation of
'make' will be run serially, even if the '-j' option is given.  Any
recursively invoked 'make' command will still run recipes in
parallel (unless its makefile also contains this target).  Any
prerequisites on this target are ignored.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-28 Thread NightStrike
On Wed, Dec 28, 2022, 06:46 Vincent Lefevre  wrote:

> On 2022-12-28 06:00:11 -0500, NightStrike wrote:
> > On Wed, Dec 28, 2022, 03:31 Christian Jullien  wrote:
> > > diff --git a/Makefile b/Makefile
> > > index c220879..c718d7a 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -447,14 +447,16 @@ config.mak:
> > > $(if $(wildcard $@),,@echo "Please run ./configure." && exit 1)
> > >
> > >  # run all tests
> > > +SERIALIZE = -j1
> > > +
> > >  test:
> > > -   @$(MAKE) -C tests
> > > +   @$(MAKE) $(SERIALIZE) -C tests
> > >  # run test(s) from tests2 subdir (see make help)
> > >  tests2.%:
> > > -   @$(MAKE) -C tests/tests2 $@
> > > +   @$(MAKE) $(SERIALIZE) -C tests/tests2 $@
> > >
> > >  testspp.%:
> > > -   @$(MAKE) -C tests/pp $@
> > > +   @$(MAKE) $(SERIALIZE) -C tests/pp $@
> > >
> > >  clean:
> > > @rm -f tcc$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tags ETAGS
> *.pod
> >
> > I think what you want is .NOTPARALLEL:
> >
> > https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html
>
> Perhaps, but the issue with ".NOTPARALLEL" is that it applies to
> the full Makefile, in case one just wants to serialize some tests.
>

You can give it prerequisites to overcome that.

However, Herman ten Brugge fixed the issue yesterday in
> commit 7ed9c95ae795dd71c624ffb0d82f267b2c9697af to allow
> a parallel build. I've just checked that it works. Thanks!


Yes, this is the better solution :)
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-28 Thread Vincent Lefevre
On 2022-12-28 06:00:11 -0500, NightStrike wrote:
> On Wed, Dec 28, 2022, 03:31 Christian Jullien  wrote:
> > diff --git a/Makefile b/Makefile
> > index c220879..c718d7a 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -447,14 +447,16 @@ config.mak:
> > $(if $(wildcard $@),,@echo "Please run ./configure." && exit 1)
> >
> >  # run all tests
> > +SERIALIZE = -j1
> > +
> >  test:
> > -   @$(MAKE) -C tests
> > +   @$(MAKE) $(SERIALIZE) -C tests
> >  # run test(s) from tests2 subdir (see make help)
> >  tests2.%:
> > -   @$(MAKE) -C tests/tests2 $@
> > +   @$(MAKE) $(SERIALIZE) -C tests/tests2 $@
> >
> >  testspp.%:
> > -   @$(MAKE) -C tests/pp $@
> > +   @$(MAKE) $(SERIALIZE) -C tests/pp $@
> >
> >  clean:
> > @rm -f tcc$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tags ETAGS *.pod
> 
> I think what you want is .NOTPARALLEL:
> 
> https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html

Perhaps, but the issue with ".NOTPARALLEL" is that it applies to
the full Makefile, in case one just wants to serialize some tests.

However, Herman ten Brugge fixed the issue yesterday in
commit 7ed9c95ae795dd71c624ffb0d82f267b2c9697af to allow
a parallel build. I've just checked that it works. Thanks!

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-28 Thread NightStrike
On Wed, Dec 28, 2022, 03:31 Christian Jullien  wrote:

> If it helps, I've just tried this patch which implement what you
> suggested, and it works. Maybe maintainers will consider to add it (.. or
> not)
>
> diff --git a/Makefile b/Makefile
> index c220879..c718d7a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -447,14 +447,16 @@ config.mak:
> $(if $(wildcard $@),,@echo "Please run ./configure." && exit 1)
>
>  # run all tests
> +SERIALIZE = -j1
> +
>  test:
> -   @$(MAKE) -C tests
> +   @$(MAKE) $(SERIALIZE) -C tests
>  # run test(s) from tests2 subdir (see make help)
>  tests2.%:
> -   @$(MAKE) -C tests/tests2 $@
> +   @$(MAKE) $(SERIALIZE) -C tests/tests2 $@
>
>  testspp.%:
> -   @$(MAKE) -C tests/pp $@
> +   @$(MAKE) $(SERIALIZE) -C tests/pp $@
>
>  clean:
> @rm -f tcc$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tags ETAGS *.pod


I think what you want is .NOTPARALLEL:

https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-28 Thread Christian Jullien
If it helps, I've just tried this patch which implement what you suggested, and 
it works. Maybe maintainers will consider to add it (.. or not)

diff --git a/Makefile b/Makefile
index c220879..c718d7a 100644
--- a/Makefile
+++ b/Makefile
@@ -447,14 +447,16 @@ config.mak:
$(if $(wildcard $@),,@echo "Please run ./configure." && exit 1)

 # run all tests
+SERIALIZE = -j1
+
 test:
-   @$(MAKE) -C tests
+   @$(MAKE) $(SERIALIZE) -C tests
 # run test(s) from tests2 subdir (see make help)
 tests2.%:
-   @$(MAKE) -C tests/tests2 $@
+   @$(MAKE) $(SERIALIZE) -C tests/tests2 $@

 testspp.%:
-   @$(MAKE) -C tests/pp $@
+   @$(MAKE) $(SERIALIZE) -C tests/pp $@

 clean:
@rm -f tcc$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tags ETAGS *.pod

-Original Message-
From: tinycc-devel-bounces+eligis=orange...@nongnu.org 
[mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Vincent 
Lefevre
Sent: Tuesday, December 27, 2022 12:29
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] randomly failing tests

On 2022-12-27 08:30:52 +0100, Herman ten Brugge via Tinycc-devel wrote:
> Are you using parallel build?

Yes, I have a shell function "make" that uses the -j option
(with the number of available cores).

> This does not work for the testsuite .

If this doesn't work for the testsuite, why not disabling the parallel
build of the testsuite?

-- 
Vincent Lefèvre  - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-27 Thread Vincent Lefevre
On 2022-12-27 08:30:52 +0100, Herman ten Brugge via Tinycc-devel wrote:
> Are you using parallel build?

Yes, I have a shell function "make" that uses the -j option
(with the number of available cores).

> This does not work for the testsuite .

If this doesn't work for the testsuite, why not disabling the parallel
build of the testsuite?

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-26 Thread Herman ten Brugge via Tinycc-devel

On 12/7/22 16:06, Vincent Lefevre wrote:

Tests are failing randomly on Debian/x86_64:

[...]
Test: 107_stack_safe...
Test: 108_constructor...
Test: 109_float_struct_calling...
Test: 110_average...
Test: 111_conversion...
Test: 112_backtrace...
--- 108_constructor.expect  2022-12-07 15:57:51.358297673 +0100
+++ 108_constructor.output  2022-12-07 16:03:55.125155438 +0100
@@ -1,3 +1 @@
-constructor
-main
-destructor
+/bin/sh: 1: ./a.exe: Text file busy
make[3]: *** [Makefile:131: 108_constructor.test] Error 1
Test: 113_btdll...
Test: 115_bound_setjmp...
Test: 114_bound_signal...
Test: 116_bound_setjmp2...
Test: 117_builtins...
Test: 118_switch...
Test: 119_random_stuff...
Test: 120_alias...
Test: 121_struct_return...
Test: 122_vla_reuse...
--- 114_bound_signal.expect 2022-12-07 15:57:51.358297673 +0100
+++ 114_bound_signal.output 2022-12-07 16:03:55.169155305 +0100
@@ -1,2 +1,5 @@
-start
-end
+in target function
+in target function
+in target function
+in target function
+in target function
make[3]: *** [Makefile:131: 114_bound_signal.test] Error 1
Test: 123_vla_bug...
Test: 124_atomic_counter...
[...]


Are you using parallel build?
This does not work for the testsuite .

    Herman


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-07 Thread Vincent Lefevre
On 2022-12-07 16:12:22 +0100, Vincent Lefevre wrote:
> The cause seems to be that the generated executable name is fixed
> to "a.exe" instead of depending on the test name:
> 
> 113_btdll.test: T1 = \
> $(TCC) -bt $1 -shared -D DLL=1 -o a1$(DLLSUF) && \
> $(TCC) -bt $1 -shared -D DLL=2 -o a2$(DLLSUF) && \
> $(TCC) -bt $1 a1$(DLLSUF) a2$(DLLSUF) -Wl,-rpath=. -o a.exe && \
> ./a.exe
> 
> T2 = $(if $(NORUN),$1 -o a.exe && ./a.exe,-run $1)
> 
> GEN-CC = $(CC) -w -std=gnu99 $(FLAGS) $1 -o a.exe && ./a.exe $(ARGS)

Changing the T2 line to

  T2 = $(if $(NORUN),$1 -o a-$1.exe && ./a-$1.exe,-run $1)

avoids the failures for me, but I don't know whether this is OK
everywhere or sufficient.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] randomly failing tests

2022-12-07 Thread Vincent Lefevre
On 2022-12-07 16:06:27 +0100, Vincent Lefevre wrote:
> Tests are failing randomly on Debian/x86_64:
> 
> [...]
> Test: 107_stack_safe...
> Test: 108_constructor...
> Test: 109_float_struct_calling...
> Test: 110_average...
> Test: 111_conversion...
> Test: 112_backtrace...
> --- 108_constructor.expect  2022-12-07 15:57:51.358297673 +0100
> +++ 108_constructor.output  2022-12-07 16:03:55.125155438 +0100
> @@ -1,3 +1 @@
> -constructor
> -main
> -destructor
> +/bin/sh: 1: ./a.exe: Text file busy
> make[3]: *** [Makefile:131: 108_constructor.test] Error 1
[...]

The cause seems to be that the generated executable name is fixed
to "a.exe" instead of depending on the test name:

113_btdll.test: T1 = \
$(TCC) -bt $1 -shared -D DLL=1 -o a1$(DLLSUF) && \
$(TCC) -bt $1 -shared -D DLL=2 -o a2$(DLLSUF) && \
$(TCC) -bt $1 a1$(DLLSUF) a2$(DLLSUF) -Wl,-rpath=. -o a.exe && \
./a.exe

T2 = $(if $(NORUN),$1 -o a.exe && ./a.exe,-run $1)

GEN-CC = $(CC) -w -std=gnu99 $(FLAGS) $1 -o a.exe && ./a.exe $(ARGS)

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel