On 7/26/24 11:41 AM, Sertonix wrote:
> > translate 'meson compile' into 'muon samu'. The --ninja-args and --clean> options are still missing but the common options work.
I oppose this patch.
The `meson compile` command should, generally, not be used. It
implements an incompatible interface to building your code, and
arguments valid for ninja/samurai are *invalid* for passing to `meson
compile` -- and vice versa.
It is not possible for you to implement a compatible interface unless
you do one of:
- unilaterally ban passing targets
- implement the entirety of meson's IDE json introspection tooling, then
use that to look up and cross-verify targets to build, remembering
that any targets which are created by the backend rather than defined
in meson.build (e.g. coverage targets) are fatal errors
Keep in mind that `meson compile` only exists to serve as a command
which is an alternative to ninja that also works for msbuild. If you
always use ninja anyways, simply run the relevant ninja commands and you
will have a compatible interface (ninja) that works with both meson and
muon already.
--
Eli Schwartz
> > translate 'meson compile' into 'muon samu'. The --ninja-args and --clean> > options are still missing but the common options work.>>> I oppose this patch.>> The `meson compile` command should, generally, not be used. It> implements an incompatible interface to building your code, and> arguments valid for ninja/samurai are *invalid* for passing to `meson> compile` -- and vice versa.
My goal was to test building alpine linux packages with muon without
requiring too many muon specific changes. Most alpine packages use `meson
compile` so with this compatibility a lot of packages build out of the box.
Do you consider `meson compile` also bad when no target is specified?
> It is not possible for you to implement a compatible interface unless> you do one of:>> - unilaterally ban passing targets> - implement the entirety of meson's IDE json introspection tooling, then> use that to look up and cross-verify targets to build, remembering> that any targets which are created by the backend rather than defined> in meson.build (e.g. coverage targets) are fatal errors
No alpine linux package needs targets with `meson compile` and I would
think that most common uses of `meson compile` don't need targets ether so
I would be fine with banning them.
> Keep in mind that `meson compile` only exists to serve as a command> which is an alternative to ninja that also works for msbuild. If you> always use ninja anyways, simply run the relevant ninja commands and you> will have a compatible interface (ninja) that works with both meson and> muon already.
On 7/26/24 1:45 PM, Sertonix wrote:
>>> translate 'meson compile' into 'muon samu'. The --ninja-args and --clean>>> options are still missing but the common options work.>>>>>> I oppose this patch.>>>> The `meson compile` command should, generally, not be used. It>> implements an incompatible interface to building your code, and>> arguments valid for ninja/samurai are *invalid* for passing to `meson>> compile` -- and vice versa.> > My goal was to test building alpine linux packages with muon without> requiring too many muon specific changes. Most alpine packages use `meson> compile` so with this compatibility a lot of packages build out of the box.> > Do you consider `meson compile` also bad when no target is specified?
`meson compile` starts off by loading a few hundred *.py files from disk
into memory, compiling them to bytecode on demand, and importing them as
code objects.
When no arguments are passed to it, it then immediately forks and
executes `ninja` with no arguments. When arguments are passed to it, it
preprocesses those arguments, builds the list of arguments to pass to
`ninja`, and then... forks and executes ninja.
If you are not passing arguments to `meson compile` then there is no
reason you cannot simply, unconditionally, in all cases without exception:
```
find . -name APKBUILD -exec sed -i "s/meson compile/ninja/" {} +
```
If the only arguments being passed are -C -j -l -v, then the same still
applies.
If you tell me there are real life cases of people using --ninja-args I
may politely laugh really hard. :) I describe my reasoning at
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66011abd663671947fe07835f0d9cc360f5de317
--
Eli Schwartz
> >>> translate 'meson compile' into 'muon samu'. The --ninja-args and --clean> >>> options are still missing but the common options work.> >>> >>> >> I oppose this patch.> >>> >> The `meson compile` command should, generally, not be used. It> >> implements an incompatible interface to building your code, and> >> arguments valid for ninja/samurai are *invalid* for passing to `meson> >> compile` -- and vice versa.> > > > My goal was to test building alpine linux packages with muon without> > requiring too many muon specific changes. Most alpine packages use `meson> > compile` so with this compatibility a lot of packages build out of the box.> > > > Do you consider `meson compile` also bad when no target is specified?>>> `meson compile` starts off by loading a few hundred *.py files from disk> into memory, compiling them to bytecode on demand, and importing them as> code objects.>> When no arguments are passed to it, it then immediately forks and> executes `ninja` with no arguments. When arguments are passed to it, it> preprocesses those arguments, builds the list of arguments to pass to> `ninja`, and then... forks and executes ninja.>>> If you are not passing arguments to `meson compile` then there is no> reason you cannot simply, unconditionally, in all cases without exception:>> ```> find . -name APKBUILD -exec sed -i "s/meson compile/ninja/" {} +> ```>> If the only arguments being passed are -C -j -l -v, then the same still> applies.>> If you tell me there are real life cases of people using --ninja-args I> may politely laugh really hard. :) I describe my reasoning at>> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66011abd663671947fe07835f0d9cc360f5de317
Thanks for the info! I will consider suggesting the removal of `meson
compile` for alpine packages. Regardless I still think providing very
basic `meson compile` compatibility would be benefitial. Especially
since muon doesn't have the problem of loading hundreds of python files.
Hey,
Sorry for not replying to this for quite awhile. I think it is okay for
muon to support `muon meson compile`, but I don't like the modification
of `muon samu`. I think `muon meson compile` should point to its own
subcommand, perhaps `muon internal meson-compile`, that simply calls
ninja.
Thanks,
Stone
> Hey,>> Sorry for not replying to this for quite awhile. I think it is okay for> muon to support `muon meson compile`, but I don't like the modification> of `muon samu`. I think `muon meson compile` should point to its own> subcommand, perhaps `muon internal meson-compile`, that simply calls> ninja.
Sounds reasonable. The change was a bit of a hack. Unfortunatly I currently
don't have time to change the patch. Feel free to change the patch if you
want. Otherwise I may finish it some day.
> Thanks,> Stone