143 Commits

Author SHA1 Message Date
Stone Tickle
70fcd6a526
add meson.project() for modules to get proj info 2024-01-08 11:20:58 -05:00
Stone Tickle
769f0d508a
improve function typechecking function analysis
Functions are now analyzed when they are defined so they aren't
erroneously marked as dead code.  This led to some weird typechecking
issues that ended up pushing me to clean up some of the typechecking
code.
2023-12-30 14:20:16 -05:00
Stone Tickle
acd88ddf23
add dict delete 2023-11-30 13:12:20 -05:00
Stone Tickle
9cb9d858c9
lots of small changes
- wip "unencapsulated" module.  This just means that the module is
  loaded into the global scope.  You could then write functions like
  `vcs_tag` in this global module to be used by all meson files.  This
  might be removed.
- remove export() function and instead use a lua-like return to export
  from the module.
- track language mode in function definitions.  Necessary for functions
  to use internal-only functions.
- use assigned function name in error messages
- fix embedded source reopening in error messages
- reduce number of node types that get marked as dead code
- create true/false bools on workspace initialization with known ids.
  Future code should use these rather than making new boolean objects to
  save memory.
- add a new test script-module
2023-11-27 12:45:53 -05:00
Stone Tickle
0deb94b745
add extended lang mode 2023-11-19 20:37:31 -05:00
Stone Tickle
46c544692a
rename func_impl_name to func_impl 2023-11-19 13:41:32 -05:00
Stone Tickle
5e1c455cbc
more progress 2023-11-17 22:39:51 -05:00
Stone Tickle
4a0272972e
more flexible functions 2023-11-15 21:54:30 -05:00
Seedo Paul
b173a8a25e
mod/python: fix method lookup tables
`python_installation` is an `external_program` and not the module
`python`.
2023-10-29 08:05:19 -04:00
Stone Tickle
6416305a94
reformat and fix issues with python module changes
- fix python3.find_python return type
- fix missing interp_args for language_version()
- add missing run_cmd_ctx_destroy
2023-10-19 22:34:37 -04:00
Filipe Laíns
50ce7d9053
object: add python_installation
python_installation is an external_program with a couple of extra
methods related to the Python installation. Right now, we only add the
type.

Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Seedo Paul <seedoeldhopaul@gmail.com>
2023-10-19 22:33:54 -04:00
Stone Tickle
074f34e91c
support cmd_array for external_program
This will be required for find_program('meson') to return an external
program with the command ['muon', 'meson'].  It also allows muon to
return ['muon', 'samu'] as the result for find_program('ninja'), which
is kind of neat.
2023-10-09 10:04:57 -04:00
Stone Tickle
94802dcfba
add warning if subdir is not analyzed 2023-02-22 14:12:06 -05:00
Vincent Torri
8d6f6b97a9
machine.c: fix typo : 'cgywin' changed to cygwin 2023-01-21 11:27:22 -05:00
Stone Tickle
4df1837cb3
expose an api for getting system information 2023-01-14 21:10:02 -05:00
Stone Tickle
8c6e67b27a
guess external program version when we need it 2023-01-14 21:10:00 -05:00
Stone Tickle
85e1916731
optimize foreach range()
If foreach is passed a bare range() as its iterable, we can avoid
creating an intermediate array.  Meson already does this from what I can
tell.
2022-10-30 07:45:08 -04:00
Stone Tickle
4298aa2011
make muon reuse compliant
https://reuse.software
2022-10-25 10:54:31 -04:00
Stone Tickle
e497b76bfe
add dump_signatures subcommand
This subcommand dumps type information for all recognized functions and
methods, including module functions.
2022-09-22 20:58:57 -04:00
Stone Tickle
2ef9e622ec
add -s: disable unsafe option to internal eval
This flag is designed to be used when invoking muon with a generative
fuzzer, such as afl.
2022-09-17 16:51:52 -04:00
Stone Tickle
ff3f56e5e5
stub all sourceset module functions 2022-09-16 20:18:38 -04:00
Stone Tickle
6a5534b62f
[wip] change type_tag type to 64 bits
This gives us 32 extra potential object types to be able to typecheck.
Unfortunately with c99 we can't control the width of enum types, so we
have to switch to #defines.
2022-09-16 20:18:37 -04:00
Stone Tickle
93b657d750
stub sourceset module 2022-09-16 20:18:36 -04:00
Stone Tickle
905f411d16
implement keyval module 2022-09-12 14:11:22 -04:00
Stone Tickle
b6afb1f3ec
transition path_join functions to use sbufs 2022-09-05 06:50:39 -05:00
Stone Tickle
05e699eaf4
port the lone path unit test to a lang test
This allows us to remove the unit test directory, and removes one of the
consumers of path.c.  Some of these functions may also be useful for
internal scripts.
2022-09-05 06:50:38 -05:00
Stone Tickle
664760ea4f
install refactor
- separate install functionality to install.c and
  functions/kernel/install.c
- remove specialized install functions that are only used in 1 place
- implement preserve_path for push_install_targets
2022-08-12 08:01:05 -05:00
Stone Tickle
3955d14528
fix env.append/prepend
The initial env implementation assumed that append/prepend only worked
on values that were previously set in the environment() object.  In
reality, these are supposed to apply to the current environment if
the key has not been env.set() previously.
2022-08-04 07:42:05 -05:00
Stone Tickle
6c502b961e
add obj_array_del() function
This is exposed internally as array.delete() for testing purposes only
2022-08-01 10:41:55 -05:00
Stone Tickle
d89e8691d1
fix kernel internal impl_tbl name 2022-08-01 10:05:40 -05:00
Stone Tickle
8f2c011c1d
add error handling to dep_process_link_with/whole 2022-07-13 15:25:56 -05:00
Stone Tickle
b24171e574
stub unimplemented modules
Allow import('xxx'[, required: true]) to succeed, but do a few things to
make it a little nicer:

- the name of the module is validated, so random strings aren't accepted
- if you do required: false, you just get a normal not-found module
- if required is true, then you get a warning when you import() the
  module, and a fatal error if you try to use it
  - the error message tells you how you can use required: false to make
    your build work with muon.
2022-07-11 08:37:06 -05:00
Stone Tickle
46cdd65aa6
make build_target_extract_objects static 2022-07-07 14:23:52 -05:00
Stone Tickle
6307394066
allow both_libs to reuse build_tgt functions 2022-07-07 14:20:06 -05:00
Stone Tickle
1799441ecf
support generated_list preserve_path_from: 2022-06-30 17:44:32 -05:00
Stone Tickle
9bc45128d3
rename functions/default to functions/kernel 2022-06-24 18:45:46 -05:00
Stone Tickle
672fa7bd58
optimize dependency handling
The main optimization is to dedup most of the dependency arrays.  This
drastically improves performance for some projects that like to use deep
nests of dependency objects.
2022-06-21 15:01:50 -05:00
Stone Tickle
1421c35d1a
replace obj_external_library with obj_dependency 2022-06-12 15:18:59 -05:00
Stone Tickle
cb1343486e
dependency refactor
Calculate dependency information ahead of time, rather than on-demand.
Also unify how dependency information is stored between build targets
and dependencies by using a common sub-struct "build_dep".
2022-06-12 15:18:55 -05:00
Stone Tickle
7d4a59cd0e
move tgt object sources handling out of backend 2022-06-05 14:58:05 -05:00
Stone Tickle
8f9ff8371e
remove muon auto
The same sort of functionality can be achieved by using machine files,
once they are implemented.  Build system regeneration has also been made
simpler, and just invokes setup with the original command line directly
2022-05-31 20:30:09 -05:00
Stone Tickle
26e032a59f
extract custom target helper func args to structs
The number of arguments was becoming unwieldy, especially since all
integer types are silently casted to each other in c :(
2022-05-23 19:22:19 -05:00
Stone Tickle
0e9736d549
options refactor
- support deprecated options
- add a precedence system for options
- restrict per-subproject options
2022-05-13 17:23:30 -05:00
Stone Tickle
1adb15d24b
remove todo() stub function
the "function x not found" error message is more useful
2022-04-18 19:56:47 -05:00
Stone Tickle
26e1101923
improve pure function handling / var assignment 2022-04-18 10:27:44 -05:00
Stone Tickle
7eeb327f1f
call pure functions with known arguments 2022-04-18 10:27:43 -05:00
Stone Tickle
464abe831a
annotate return type of all functions 2022-04-18 10:27:38 -05:00
illiliti
9ead504555
allow reusing build_target_extract_objects 2022-04-18 10:16:38 -05:00
Stone Tickle
2cc3d4c5e5
implement descriptive type annotations 2022-04-03 19:23:54 -05:00
Stone Tickle
3f3e7ccc27
add {custom_target,file}_is_linkable functions 2022-04-01 10:54:28 -05:00