Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.57.2] run_target with a missing quoted command started requiring the binary to exists #8641

Open
keszybz opened this issue Apr 12, 2021 · 6 comments

Comments

@keszybz
Copy link
Contributor

keszybz commented Apr 12, 2021

Describe the bug
A clear and concise description of what the bug is.

We have the following code in systemd:

run_target(
        'doc-sync',
        depends : man_pages + html_pages,
        command : ['rsync', '-rlv', ...])

This target is only used when manually invoked. So far, the presence of rsync was not probed, so it was OK if rsync was not installed (until the target was executed). This changed in 0.57.2 (0.57.1 was still OK). So for example CI builds started failing. Please consider reverting the change, it doesn't seem to be something suitable for a point release.

project('a', 'c',
        version : '0')

run_target('run-foobar',
           command : ['foobar', '!'])

With meson-0.57.2-1.fc35.noarch, this fails.

@keszybz
Copy link
Contributor Author

keszybz commented Apr 12, 2021

Oh, this has another impact:

run_target(
        'fuzzers',
        depends : fuzzer_exes,
        command : ['true'])

(The "true" is a placeholder, required because run_target requires a command to be specified.)

This now started printing:

Program true found: YES (/usr/bin/true)

keszybz added a commit to keszybz/systemd that referenced this issue Apr 12, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
keszybz added a commit to keszybz/systemd that referenced this issue Apr 12, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
keszybz added a commit to keszybz/systemd that referenced this issue Apr 12, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
@xclaesse
Copy link
Member

This is probably caused by #8526.

I think it's the right thing to do, but I agree it probably should not be in a point release. That change was needed to fix another bug, and we probably overlooked the fact that the program was not required before.

If your target is optional, do something like:

rsync = find_program('rsync', required: false)
if rsync.found()
  run_target(..., command: [rsync, ...])
endif

@keszybz
Copy link
Contributor Author

keszybz commented Apr 12, 2021

rsync = find_program('rsync', required: false)
if rsync.found()
  run_target(..., command: [rsync, ...])
endif

Yep, systemd/systemd#19297 does exactly this.

keszybz added a commit to keszybz/systemd that referenced this issue Apr 12, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
@eli-schwartz
Copy link
Member

find_program() supports disabler: true

@keszybz
Copy link
Contributor Author

keszybz commented Apr 12, 2021

find_program() supports disabler: true

Oh, you mean that we could do

rsync = find_program('rsync', required: false)
run_target(..., command: [rsync, ...])

In systemd we still support meson-0.46 sadly…

@eli-schwartz
Copy link
Member

Oh well, leave it as a # TODO. :)

bluca pushed a commit to systemd/systemd that referenced this issue Apr 12, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
keszybz added a commit to systemd/systemd-stable that referenced this issue May 6, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)
keszybz added a commit to systemd/systemd-stable that referenced this issue May 15, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)
(cherry picked from commit f6435a0)
keszybz added a commit to systemd/systemd-stable that referenced this issue May 15, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)
(cherry picked from commit f6435a0)
(cherry picked from commit f4a1812)
insilications pushed a commit to insilications/systemd-248 that referenced this issue Jun 9, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
insilications pushed a commit to insilications/systemd-248 that referenced this issue Jun 9, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
mrc0mmand pushed a commit to mrc0mmand/rhel-9 that referenced this issue Jul 2, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
mrc0mmand pushed a commit to mrc0mmand/rhel-9 that referenced this issue Jul 2, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
systemd-rhel-bot pushed a commit to redhat-plumbers/systemd-rhel8 that referenced this issue Nov 24, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)

Related: #2017033
dtardon pushed a commit to dtardon/systemd-rhel8 that referenced this issue Dec 9, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)

Related: #2030027
systemd-rhel-bot pushed a commit to redhat-plumbers/systemd-rhel8 that referenced this issue Dec 10, 2021
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)

Related: #2030027
kolyshkin pushed a commit to kolyshkin/systemd-rhel8 that referenced this issue Jan 10, 2022
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
jamacku pushed a commit to kolyshkin/systemd-rhel8 that referenced this issue Jan 11, 2022
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)

Related: #2039326

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
systemd-rhel-bot pushed a commit to redhat-plumbers/systemd-rhel8 that referenced this issue Jan 12, 2022
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)

Related: #2039326

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Yamakuzure pushed a commit to elogind/elogind that referenced this issue Jan 31, 2022
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
dbnicholson pushed a commit to endlessm/systemd that referenced this issue Mar 2, 2022
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)
dbnicholson pushed a commit to endlessm/systemd that referenced this issue Mar 2, 2022
mesonbuild/meson#8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

(cherry picked from commit 7c5fd25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants