Opened 3 years ago

Closed 3 years ago

#25057 closed defect (fixed)

Building ecl-16.1.2 fails on some Cygwin versions

Reported by: embray Owned by: embray
Priority: blocker Milestone: sage-8.4
Component: porting: Cygwin Keywords:
Cc: Merged in:
Authors: Erik Bray Reviewers: Travis Scrimshaw
Report Upstream: Not yet reported upstream; Will do shortly. Work issues:
Branch: 981cca9 (Commits, GitHub, GitLab) Commit: 981cca9415e4fcee8a1a00f08e50bb5ed6c9c5a3
Dependencies: Stopgaps:

Status badges

Description

IIRC I've had this problem for a while but never made a report of it.

[ecl-16.1.2.p5] gcc -DECLDIR="\"/home/embray/src/sagemath/sage/local/lib/ecl-16.1.2\"" -I. -I/home/embray/src/sagemath/sage/local/var/tmp/sage/build/ecl-16.1.2.p5/src/build -I/home/embray/src/sagemath/sage/local/var/tmp/sage/build/ecl-16.1.2.p5/src/src/c -I../ecl/gc -DECL_API -DECL_NO_LEGACY   -I/home/embray/src/sagemath/sage/local/include  -g -O0   -Dcygwin -c -o ffi/backtrace.o ffi/backtrace.o.c
[ecl-16.1.2.p5] /home/embray/src/sagemath/sage/local/var/tmp/sage/build/ecl-16.1.2.p5/src/src/c/ffi/backtrace.d: In function 'backtrace_symbols':
[ecl-16.1.2.p5] /home/embray/src/sagemath/sage/local/var/tmp/sage/build/ecl-16.1.2.p5/src/src/c/ffi/backtrace.d:84:9: error: unknown type name 'Dl_info'
[ecl-16.1.2.p5]          Dl_info data[1];
[ecl-16.1.2.p5]          ^~~~~~~
[ecl-16.1.2.p5] /home/embray/src/sagemath/sage/local/var/tmp/sage/build/ecl-16.1.2.p5/src/src/c/ffi/backtrace.d:88:21: warning: implicit declaration of function 'dladdr' [-Wimplicit-function-declaration]
[ecl-16.1.2.p5]                  if (dladdr(buffer[i], data)) {
[ecl-16.1.2.p5]                      ^~~~~~
[ecl-16.1.2.p5] /home/embray/src/sagemath/sage/local/var/tmp/sage/build/ecl-16.1.2.p5/src/src/c/ffi/backtrace.d:89:42: error: request for member 'dli_sname' in something not a structure or union
[ecl-16.1.2.p5]                          strings[i] = data->dli_sname;
[ecl-16.1.2.p5]                                           ^~
[ecl-16.1.2.p5] make[5]: *** [Makefile:86: ffi/backtrace.o] Error 1

It works if I run SAGE_DEBUG=no make ecl.

Change History (15)

comment:1 Changed 3 years ago by embray

  • Owner changed from (none) to embray

comment:2 Changed 3 years ago by embray

I feel like I've run into a problem with Dl_info on Cygwin before, but I can't recall where...

comment:3 Changed 3 years ago by embray

  • Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.

I see, Dl_info is not defined unless the _GNU_SOURCE macro is defined--this the default on Linux, but on Cygwin it is not defined by default. This should be fixed upstream, but we can also easily add it in.

comment:4 Changed 3 years ago by embray

  • Milestone changed from sage-8.2 to sage-8.3

comment:5 Changed 3 years ago by embray

  • Milestone changed from sage-8.3 to sage-wishlist

comment:6 Changed 3 years ago by embray

Just got this on the buildbot machine I'm trying to set up, mysteriously, even without SAGE_DEBUG defined. In fact, I'm not sure why this was affected by SAGE_DEBUG in the first place...

Last edited 3 years ago by embray (previous) (diff)

comment:7 Changed 3 years ago by embray

My only guess for why I don't get this on my local machine is that it must have something to do with ccache. I haven't even seen this on the patchbot in a while, which also has a well-primed ccache. I just have to wonder what's being missed from the ccache hash. It's also possible this only stopped working on more recent cygwin versions but it's not obvious to me when that would have occurred...

comment:8 Changed 3 years ago by embray

Well, I tried re-building ecl with CCACHE_DISABLE=1 and it still built, so it probably has something to do with the newlib version or gcc or something. Very strange...

comment:9 Changed 3 years ago by embray

  • Milestone changed from sage-wishlist to sage-8.4
  • Priority changed from major to blocker
  • Summary changed from Building ecl-16.1.2 with SAGE_DEBUG=yes fails on Cygwin to Building ecl-16.1.2 fails on some Cygwin versions

Setting this as a blocker since it's preventing building in general, at least, I'm guessing on newer Cygwins. Fortunately it has an easy workaround.

comment:10 Changed 3 years ago by embray

  • Authors set to Erik Bray
  • Branch set to u/embray/cygwin/ticket-25057
  • Commit set to 981cca9415e4fcee8a1a00f08e50bb5ed6c9c5a3
  • Status changed from new to needs_review

Fairly trivial fix. In this case I deliberately did not bump the package version for a few reasons:

1) The main purpose of doing so would be for testing on buildbots, however there is still not yet an automated Cygwin buildbot (ironically, this issue was hit in the process of trying to test and configure one).

2) It only affects Sage on Cygwin--there is no need to waste buildbot time on other platforms that won't be affected by this change.

3) Even on existing builds on Cygwin it is not necessary to re-build ECL due to this change; this will only fix an issue on systems where ECL could not be built in the first place.

I'm happy to bump it anyways if anyone suggests otherwise, but I believe these are good arguments not to in this case.


New commits:

981cca9Trac #25057: fix building ECL on Cygwins where Dl_info is not defined without _GNU_SOURCE

comment:11 follow-up: Changed 3 years ago by dimpase

Would it help to have a Windows (10? something else) Google CE host running Cygwin patch/buildbots? (I have a grant from Google that lets me do this for the coming 5 months or so).

comment:12 in reply to: ↑ 11 Changed 3 years ago by embray

Replying to dimpase:

Would it help to have a Windows (10? something else) Google CE host running Cygwin patch/buildbots? (I have a grant from Google that lets me do this for the coming 5 months or so).

It may or may not. I've had a number of private conversations about possibilities for hosting such things. The problem has consistently been that Cygwin under a virtualized host can be rather slow. This slowness can be mitigated significantly with appropriate control over the VM host, but with cloud services we frequently don't even have that. I tried setting up a VM on Azure, for example, and it was still rather slow.

Anyways, we now (or will soon) have a buildbot running on a VM once all these blocker issues are fixed. In the meantime the best thing is having a dedicated host. We have had discussions about purchasing a machine with OpenDreamKit? funds, but I don't know where that's at right now.

comment:13 Changed 3 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

I was not hit with this, but Sage builds on my cygwin just fine with this and it doesn't affect other systems. So I am setting this to a positive review.

comment:14 Changed 3 years ago by embray

Thanks for checking. Indeed I'm still a little mystified as to why this was affecting this new machine I set up but not others. But the basic underlying issue is clear.

comment:15 Changed 3 years ago by vbraun

  • Branch changed from u/embray/cygwin/ticket-25057 to 981cca9415e4fcee8a1a00f08e50bb5ed6c9c5a3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.