Commit graph

22,266 commits

Author SHA1 Message Date
Vadim Zeitlin
dbb85de9cd Use the same ccache cache key for all languages but not compilers
There doesn't seem to be any good reason to use per-language caches, as
there are files that are common to all languages.

But we do want to use different keys for the different compilers and
even different compiler versions, as they yield different results when
compiling the same code.
2021-09-30 17:39:23 +02:00
Vadim Zeitlin
6088323e14 Use ccache for building, not just configuring
Set the PATH to include the ccache directory for the subsequent steps,
including the "build" one, rather than only setting it locally for
configure, as this didn't have much effect at all.
2021-09-30 17:38:24 +02:00
Vadim Zeitlin
84b1b3f8b5 Do not use "make -s" in the CI builds
We want to have as much information as possible in case of the build
failure, so don't use the "--silent" make option.
2021-09-30 17:29:38 +02:00
Vadim Zeitlin
0c46a30249 Use consistent names for the build steps
Follow the convention of the GitHub built-in steps, such as the first
"Set up job" one and use capitalized verbs in imperative mood rather
than a mix of non-capitalized verbs and nouns.

This is a purely cosmetic change.
2021-09-30 17:27:40 +02:00
Vadim Zeitlin
1395b902be Re-add "clean" step of the build
This was used with Travis CI, so there doesn't seem to be any reason not
to use it with GitHub Actions too.
2021-09-30 17:25:25 +02:00
Vadim Zeitlin
542bc18b0f Use working directory step option instead of explicit "cd"
This seems simpler and more explicit ("cd" is easy to miss or forget).
2021-09-30 17:24:54 +02:00
Vadim Zeitlin
9156f390ae Don't set shell explicitly for the build steps
Bash is used by default under all platforms we're going to support here,
so there is no need to specify it explicitly. Moreover, by default the
appropriate shell options (such as "pipefail", as well as "e") are used,
and there is no need to override them.
2021-09-30 17:23:24 +02:00
Vadim Zeitlin
7692d5f9ec Set SWIGJOBS environment variable automatically
Use the number of available CPUs + 1 which seems to work best with the
number of actually available CPUs in the GitHub Actions environment.
2021-09-30 17:17:10 +02:00
Vadim Zeitlin
bbfdedc18b Define all environment variables at job level
There doesn't seem to be any reason to make them step-specific, so
simplify the workflow by doing it once and only once at the job level.

No real changes.
2021-09-30 17:13:33 +02:00
Vadim Zeitlin
a2ff01a910 Use better names for the CI builds
Don't rely on the auto-generated names which are not very useful: e.g.
currently something like "build (1, python, 3)" is shown, while this
commit changes it to just "python3" which is both shorter and more
readable.
2021-09-30 17:08:23 +02:00
Vadim Zeitlin
5d9bbea510 Default to Ubuntu 20.04 if OS is not specified
This makes the matrix more compact, as we don't need to specify the OS
for the majority of the field (all of them now, but we'll add builds
using "macos-N" later, so it will still be necessary for some of them),
and the builds more stable than using which the current latest Ubuntu
version is.
2021-09-30 17:00:24 +02:00
Vadim Zeitlin
067d927cb1 Skip running CI for the changes to the files not affecting it
Note that if we decide to do something for the docs later (e.g. run a
spell checker on them), it should be done in a separate workflow and not
in this one.
2021-09-30 16:53:40 +02:00
William S Fulton
acc41e3fff Add missing Go improvements to changes file 2021-09-24 15:16:09 +01:00
Olly Betts
561a1d843d Fix ODR violations
Detected by compiling with GCC flags `-flto -Wodr`.
2021-09-20 15:04:51 +12:00
Ian Lance Taylor
45ebd33698 swig -go: improve _cgo_panic implementation 2021-09-16 10:29:48 -07:00
Ian Lance Taylor
6ca5d5d722 swig -go: don't use crosscall2 for panicking
Instead rely only on documented and exported interfaces.
2021-09-15 17:56:01 -07:00
Ian Lance Taylor
4461c443cf remove Go -no-cgo option
It only worked for Go versions before 1.5, which is more than five
years ago and long-unsupported.
2021-09-14 13:59:21 -07:00
Vadim Zeitlin
6e471512b8 Merge branch 'GHA'
Add CI GitHub Actions workflow.

See #2062.
2021-08-09 13:21:13 +02:00
Vadim Zeitlin
d022a1507a Rename workflow file to just ci.yml
It doesn't seem appropriate to use test.yml for it.
2021-08-09 13:20:40 +02:00
Vadim Zeitlin
4e599ddbdb Remove "GHA" branch from the workflow file
Follow an existing comment saying that it should be removed before
merging.
2021-08-09 13:17:57 +02:00
Kris Thielemans
9d50ec97d0 [GHA] enable GHA branch for the moment
[appveyor skip]
[travis skip]
2021-08-02 12:12:57 +01:00
Kris Thielemans
0e45679aa7 [GHA] only run on master and PRs 2021-08-02 12:02:53 +01:00
Kris Thielemans
fb09a5578a [GHA] convert matrix to use include 2021-08-02 10:57:20 +01:00
Kris Thielemans
b734d67dd3 [GHA] first GitHub actions workflow 2021-08-02 09:51:46 +01:00
Kris Thielemans
333e2daa13 [CI] change python install 2021-08-02 09:44:21 +01:00
Kris Thielemans
901f399f8c [CI] generalise travis-linux-install.sh
- move content to CI-linux-install.sh which is independent of Travis
- create equivalent for Github Actions (GHA)
2021-08-01 22:28:00 +01:00
Olly Betts
a2fc5ecaff Fix "dobule" typos in docs
Fixes #2043.
2021-07-06 10:56:48 +12:00
Olly Betts
17a294cec4 Replace remaining PHP errors with PHP exceptions
`SWIG_ErrorCode()`, `SWIG_ErrorMsg()`, `SWIG_FAIL()` and `goto thrown;`
are no longer supported (these are really all internal implementation
details and none are documented aside from brief mentions in CHANGES
for the first three).  I wasn't able to find any uses at least in FOSS
code via code search tools.

If you are using these:

Use `SWIG_PHP_Error(code,msg);` instead of `SWIG_ErrorCode(code);
SWIG_ErrorMsg(msg);` (which will throw a PHP exception in SWIG >= 4.1
and do the same as the individual calls in older SWIG).

`SWIG_FAIL();` and `goto thrown;` can typically be replaced with
`SWIG_fail;`.  This will probably also work with older SWIG, but
please test with your wrappers if this is important to you.

Fixes #2014
2021-05-26 09:39:43 +12:00
Olly Betts
cdc69f9843 php: Throw exceptions instead of using errors
Parameter type errors and some other cases in SWIG-generated wrappers
now throw a PHP exception, which is how PHP's native parameter handling
deals with similar situations.

See #2014, but not closing yet as there may be more cases to convert.
2021-05-25 16:42:12 +12:00
Olly Betts
8fb25b6a38 php: SWIG_exception now maps code to exception class
This now determines the class of the exception object where a
suitable pre-defined PHP exception class exists - for example,
SWIG_TypeError -> PHP exception class TypeError.

Exception codes which don't naturally map to a pre-defined PHP
exception class are thrown as PHP class Exception (like all
PHP exceptions raised by SWIG_exception were before this change.)
2021-05-25 16:33:01 +12:00
Olly Betts
3c168ef332 Map known PHP interfaces to zend_class_entry*
Most pre-defined interfaces are accessible via zend_class_entry*
variables declared in the PHP C API - we can use these to add
an interface at MINIT time (rather than having to wait until RINIT to
look up by name) by having a mapping from PHP interface name to them.

This will also be a little faster than looking up by name.

Closes #2013
2021-05-25 16:28:44 +12:00
William S Fulton
e82725b22e
Merge pull request #2019 from adr26/memleak
[Python] Fix memory leaks.
2021-05-20 20:55:39 +01:00
Andrew Rogers
448e8d57bd Further leak fixes 2021-05-18 13:07:48 +01:00
Andrew Rogers
16123466f4 Update tests for failing Python API calls to all use '!= 0' 2021-05-18 13:05:51 +01:00
Andrew Rogers
4f453e0cde Tidy up handling of OOM exceptions - Py*_New will call PyErr_NoMemory() internally, so there is no need to call it again here, just correctly handle the NULL return value 2021-05-17 22:50:52 +01:00
Andrew Rogers
04a0b526eb Merge remote-tracking branch 'upstream/master' into memleak
# Conflicts:
#	CHANGES.current
2021-05-17 22:44:56 +01:00
Olly Betts
02ae5168d7 Remove details of long-removed directories
These were removed a decade or two ago!
2021-05-16 08:42:39 +12:00
Olly Betts
a54d62b22e [UFFI] Remove code for Common Lisp UFFI
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
b7a99f22f5 [S-EXP] Remove code for Common Lisp S-Exp
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
11bb422bd3 [Pike] Remove code for Pike
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
12f3a85916 [Modula3] Remove code for Modula3
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
f3ba54c3bb [CLISP] Remove code for GNU Common Lisp
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Olly Betts
5f38f9cc78 [Chicken] Remove code for Chicken
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-16 08:42:39 +12:00
Andrew Rogers
84ff84f4fb [Python] Fix memory leaks. 2021-05-12 23:42:32 +01:00
Olly Betts
3f78ea64c0 Remove bogus reference to allegrocl:old-sym:name
It'll never be set under -cffi.  Looking at the history it looks like
this is just a remnant from this file being originally created by
copying allegrocl.cxx.
2021-05-13 10:41:01 +12:00
Olly Betts
353baebfcf [Allegrocl] Remove code for Allegro Common Lisp
We dropped support for it in SWIG 4.0.0 and nobody has stepped forward
to revive it in over 2 years.

See #2009.
2021-05-13 10:38:40 +12:00
Olly Betts
b671a37e89 [php] Fix reserved class names TRUE, FALSE, NULL
PHPCN(x) does a string compare of x with the lower-cased class name,
so x needs to be in lowercase or else the entry has no effect.  The
entries for TRUE, FALSE and NULL weren't working as a result.
2021-05-12 16:45:42 +12:00
Olly Betts
853c511057 [php] Update keyword list
Add some missing entries, remove some long obsolete entries (from
the "ming" extension for generating SWF files, which was split
out from PHP core in 2008), and entry for "static" as a reserved class
name (`static::` is used for late static bindings, but attempting to
name a PHP class `static` fails because `static` is a keyword and we
also list it as such).
2021-05-12 16:43:32 +12:00
Olly Betts
8dadbcc744 [php] Simplify naming of overloaded method wrappers
The underlying wrapper function is now always named using
ZEND_NAMED_FUNCTION even if it's a method (in PHP a function and
a method only differ in how they're used).
2021-05-12 15:05:09 +12:00
Olly Betts
ead90be779 [php] Fix -prefix when there are subclasses
The calls to the parent class' magic __get, __set and __isset methods
weren't getting the prefix.
2021-05-12 15:04:31 +12:00