Commit Graph

18 Commits

Author SHA1 Message Date
Ludovic Fernandez
1fe75f149d feat: update stdlib mapping for go1.15
- drop stdlib for go1.13
- generate stdlib for go1.15
-  update CI configuration.
2020-08-12 12:38:04 +02:00
mpl
e5a7b0de11 extract: new package to extract symbols from a dependency
cmd/goexports is now based on it.

Updates #639 

Co-authored-by: Marc Vertes <mvertes@free.fr>
2020-07-23 10:58:33 +02:00
Marc Vertes
b3766509cc feature: restrict symbols which can exit the interpreter process
* feature: restrict symbols which can exit the interpreter process

Some symbols such as os.Exit or log.Fatal, which make the current process
to exit, are now restricted. They are replaced by a version which panics
instead of exiting, as panics are recovered by Eval.

The restricted os.FindProcess version is identical to the original
except it errors when trying to return the self process, in order to
forbid killing or signaling the interpreter process from script.

The os/exec symbols are available only through unrestricted package.

The original symbols are stored in an unrestricted package, which
requires an explicit Use, as for unsafe and syscall packages.

The Use() interpreter method has been slightly modified to allow inplace
updating of package symbols, allowing to replace some symbols but not
the entire imported package.

A command line option -unrestricted has been added to yaegi CLI to use
the unrestricted symbols.

Fixes #486.

* fix: lint
2020-07-08 22:35:04 +02:00
Ludovic Fernandez
a6c24a0d13 chore: update linter. (#706)
* chore: update linter.

* chore: remove not needed travis env var.
2020-06-22 12:55:42 +02:00
Ludovic Fernandez
94e0b582ea Update stdlib for go1.14 2020-02-26 15:06:06 +01:00
Marc Vertes
bb04af2d4d doc: document import of source and binary packages (#477) 2020-01-08 18:51:30 +01:00
Ludovic Fernandez
1cf327bd7d Drop go1.11 2019-10-01 14:40:05 +02:00
Marc Vertes
cda23836f0 feature: additional binary packages in stdlib (#366)
Generate wrappers for the following packages:

- crypto/ed25519 (go1.13 only)
- debug/dwarf
- debug/elf
- debug/gosym
- debug/pe
- debug/plan9obj
- net/http/pprof
- runtime/pprof
- runtime/trace
2019-09-16 14:06:11 +02:00
Ludovic Fernandez
bfa9a267be Update stdlib for go1.13 (#351)
* chore: generate stdlib for go1.13

* chore: update CI configuration.

* fix: struct13 test is too dependent of the Go implementation.

* fix: disable test import4.go
2019-09-09 09:59:26 +02:00
Ludovic Fernandez
ee81ee7fea interp/build: improve Go version handling. 2019-07-30 14:34:04 -07:00
Marc Vertes
3528b4539d feature: set default GOPATH for command line and allow self interpreting (#240) 2019-07-09 16:57:29 +02:00
Marc Vertes
274c0fc47a chore: API and code cleanup. Rename stdlib.Value into stdlib.Symbols (#231) 2019-06-27 12:40:04 +02:00
Marc Vertes
85c11a9ec6 feature: isolate stdlib "unsafe" package (#228) 2019-06-18 12:00:32 +02:00
Marc Vertes
eb705baa01 fix: implement a single interface wrapper for error type (#190) 2019-05-21 16:49:26 +02:00
Marc Vertes
547b1afb8d feat(goexports): support multi os / arch, generate syscalls for all platforms (#6) 2019-01-11 17:41:26 +01:00
Marc Vertes
86b2ffedcd stdlib: add syscall package 2018-12-26 15:46:42 -05:00
Marc Vertes
6a397e2294 Fix golint warnings 2018-12-07 17:37:58 +01:00
Marc Vertes
25adc35a3c Change representation of stdlib from interface{} to reflect.Value
This fixes problems due to storing binary symbols as interfaces{}
instead of concrete type, which confuses lookup functions to retrieve
methods etc. in reflect.
2018-08-28 03:12:28 +02:00