Bug 223047

Summary: lang/rust: unbreak FFI for returning structs on i386
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Only Me CC: bdrewery, dumbbell, riggs
Priority: --- Keywords: patch, patch-ready
Version: LatestFlags: dumbbell: maintainer-feedback+
jbeich: maintainer-feedback? (riggs)
jbeich: merge-quarterly?
Hardware: i386   
OS: Any   
See Also: https://bugzilla.mozilla.org/show_bug.cgi?id=1401093
Bug Depends on:    
Bug Blocks: 222693    
Description Flags
v1 (has commit message) none

Description Jan Beich freebsd_committer 2017-10-16 11:22:15 UTC
Created attachment 187212 [details]

Firefox 57 (scheduled on 2017-11-14) is going to enable Stylo by default. During build Stylo uses rust-bindgen which relies on libclang returning a struct (e.g., CXString). This seems to corrupt the stack on i386. Let's follow OpenBSD behavior for now.

MFH to 2017Q4 for Rust 1.19 is desired. I can't do continuous QA for quarterlies.

FreeBSD 10.3 build logs:
lang/rust   - http://sprunge.us/jEba
www/firefox - http://sprunge.us/OYQf (see -DMOZ_STYLO)
Comment 1 Bugzilla Automation freebsd_committer 2017-10-16 11:22:15 UTC
Maintainer informed via mail
Comment 2 Jan Beich freebsd_committer 2017-10-23 08:50:33 UTC
1 week left before maintainer timeout. Stylo from Firefox 56 also builds/works fine on i386. ;)

However, I've only tested other consumers together with bug 223123.
Comment 3 Jean-Sébastien Pédron freebsd_committer 2017-10-23 09:53:42 UTC
I will try to finish the update to Rust 1.21.0 (bug 223123) first, to reduce testing time, as you already tested 1.21.0 and this patch together successfully.

Thank you for preparing the patch!
Comment 4 Jan Beich freebsd_committer 2017-10-23 10:00:04 UTC
Landing together with bug 223123 isn't a good idea. It'd block MFH to 2017Q4 and force me to maintain disabled Stylo on i386 for both Firefox 56 and Firefox 57.
Comment 5 Jean-Sébastien Pédron freebsd_committer 2017-10-23 10:23:44 UTC
I would have made two separate commits, but I see what you mean. Ok, I will take care of this patch first.
Comment 6 Jan Beich freebsd_committer 2017-10-23 11:46:01 UTC
Consumers (see below) built fine on 10.3 i386 with the patch here backported to 2017Q4.

  www/firefox (without files/patch-bug1401093)
Comment 7 Jan Beich freebsd_committer 2017-10-23 14:05:19 UTC
Created attachment 187394 [details]
v1 (has commit message)

Initially, I've planned to land this myself but due to ambiguity of approval/intent handing over to you. To avoid waiting game enable Stylo in the same commit (or shortly after):

- Remove workaround in www/firefox which disables Stylo build
- Don't clobber PORTREVISION value in lang/rust-nightly

Note, the next package build will probably start tonight at 01:00 UTC. The default interval appears to be 2 days. Landing just before a build starts allows to catch unexpected regressions sooner.
Comment 8 Jean-Sébastien Pédron freebsd_committer 2017-10-23 17:23:34 UTC
Sorry for the confusion, I was unclear. Feel free to commit it at the same time as the change to www/firefox.

Generally, I think you can commit to lang/rust whenever you want because it's critical to your work.
Comment 9 commit-hook freebsd_committer 2017-10-23 22:58:57 UTC
A commit references this bug:

Author: jbeich
Date: Mon Oct 23 22:58:49 UTC 2017
New revision: 452748
URL: https://svnweb.freebsd.org/changeset/ports/452748

  lang/rust: unbreak FFI for returning struct on i386

  As this fixes Stylo on i386, remove the workaround in www/firefox.

  PR:		223047
  Suggested by:	Sebastien Marie <semarie@openbsd.org>
  Approved by:	rust (dumbbell)
  MFH:		2017Q4 (required by Firefox 57 scheduled on 2017-11-14)

Comment 10 Jean-Sébastien Pédron freebsd_committer 2017-10-23 23:05:15 UTC
Thank you!

I can interrupt Poudriere and point it to 1.21.0 again :-)
Comment 11 commit-hook freebsd_committer 2017-10-25 10:25:32 UTC
A commit references this bug:

Author: jbeich
Date: Wed Oct 25 10:25:25 UTC 2017
New revision: 452841
URL: https://svnweb.freebsd.org/changeset/ports/452841

  MFH: r452748

  lang/rust: unbreak FFI for returning struct on i386

  As this fixes Stylo on i386, remove the workaround in www/firefox.

  PR:		223047
  Suggested by:	Sebastien Marie <semarie@openbsd.org>
  Approved by:	rust (dumbbell)
  Approved by:	ports-secteam (swills)

_U  branches/2017Q4/
Comment 12 Bryan Drewery freebsd_committer 2018-02-26 22:25:04 UTC
Upstreamed differently at https://github.com/rust-lang/rust/pull/48560