Bug 223047 - lang/rust: unbreak FFI for returning structs on i386
Summary: lang/rust: unbreak FFI for returning structs on i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords: patch, patch-ready
Depends on:
Blocks: 222693
  Show dependency treegraph
 
Reported: 2017-10-16 11:22 UTC by Jan Beich
Modified: 2018-02-26 22:25 UTC (History)
3 users (show)

See Also:
dumbbell: maintainer-feedback+
jbeich: maintainer-feedback? (riggs)
jbeich: merge-quarterly?


Attachments
v0 (1.71 KB, patch)
2017-10-16 11:22 UTC, Jan Beich
no flags Details | Diff
v1 (has commit message) (3.14 KB, patch)
2017-10-23 14:05 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2017-10-16 11:22:15 UTC
Created attachment 187212 [details]
v0

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 freebsd_triage 2017-10-16 11:22:15 UTC
Maintainer informed via mail
Comment 2 Jan Beich freebsd_committer freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 2017-10-23 11:46:01 UTC
Consumers (see below) built fine on 10.3 i386 with the patch here backported to 2017Q4.

  devel/bingrep
  devel/pijul
  devel/racer
  editors/xi-core
  sysutils/exa
  sysutils/flowgger
  textproc/ripgrep
  www/firefox (without files/patch-bug1401093)
  www/geckodriver
  x11/alacritty
Comment 7 Jan Beich freebsd_committer freebsd_triage 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 freebsd_triage 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 freebsd_triage 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

Log:
  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)

Changes:
  head/lang/rust/Makefile
  head/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs
  head/www/firefox/Makefile
  head/www/firefox/files/patch-bug1401093
Comment 10 Jean-Sébastien Pédron freebsd_committer freebsd_triage 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 freebsd_triage 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

Log:
  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)

Changes:
_U  branches/2017Q4/
  branches/2017Q4/lang/rust/Makefile
  branches/2017Q4/lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs
  branches/2017Q4/www/firefox/Makefile
  branches/2017Q4/www/firefox/files/patch-bug1401093
Comment 12 Bryan Drewery freebsd_committer freebsd_triage 2018-02-26 22:25:04 UTC
Upstreamed differently at https://github.com/rust-lang/rust/pull/48560