Commit Graph

199 Commits

Author SHA1 Message Date
Wolfgang Bumiller
218a1daf26 test: write modules at build time
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-29 10:55:41 +02:00
Wolfgang Bumiller
40d6ec96ea bump perlmod to 0.13.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-25 15:47:13 +01:00
Wolfgang Bumiller
cac2982a8b perlmod: expose ser::is_active
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-25 15:45:15 +01:00
Wolfgang Bumiller
f605d7cf0c bump perlmod to 0.13.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-04 09:03:48 +01:00
Wolfgang Bumiller
cd69debd78 fix utf8 support in substr_from_str_slice
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-02 13:47:03 +01:00
Wolfgang Bumiller
c9ec592f3e drop Result from substr_from_str_slice
and add `merge_str_slice` helper

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-02 12:46:48 +01:00
Wolfgang Bumiller
b61c34e6a7 bump perlmod to 0.12.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-01 15:17:24 +01:00
Wolfgang Bumiller
ff419b1922 allow string suffixes in substr_from_str_slice
the range check failed if the substr was a suffix due to the
range being exclusive on the end and end being the byte
after the last one

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-01 15:11:43 +01:00
Wolfgang Bumiller
73c3149eaa bump perlmod to 0.12.1-1
while this is technically an API break this is new and
not-yet used and we're in the 0.x versions after all...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-01 14:43:01 +01:00
Wolfgang Bumiller
24ca477715 move substr_from_str_slice from ScalarRef to Scalar
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-01 14:41:27 +01:00
Wolfgang Bumiller
67c90f2d75 bump perlmod to 0.12.0-1 and perlmod-macro to 0.8.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-28 11:09:07 +01:00
Wolfgang Bumiller
68bc1c626f update readme
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-28 11:09:07 +01:00
Wolfgang Bumiller
c15e1e1456 macro: add a write attribute to packages
the .pm file now gets written if either 'write=true' or
'file' is set, setting just 'lib' won't trigger a write
anymore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-25 15:45:56 +01:00
Wolfgang Bumiller
08c14b8fc5 macro: rename boot symbol to boot_<module>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-24 11:44:03 +01:00
Wolfgang Bumiller
daf4841996 macro: only write package files if requested
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-24 11:44:03 +01:00
Wolfgang Bumiller
a51cd47f9e macro: drop span hack from error handling
copying the input doesn't seem to be required anymore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-24 11:43:42 +01:00
Wolfgang Bumiller
cf751e2164 experimental access to defstash
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-24 11:43:42 +01:00
Wolfgang Bumiller
a43bf932c7 experimental direct substr support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-24 11:43:33 +01:00
Wolfgang Bumiller
de0edd74e3 fix 'cv' type in test
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-22 12:50:45 +01:00
Wolfgang Bumiller
a87395e67f doc updates
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-03 09:41:19 +01:00
Wolfgang Bumiller
cd52146822 bump perlmod & macro to 0.11.0-1 and 0.7.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-25 09:36:20 +01:00
Wolfgang Bumiller
481aa2fa5e doc fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-13 14:42:56 +01:00
Wolfgang Bumiller
8bb0c091bc cargo fmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-10 12:50:11 +01:00
Wolfgang Bumiller
2d5855cc5e rustfmt.toml: edition 2021
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-10 12:49:49 +01:00
Wolfgang Bumiller
2812f550d9 macro: pass 'cv' as Value
to reduce the amount of required unsafe blocks

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-07 15:59:33 +01:00
Wolfgang Bumiller
c25b213cc5 macro: use raw pointer for CV parameter
so generated xsubs are actually compatible with
Value::new_xsub

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-07 15:54:50 +01:00
Wolfgang Bumiller
e5c95f0414 macro: fix multiplicity parameter type
use ffi::Interpreter, same as what perlmod does via the
perl_fn macro

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-07 15:51:33 +01:00
Wolfgang Bumiller
fb27e167ba doc updates
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-07 09:12:00 +01:00
Wolfgang Bumiller
77171723e3 macro: expose the 'cv' as parameter on exports
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-07 09:12:00 +01:00
Wolfgang Bumiller
c7882155cf cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-07 09:11:41 +01:00
Wolfgang Bumiller
ebd82cb7ac perlmod: ffi: support visibility in perl_fn
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-04 09:55:53 +01:00
Wolfgang Bumiller
9bf583ca64 macro: export: copy use chosen visibility
when using the export macro directly without a package we
previously always used
    #[no_mangle]
    pub extern "C"
now instead of 'pub' we copy the original function's
visibility

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-23 10:40:59 +01:00
Wolfgang Bumiller
100414d678 macro: fixup export visibility
commi 5491907876 was incomplete, this fixes up the
remaining 2 cases

Fixes: 5491907876 ("don't export xs wrappers from modules")
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-23 10:40:59 +01:00
Wolfgang Bumiller
577f68753f perlmod: doc fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-23 10:40:59 +01:00
Wolfgang Bumiller
3e1adbd039 bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-17 14:24:44 +01:00
Wolfgang Bumiller
44c4c44b4e bump perlmod to 0.10.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-17 09:22:58 +01:00
Wolfgang Bumiller
c0afdc3a97 perlmod: deny unsafe_op_in_unsafe_fn
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-17 09:20:58 +01:00
Wolfgang Bumiller
25d21384ae perlmod: add Value::new_xsub as an unsafe fn
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-17 09:17:09 +01:00
Wolfgang Bumiller
af31038b48 perlmod: perl_fn for fn types w/o body
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-17 09:16:53 +01:00
Wolfgang Bumiller
f8b00d2b6b fixup RSPL_newXS_flags to return the CV
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-16 14:57:03 +01:00
Wolfgang Bumiller
020bb8f6d9 doc updates
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-16 14:06:31 +01:00
Wolfgang Bumiller
e5a46a38ef clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-15 10:45:15 +01:00
Wolfgang Bumiller
86f538fe3f bump perlmod to 0.10.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-14 13:53:54 +01:00
Wolfgang Bumiller
d17087df54 perlmod: introduce MagicValue
It turns out that using `const` for the `MagicSpec` can lead
to multiple instances of it and the `TryFrom` accessing a
different vtable address than the instantiating functions.

This particularly happened when using `declare_magic!`
directly for a `Box<T>` where `T` is not declared in the
same module and is `!Sync`.

Instead, `declare_magic!()` now creates `static`s,
`MagicSpec` loses the associated value so we can safely
force it to be `Send + Sync`, and `MagicValue` is introduced
as the result of the `.with_value()` method call.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-14 13:33:07 +01:00
Wolfgang Bumiller
7922272173 perlmod: actually use provided magic var
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-14 13:27:40 +01:00
Wolfgang Bumiller
8c587b3bf3 doc fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-14 12:13:28 +01:00
Wolfgang Bumiller
e68855945d drop imports already in 2021 prelude
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-01 14:13:44 +01:00
Wolfgang Bumiller
381751a4e8 upgrade to edition 2021
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-01 13:48:40 +01:00
Wolfgang Bumiller
b44db4281d bump perlmod to 0.9.0 and perlmod-macro to 0.6.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-26 14:05:44 +01:00
Wolfgang Bumiller
b78b6ceb94 documentation update
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-25 10:24:10 +01:00