Skip to content

Commit

Permalink
Trac #22175: Sage 7.5 binaries do not build
Browse files Browse the repository at this point in the history
Sage doesn't build in long (~100 chars) directories:
{{{
169625[dochtml] Error building the documentation.
169626[dochtml] Traceback (most recent call last):
169627[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python/ru
npy.py", line 174, in _run_module_as_main
169628[dochtml]     "__main__", fname, loader, pkg_name)
169629[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python/ru
npy.py", line 72, in _run_code
169630[dochtml]     exec code in run_globals
169631[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python2.7
/site-packages/sage_setup/docbuild/__main__.py", line 2, in <module>
169632[dochtml]     main()
169633[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python2.7
/site-packages/sage_setup/docbuild/__init__.py", line 1667, in main
169634[dochtml]     builder()
169635[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python2.7
/site-packages/sage_setup/docbuild/__init__.py", line 316, in _wrapper
169636[dochtml]     getattr(get_builder(document), 'inventory')(*args,
**kwds)
169637[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python2.7
/site-packages/sage_setup/docbuild/__init__.py", line 510, in _wrapper
169638[dochtml]     build_many(build_ref_doc, L)
169639[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python2.7
/site-packages/sage_setup/docbuild/__init__.py", line 252, in build_many
169640[dochtml]     ret = x.get(99999)
169641[dochtml]   File "/home/buildbot/slave/binary_pkg/build/source/Sag
eMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2/local/lib/python/mu
ltiprocessing/pool.py", line 567, in get
169642[dochtml]     raise self._value
169643[dochtml] NameError: Singular library 'freegb.lib' not found
}}}

URL: https://trac.sagemath.org/22175
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): Eric Gourgoulhon
  • Loading branch information
Release Manager authored and vbraun committed Jan 15, 2017
2 parents a0ef507 + d31d416 commit e116eb1
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
97 changes: 97 additions & 0 deletions build/pkgs/singular/patches/libnamebuf_length.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Increase the hardcoded library file name buffer size

See https://trac.sagemath.org/ticket/22175

---
diff --git a/Singular/fehelp.cc b/Singular/fehelp.cc
index df00135..2fb2f5d 100644
--- a/Singular/fehelp.cc
+++ b/Singular/fehelp.cc
@@ -702,7 +702,7 @@ static BOOLEAN heOnlineHelp(char* s)
return FALSE;
}

- char libnamebuf[128];
+ char libnamebuf[1024];
FILE *fp=NULL;
// first, search for library of that name
if ((str[1]!='\0') &&
diff --git a/Singular/iparith.cc b/Singular/iparith.cc
index 9843bb1..a1472e8 100644
--- a/Singular/iparith.cc
+++ b/Singular/iparith.cc
@@ -5193,7 +5193,7 @@ BOOLEAN jjWAITALL1(leftv res, leftv u)

BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
{
- char libnamebuf[256];
+ char libnamebuf[1024];
lib_types LT = type_of_LIB(s, libnamebuf);

#ifdef HAVE_DYNAMIC_LOADING
@@ -5228,7 +5228,7 @@ BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
package savepack=currPack;
currPack=IDPACKAGE(pl);
IDPACKAGE(pl)->loaded=TRUE;
- char libnamebuf[256];
+ char libnamebuf[1024];
FILE * fp = feFopen( s, "r", libnamebuf, TRUE );
BOOLEAN bo=iiLoadLIB(fp, libnamebuf, s, pl, autoexport, TRUE);
currPack=savepack;
diff --git a/Singular/iplib.cc b/Singular/iplib.cc
index a0fdff9..2bd6e7b 100644
--- a/Singular/iplib.cc
+++ b/Singular/iplib.cc
@@ -656,7 +656,7 @@ iiGetBuiltinModInit(const char* libname)
BOOLEAN iiTryLoadLib(leftv v, const char *id)
{
BOOLEAN LoadResult = TRUE;
- char libnamebuf[128];
+ char libnamebuf[1024];
char *libname = (char *)omAlloc(strlen(id)+5);
const char *suffix[] = { "", ".lib", ".so", ".sl", NULL };
int i = 0;
@@ -672,7 +672,7 @@ BOOLEAN iiTryLoadLib(leftv v, const char *id)
{
char *s=omStrDup(libname);
#ifdef HAVE_DYNAMIC_LOADING
- char libnamebuf[256];
+ char libnamebuf[1024];
#endif

if (LT==LT_SINGULAR)
@@ -717,7 +717,7 @@ BOOLEAN iiLocateLib(const char* lib, char* where)

BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force )
{
- char libnamebuf[128];
+ char libnamebuf[1024];
// procinfov pi;
// idhdl h;
idhdl pl;
diff --git a/Singular/libparse.cc b/Singular/libparse.cc
index 333999f..b468ed1 100644
--- a/Singular/libparse.cc
+++ b/Singular/libparse.cc
@@ -1093,7 +1093,7 @@ BOOLEAN p_static = FALSE;
int old_state = 0;
lib_cmds last_cmd = LP_NONE;

-char libnamebuf[128];
+char libnamebuf[1024];
char *text_buffer=NULL;
long string_start;

diff --git a/Singular/libparse.ll b/Singular/libparse.ll
index 3cd7abc..f85bb3b 100644
--- a/Singular/libparse.ll
+++ b/Singular/libparse.ll
@@ -44,7 +44,7 @@ BOOLEAN p_static = FALSE;
int old_state = 0;
lib_cmds last_cmd = LP_NONE;

-char libnamebuf[128];
+char libnamebuf[1024];
char *text_buffer=NULL;
long string_start;

8 changes: 8 additions & 0 deletions build/pkgs/singular/spkg-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash


Singular -c 'LIB "freegb.lib"; exit;'
if [ $? -ne 0 ]; then
echo >&2 "Error loading the freegb library in Singular."
exit 1
fi

0 comments on commit e116eb1

Please sign in to comment.