Re: Buildbot failure in Wildebeest Builder on whole buildset

2022-02-23 Thread Mark Wielaard
Hi,

On Wed, Feb 23, 2022 at 12:26:26PM +0100, Mark Wielaard wrote:
> So there were 3 issues:
> 
> - The debian-i386 build had pre-existing failures that weren't
>   reported before.
> - The recent commits introduced some tests which failed, and then
>   some code changes that fixed those tests so they succeeded.
>   IMHO the buildbot was correct to flag those because they are real
>   failures, even though they were fixed 2 commits later. This makes
>   e.g. bisecting issues a bit of a pain. So I would like to see us
>   commit in the "correct order".

So on irc we did briefly discusss that this "correct order" is
slightly opposite to what you do when using Test Driven Development
(TDD). And I agree that test driven development is great. First
writing the testcases, then the code to match the intended
behaviour. But if popssible please first commit the code, then the
testcases (or both together). Or if you wrote the tests first,
committed them locally, then wrote the code to make them PASS as a
separate commit, git rebase the commits to swap (or merge/squash) them
before pushing. git rebase --interactive is really cool BTW.

> - The buildbot test was incorrect when /bin/sh wasn't bash (as on
>   the debian builders, where it is dash).
>   test $? == 1 should have been $? -eq 1
>   Fixed.

So everything, except debian-i386, is green again:
https://builder.wildebeest.org/buildbot/#/builders?tags=gccrust

The buildbot will only sent email when another builder switches from
green to red. So it will no longer sent email about the already red
debian-i386 builder.

So currently we have a BuildSetStatusGenerator with mode=('problem',)
where problem is "Include a build which failed when the previous build
has passed."

https://docs.buildbot.net/current/manual/configuration/report_generators/buildset.html

But we could use a different setting, maybe 'failing' to always sent
mail when a build fails (but currently that means all builds, because
debian-i386 fails). Or 'change' to report on any builder that changed
status.

Cheers,

Mark

-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: qual_union_type help

2022-02-23 Thread Eric Botcazou via Gcc-rust
> That makes sense during construction we also know what the value of
> the discriminant is. What does the Ada front-end replace the
> placeholder_exprs with? Can it simply be the value of the discriminant
> at constructor? I haven't tried that.

Ultimately all PLACEHOLDER_EXPRs need to be replaced by something in the code, 
i.e. they can only survive in (abstract) types.  There is an entire machinery 
in tree.c for that, called both from the front-end and middle-end in Ada.  You 
can replace it with an explicit value (SUBSTITUTE_IN_EXPR) or you can search 
for it in an object (SUBSTITUTE_PLACEHOLDER_IN_EXPR).  You can presumably do 
it through the gimplification hook.

-- 
Eric Botcazou


-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: qual_union_type help

2022-02-23 Thread Philip Herron
Hi Eric,

That makes sense during construction we also know what the value of
the discriminant is. What does the Ada front-end replace the
placeholder_exprs with? Can it simply be the value of the discriminant
at constructor? I haven't tried that.

Thanks

--Phil

On Wed, 23 Feb 2022 at 17:33, Eric Botcazou  wrote:
>
> > This makes sense this we can't gimplify a placeholder expression. So
> > this seems that when i make a constructor for the QUAL_UNION_TYPE i
> > must iterate the fields and replace the placeholder_expr to have a
> > reference to the discriminant via another COMPONENT_REF. Though does
> > this mean for the constructor i will need to create a temporary to
> > hold onto it to create another component_ref?
>
> The Ada compiler gets rid of all PLACEHOLDER_EXPRs in CONSTRUCTORs because the
> subtype of these CONSTRUCTORs is always constrained in Ada parlance, i.e. you
> know the value of the discriminant since it is assigned in the CONSTRUCTOR, so
> the gimplifier is indeed presumably not wired to eliminate them on its own.
>
> --
> Eric Botcazou
>
>
-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: qual_union_type help

2022-02-23 Thread Eric Botcazou via Gcc-rust
> This makes sense this we can't gimplify a placeholder expression. So
> this seems that when i make a constructor for the QUAL_UNION_TYPE i
> must iterate the fields and replace the placeholder_expr to have a
> reference to the discriminant via another COMPONENT_REF. Though does
> this mean for the constructor i will need to create a temporary to
> hold onto it to create another component_ref?

The Ada compiler gets rid of all PLACEHOLDER_EXPRs in CONSTRUCTORs because the 
subtype of these CONSTRUCTORs is always constrained in Ada parlance, i.e. you 
know the value of the discriminant since it is assigned in the CONSTRUCTOR, so 
the gimplifier is indeed presumably not wired to eliminate them on its own.

-- 
Eric Botcazou


-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


qual_union_type help

2022-02-23 Thread Philip Herron
Hi everyone

I am seeking some help on using the QUAL_UNION_TYPE it seems ideally
placed to be used for enums in Rust. My initial implementation was
achieved by simply using a union such as:

union my_enum {
  variant_a { enum discriminant; ...data } ;
  variant_b { enum discriminant; ...data} ;
}

Having each variant contain an enum for the discriminant meant that
dataless handling variants were quite simple. Upon trying to use the
QUAL_UNION_TYPE this all seems reasonably trivial but I can't figure
out what to set the DECL_QUALIFIER to be, initially from reading the
documentation on https://gcc.gnu.org/onlinedocs/gccint/Types.html it
seemed that it wants a slightly different layout by using a
placeholder_expr to reference an outer discriminant field such that
the layout becomes:

struct my_enum {
  enum discriminant;
  union variants {
variant_a { data };
variant_b { data };
  }
}

So I have been creating my DECL_QUALIFIER as follows:

```
tree field_offset = NULL_TREE;
tree place_holder = build0 (PLACEHOLDER_EXPR, sizetype);
tree place_holder_expr
  = build3 (COMPONENT_REF, TREE_TYPE (qual_field),
place_holder, qual_field, field_offset);

DECL_QUALIFIER (field)
= build2 (EQ_EXPR, boolean_type_node,
place_holder_expr, discrim);
```

So this seems to generate some interesting code and then finally hit
an ICE inside:

Breakpoint 5, gimplify_expr (expr_p=0x76ff1f48,
pre_p=0x7fffd2d8, post_p=0x7fffbb58, gimple_test_f=0x15aa98f
, fallback=3) at
../../gccrs/gcc/gimplify.cc:15755
15755 gcc_unreachable ();
(gdb) call debug_tree(*expr_p)
 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set -1
canonical-type 0x7700a000 precision:64 min  max >
   >

This makes sense this we can't gimplify a placeholder expression. So
this seems that when i make a constructor for the QUAL_UNION_TYPE i
must iterate the fields and replace the placeholder_expr to have a
reference to the discriminant via another COMPONENT_REF. Though does
this mean for the constructor i will need to create a temporary to
hold onto it to create another component_ref?

Or am I doing this completely wrong? I haven't had much success in
following the QUAL_UNION_TYPE code in the Ada front-end, but any
pointers would be greatly appreciated.

Thanks.

--Phil
-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: make check-rust doesn't fail, but now the buildbot does

2022-02-23 Thread Philip Herron
Thanks for doing this I've been investigating the issue with the 2
match expressions I think it's down to the layout of the enum type not
being correct. Not quite sure what the fix will be yet.

Overall it's just great to have this level of feedback automatically
on multiple machines.

--Phil

On Tue, 22 Feb 2022 at 23:59, Mark Wielaard  wrote:
>
> Hi,
>
> make check-rust doesn't fail if there are any unexpected failuress.
> I couldn't figure out why not. So I added a new step to the buildbot
> so that it does grep unexpected gcc/testsuite/rust/rust.sum; test $? == 1"
> which should make the build fail if there are any unexpected test results.
>
> If this works at least the debian-i686 builder should start failing
> because it has a couple of failing test results.
>
> Cheers,
>
> Mark
>
> --
> Gcc-rust mailing list
> Gcc-rust@gcc.gnu.org
> https://gcc.gnu.org/mailman/listinfo/gcc-rust
-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Buildbot failure in Wildebeest Builder on whole buildset

2022-02-23 Thread buildbot
The Buildbot has detected a new failure on builder gccrust-fedora-x86_64 while 
building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/59/builds/1598

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-x86_64

Build Reason: 
Blamelist: Arthur Cohen 

BUILD FAILED: failed 'grep unexpected ...' (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-fedora-ppc64le while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/60/builds/1609

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-ppc64le

Build Reason: 
Blamelist: Arthur Cohen 

BUILD FAILED: failed 'grep unexpected ...' (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-fedora-ppc64 while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/61/builds/1587

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-ppc64

Build Reason: 
Blamelist: Arthur Cohen 

BUILD FAILED: failed 'grep unexpected ...' (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-fedora-s390x while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/63/builds/1333

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-s390x

Build Reason: 
Blamelist: Arthur Cohen 

BUILD FAILED: failed 'grep unexpected ...' (failure)

Sincerely,
 -The Buildbot

-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: Buildbot failure in Wildebeest Builder on whole buildset

2022-02-23 Thread Mark Wielaard
Hi,

On Wed, 2022-02-23 at 11:35 +0100, Mark Wielaard wrote:
> So, this works as expected. Note that it reports issues not just for
> debian-i386, but also for some other arches (all debian based). The
> i386 issues are not new. But the others do seem to be caused by the
> latest commit. I haven't investigated why yet though.
> 
> The buildbot links also point to the log and sum files that might be
> useful to inspect.

So there were 3 issues:

- The debian-i386 build had pre-existing failures that weren't
  reported before.
- The recent commits introduced some tests which failed, and then
  some code changes that fixed those tests so they succeeded.
  IMHO the buildbot was correct to flag those because they are real
  failures, even though they were fixed 2 commits later. This makes
  e.g. bisecting issues a bit of a pain. So I would like to see us
  commit in the "correct order".
- The buildbot test was incorrect when /bin/sh wasn't bash (as on
  the debian builders, where it is dash).
  test $? == 1 should have been $? -eq 1
  Fixed.

Cheers,

Mark
-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: Buildbot failure in Wildebeest Builder on whole buildset

2022-02-23 Thread Mark Wielaard
Hi,

So, this works as expected. Note that it reports issues not just for
debian-i386, but also for some other arches (all debian based). The
i386 issues are not new. But the others do seem to be caused by the
latest commit. I haven't investigated why yet though.

The buildbot links also point to the log and sum files that might be
useful to inspect.

Cheers,

Mark

On Wed, Feb 23, 2022 at 10:26:16AM +, build...@builder.wildebeest.org wrote:
> The Buildbot has detected a new failure on builder gccrust-debian-arm64 while 
> building gccrust.
> Full details are available at:
> https://builder.wildebeest.org/buildbot/#builders/58/builds/1681
> 
> Buildbot URL: https://builder.wildebeest.org/buildbot/
> 
> Worker for this Build: debian-arm64
> 
> Build Reason: 
> Blamelist: Arthur Cohen , bors[bot] 
> <26634292+bors[bot]@users.noreply.github.com>
> 
> BUILD FAILED: failed 'grep unexpected ...' (failure)
> 
> Sincerely,
>  -The BuildbotThe Buildbot has detected a new failure on builder 
> gccrust-debian-i386 while building gccrust.
> Full details are available at:
> https://builder.wildebeest.org/buildbot/#builders/62/builds/1316
> 
> Buildbot URL: https://builder.wildebeest.org/buildbot/
> 
> Worker for this Build: debian-i386
> 
> Build Reason: 
> Blamelist: Arthur Cohen , bors[bot] 
> <26634292+bors[bot]@users.noreply.github.com>
> 
> BUILD FAILED: failed 'grep unexpected ...' (failure)
> 
> Sincerely,
>  -The BuildbotThe Buildbot has detected a new failure on builder 
> gccrust-debian-ppc64 while building gccrust.
> Full details are available at:
> https://builder.wildebeest.org/buildbot/#builders/64/builds/139
> 
> Buildbot URL: https://builder.wildebeest.org/buildbot/
> 
> Worker for this Build: debian-ppc64
> 
> Build Reason: 
> Blamelist: Arthur Cohen , bors[bot] 
> <26634292+bors[bot]@users.noreply.github.com>
> 
> BUILD FAILED: failed 'grep unexpected ...' (failure)
> 
> Sincerely,
>  -The Buildbot
> 
> -- 
> Gcc-rust mailing list
> Gcc-rust@gcc.gnu.org
> https://gcc.gnu.org/mailman/listinfo/gcc-rust
-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Buildbot failure in Wildebeest Builder on whole buildset

2022-02-23 Thread buildbot
The Buildbot has detected a new failure on builder gccrust-debian-arm64 while 
building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/58/builds/1681

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: debian-arm64

Build Reason: 
Blamelist: Arthur Cohen , bors[bot] 
<26634292+bors[bot]@users.noreply.github.com>

BUILD FAILED: failed 'grep unexpected ...' (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-debian-i386 while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/62/builds/1316

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: debian-i386

Build Reason: 
Blamelist: Arthur Cohen , bors[bot] 
<26634292+bors[bot]@users.noreply.github.com>

BUILD FAILED: failed 'grep unexpected ...' (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-debian-ppc64 while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/64/builds/139

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: debian-ppc64

Build Reason: 
Blamelist: Arthur Cohen , bors[bot] 
<26634292+bors[bot]@users.noreply.github.com>

BUILD FAILED: failed 'grep unexpected ...' (failure)

Sincerely,
 -The Buildbot

-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust