116 Commits

Author SHA1 Message Date
4f946ea436 perlmod-macro: bump version to 0.10.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-05-30 19:03:06 +02:00
dd53b575ac macro: use quote_spanned to point to the function everywhere
(Except for the original function expansion itself.)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-05-15 11:52:10 +02:00
a50b4b6af8 macro: add ability to warn about non-public exports
This is meant to be used in combination with `#[deny(missing_docs)]`
to force writing documentation for perl-accessible functions.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-05-15 11:45:09 +02:00
14200eeed0 bump perlmod-macro to 0.9.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-04-30 12:15:13 +02:00
d09b21c1eb macro: document the bootstrap function
(So that perlmod based packages may still be built with
deny(missing_docs).)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-04-30 12:10:39 +02:00
d34865bc55 bump perlmod-macro to 0.9.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-04-03 15:16:54 +02:00
d4dd49a2a3 macro: use alternate error representation for context
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-04-01 11:45:01 +02:00
0a6b18f4b1 update to edition 2024
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-03-17 11:04:08 +01:00
d7a1add485 macro: wrap xs calls in std::panic::catch_unwind
This causes panics to "croak" in perl, rather than aborting the entire
process.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-03-17 10:26:48 +01:00
3420df88a8 bump perlmod-macro to 0.9.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-16 13:38:18 +01:00
057f71a473 macro: create .notes.perlmod.package section in libraries
So all the macro-supported packages can be listed in the ELF file.
This way all the available packages in a library can be viewed with
`readelf -W -n libfoo.so`. In the future we can also embed metadata in
there.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2025-01-16 10:45:13 +01:00
1adcd9727e clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-30 15:46:55 +02:00
5e2a30e18c cargo fmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-30 15:42:33 +02:00
c2c6d6572b macro: comment out unused field
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-30 15:42:27 +02:00
1624184105 perlmod, macro: add add perlmod=multiplicity as expected lint
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-30 15:36:42 +02:00
754682961f macro: unraw() function names
so we can name an exported sub 'r#type'

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-03-14 13:46:13 +01:00
55418e22f6 bump perlmod-macro to 0.8.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-19 08:42:02 +01:00
95e8123f5b perlmod: search LD_LIBRARY_PATH before @INC/auto dirs
This is for the code generated for `#[package(write = true)]`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-12-19 08:38:41 +01:00
0d64d1093e perlmod-macro: bump to 0.8.3 2023-10-03 08:36:28 +02:00
cb86559d13 update to syn-2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-10-02 13:31:09 +02:00
b32c4fd40a bump perlmod to 0.13.3-1 and perlmod-macro to 0.8.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-26 09:59:42 +02:00
4600b0779f macro: move 'boot' call into the 'Once' section
This also means boot function call chains must not cause circular
dependencies at all without a way to mitigate this in code. If this
should ever be a problem, we can move it out again, but this should
rather not be necessary.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-26 09:58:01 +02:00
82b4d14ad3 macro: upgrade boot attribute to a full path
This is a lot more flexible than just a single ident.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-26 09:37:59 +02:00
e2d4ad4e96 macro: update docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-25 13:46:39 +02:00
1017735ad0 macro: add 'boot' attribute to packages
This is supposed to be a function executed after the 'boot' method has
finished registering the XS callbacks.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-25 13:40:43 +02:00
63fcccaa50 macro: allow calling boot fns with None as parameter
This allows using them from other modules for initialization.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-25 13:32:47 +02:00
b94cbb8f16 macro: ensure bootstrap functions happen only once
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-25 13:31:37 +02:00
5dbce0d3d3 bump perlmod to 0.13.2-1 and perlmod-macro to 0.8.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-10 10:18:11 +02:00
0339198faf use workspace package variables
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-10 10:17:51 +02:00
56bb74b196 add ability to set the errno value
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-02 14:43:47 +02:00
2aa0c70d0d macro: add serialize_error attribute
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-02 11:45:20 +02:00
f381c740b4 macro: fix syntax error in non-result tuple case
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-02 10:41:32 +02:00
4b3ab550d2 bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-04-25 10:00:15 +02:00
76f6a079eb clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-09 11:24:34 +01:00
f8b49fc1be clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-09-22 10:00:33 +02:00
02e4344e7e clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-08-01 10:41:11 +02:00
4d84aec490 clippy: don't explicitly drop args in generated code
While code seems to still compile, this was initially done
to explicitly get rid of potential borrows and doesn't seem
to be necessary anymore?

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-10 11:51:42 +02:00
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
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
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
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
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
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
8bb0c091bc cargo fmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-01-10 12:50:11 +01:00
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
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
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
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
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
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