public inbox for [email protected]
help / color / mirror / Atom feedmeson html:alias vs. html:custom
5+ messages / 3 participants
[nested] [flat]
* meson html:alias vs. html:custom
@ 2026-04-14 08:08 Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Peter Eisentraut @ 2026-04-14 08:08 UTC (permalink / raw)
To: pgsql-hackers
When I run
meson compile -C build html
I get this error message:
INFO: autodetecting backend as ninja
ERROR: Can't invoke target `html`: ambiguous name. Add target type
and/or path:
- ./doc/src/sgml/html:custom
- ./doc/src/sgml/html:alias
If I follow that advice and run meson compile -C build html:alias or
html:custom, then it works.
The setup in doc/src/sgml/meson.build is
html = custom_target('html', ...)
alias_target('html', html)
If I remove the alias_target, then my original command works. What is
the purpose of this alias?
(The equivalent problem exists for "man".)
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: meson html:alias vs. html:custom
@ 2026-04-14 13:24 Nazir Bilal Yavuz <[email protected]>
parent: Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Nazir Bilal Yavuz @ 2026-04-14 13:24 UTC (permalink / raw)
To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
Hi,
On Tue, 14 Apr 2026 at 11:08, Peter Eisentraut <[email protected]> wrote:
>
> If I remove the alias_target, then my original command works. What is
> the purpose of this alias?
I think the main purpose was using these targets with the ninja
command like: 'ninja ${target}'. ninja command doesn't work when the
alias_target() is removed.
--
Regards,
Nazir Bilal Yavuz
Microsoft
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: meson html:alias vs. html:custom
@ 2026-04-16 06:26 Álvaro Herrera <[email protected]>
parent: Nazir Bilal Yavuz <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Álvaro Herrera @ 2026-04-16 06:26 UTC (permalink / raw)
To: Nazir Bilal Yavuz <[email protected]>; Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers
On 2026-04-14, Nazir Bilal Yavuz wrote:
> On Tue, 14 Apr 2026 at 11:08, Peter Eisentraut <[email protected]> wrote:
>>
>> If I remove the alias_target, then my original command works. What is
>> the purpose of this alias?
>
> I think the main purpose was using these targets with the ninja
> command like: 'ninja ${target}'. ninja command doesn't work when the
> alias_target() is removed.
I think this is kinda silly. I would rather rename the meson target (to, say, do_html) and make the alias reference that, so that both "meson compile html" and "ninja html" would use the alias.
--
Álvaro Herrera
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: meson html:alias vs. html:custom
@ 2026-04-16 07:46 Nazir Bilal Yavuz <[email protected]>
parent: Álvaro Herrera <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Nazir Bilal Yavuz @ 2026-04-16 07:46 UTC (permalink / raw)
To: Álvaro Herrera <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; pgsql-hackers
Hi,
On Thu, 16 Apr 2026 at 09:26, Álvaro Herrera <[email protected]> wrote:
>
> On 2026-04-14, Nazir Bilal Yavuz wrote:
>
> > On Tue, 14 Apr 2026 at 11:08, Peter Eisentraut <[email protected]> wrote:
> >>
> >> If I remove the alias_target, then my original command works. What is
> >> the purpose of this alias?
> >
> > I think the main purpose was using these targets with the ninja
> > command like: 'ninja ${target}'. ninja command doesn't work when the
> > alias_target() is removed.
>
> I think this is kinda silly. I would rather rename the meson target (to, say, do_html) and make the alias reference that, so that both "meson compile html" and "ninja html" would use the alias.
I agree with you. Here is a patch for fixing this problem with your
suggestion. I added the '-custom' suffix instead of the 'do_' prefix,
I think this makes it more concrete.
--
Regards,
Nazir Bilal Yavuz
Microsoft
Attachments:
[text/x-patch] v1-0001-meson-Differentiate-top-level-and-custom-targets.patch (2.4K, 2-v1-0001-meson-Differentiate-top-level-and-custom-targets.patch)
download | inline diff:
From afec829a66a9b8b528969d9744dba3112497da18 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz <[email protected]>
Date: Thu, 16 Apr 2026 09:58:53 +0300
Subject: [PATCH v1] meson: Differentiate top-level and custom targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We need to create top-level targets to run targets with the ninja
command like `ninja <target_name>`.
Some targets (man, html, ...) have the same target name on both
top-level and custom target. This creates a confusion for the meson
build:
$ meson compile -C build html
```
ERROR: Can't invoke target `html`: ambiguous name. Add target type
and/or path:
- ./doc/src/sgml/html:custom
- ./doc/src/sgml/html:alias
```
Solve that problem by adding '-custom' suffix to these problematic
targets' custom target names. Top-level targets can be called with both
meson and ninja now:
$ meson compile -C build html
$ ninja -C build html
Suggested-by: Álvaro Herrera <[email protected]>
Discussion: https://postgr.es/m/5508e572-79ae-4b20-84d0-010a66d077f2%40eisentraut.org
---
doc/src/sgml/meson.build | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build
index a1ae5c54ed6..8517d837b78 100644
--- a/doc/src/sgml/meson.build
+++ b/doc/src/sgml/meson.build
@@ -137,7 +137,7 @@ endif
# Full documentation as html, text
#
if docs_dep.found()
- html = custom_target('html',
+ html = custom_target('html-custom',
input: ['stylesheet.xsl', postgres_full_xml],
output: 'html',
depfile: 'html.d',
@@ -146,7 +146,7 @@ if docs_dep.found()
)
alldocs += html
- install_doc_html = custom_target('install-html',
+ install_doc_html = custom_target('install-html-custom',
output: 'install-html',
command: [
python, install_files, '--prefix', dir_prefix,
@@ -189,7 +189,7 @@ endif
#
if docs_dep.found()
# FIXME: implement / consider sqlmansectnum logic
- man = custom_target('man',
+ man = custom_target('man-custom',
input: ['stylesheet-man.xsl', postgres_full_xml],
output: ['man1', 'man3', 'man7'],
depfile: 'man.d',
@@ -198,7 +198,7 @@ if docs_dep.found()
)
alldocs += man
- install_doc_man = custom_target('install-man',
+ install_doc_man = custom_target('install-man-custom',
output: 'install-man',
input: man,
command: [
--
2.47.3
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: meson html:alias vs. html:custom
@ 2026-04-24 07:52 Peter Eisentraut <[email protected]>
parent: Nazir Bilal Yavuz <[email protected]>
0 siblings, 0 replies; 5+ messages in thread
From: Peter Eisentraut @ 2026-04-24 07:52 UTC (permalink / raw)
To: Nazir Bilal Yavuz <[email protected]>; Álvaro Herrera <[email protected]>; +Cc: pgsql-hackers
On 16.04.26 09:46, Nazir Bilal Yavuz wrote:
> Hi,
>
> On Thu, 16 Apr 2026 at 09:26, Álvaro Herrera <[email protected]> wrote:
>>
>> On 2026-04-14, Nazir Bilal Yavuz wrote:
>>
>>> On Tue, 14 Apr 2026 at 11:08, Peter Eisentraut <[email protected]> wrote:
>>>>
>>>> If I remove the alias_target, then my original command works. What is
>>>> the purpose of this alias?
>>>
>>> I think the main purpose was using these targets with the ninja
>>> command like: 'ninja ${target}'. ninja command doesn't work when the
>>> alias_target() is removed.
>>
>> I think this is kinda silly. I would rather rename the meson target (to, say, do_html) and make the alias reference that, so that both "meson compile html" and "ninja html" would use the alias.
>
> I agree with you. Here is a patch for fixing this problem with your
> suggestion. I added the '-custom' suffix instead of the 'do_' prefix,
> I think this makes it more concrete.
Committed, thanks.
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2026-04-24 07:52 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-14 08:08 meson html:alias vs. html:custom Peter Eisentraut <[email protected]>
2026-04-14 13:24 ` Nazir Bilal Yavuz <[email protected]>
2026-04-16 06:26 ` Álvaro Herrera <[email protected]>
2026-04-16 07:46 ` Nazir Bilal Yavuz <[email protected]>
2026-04-24 07:52 ` Peter Eisentraut <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox