21 Commits

Author SHA1 Message Date
Vincent Torri
6e2fdc5cbb
Windows: surround arguments with double quote 2023-02-28 10:13:06 -05:00
Stone Tickle
4298aa2011
make muon reuse compliant
https://reuse.software
2022-10-25 10:54:31 -04:00
Stone Tickle
c86d371268
introduce sbuf a general string buffer
There are lots of places in muon where we want to manipulate strings.
In some cases it is appropriate to use the make_str() + str_app()
method.  However, in other cases, it would be better to avoid
allocation.

The solution so far has been to write specialized buffer functions that
append a buffer and check that it doesn't overflow, etc., for every
different case.  Sometimes these buffers can grow with realloc,
sometimes they are static only.

sbuf is a sort of compromise.  It starts out with a stack allocated
static array that is somewhat small, and can be configured to overflow
into either an unmanaged allocation, or into the workspace string pool.

Some other nice features include a mode that transparently writes output
to a FILE * rather than a buffer, which means that there is no longer a
limit on the length obj_fprintf can output.

The plan is to change the signature of the path_ functions to use sbuf
rather than a buffer + length.  That means we can finally get away from
PATH_MAX everywhere.
2022-09-05 06:50:38 -05:00
Stone Tickle
25f356b9e9
fix empty element in argv/env attempt #2
I tried to fix this by ending the argstr in a triple NUL, but that has
an edge case when the last element of argv is empty.  This time fix it
more robustly by tracking argc separately.
2022-08-04 17:48:46 -05:00
Stone Tickle
e194a670a5
remove maximum envvar/argument limit for run_cmd 2022-04-07 09:37:31 -05:00
Stone Tickle
9f4e6e6373
add pkgconf escape function 2022-04-01 10:54:53 -05:00
Stone Tickle
56227ed81b
always coerce environment preemptively
This ensures that MESON_BUILD_ROOT and MESON_SOURCE_ROOT are always set
correctly.  It also simplifies env to envp, and makes more type errors
catchable during configure.
2022-03-11 06:49:36 -06:00
Stone Tickle
44584b52ea
try and fix all remaining uint32_t obj usages 2022-02-15 15:29:39 -06:00
dffdff2423
374b462abd
Rename arr_to_args_mode to arr_to_args_flags
Does the rename as discussed on the mailing list.
2022-01-25 20:43:40 -06:00
dffdff2423
4662b3157a
Add support for alias targets
* Added a object type 'obj_alias_type'
* Implemented the meson function alias_target()
* Added support for generating alias_targets
* Copied and modified the relevant test from meson

Currently because run targets are not implemented there are TODOs where
they should be handled.
2022-01-25 20:40:30 -06:00
Stone Tickle
7f646a6ef7
fix typechecking of arrays converted to cmd args 2021-12-14 20:33:11 -06:00
Stone Tickle
74e16659de
fix depfile quoting 2021-12-12 07:42:52 -06:00
Stone Tickle
407088498e
use shell and ninja escaping for command lines 2021-11-29 06:38:10 -06:00
Stone Tickle
b1fd4a82f3
fix up the constness of a bunch of vars 2021-09-30 12:35:42 -05:00
Stone Tickle
7fc00dbe28
begin cleaning up ninja output generator 2021-09-21 11:28:14 -05:00
Stone Tickle
2057422031
implement environment object 2021-09-15 11:30:54 -05:00
Stone Tickle
98e2b01a89
escape CUSTOM_TARGET command in build file 2021-09-12 13:05:59 -05:00
Stone Tickle
1cf062720b
add build_envp 2021-09-05 07:19:23 -05:00
Stone Tickle
1b941b9f37
don't apply shell escaping to build rule command
This is because ninja uses $ as a special character.  Ninja also uses $
as its escape character, so escaping it with \ just results in garbage
being added to the commandline.
2021-08-18 08:56:16 -05:00
Stone Tickle
f185f8b98a
construct escaped test argv in args.c 2021-08-15 08:46:28 -05:00
Stone Tickle
167f4eca89
consolidate argument array handling 2021-08-15 06:08:15 -05:00