question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding `env` to a custom_target causes unexpected side-effects (empty stdout)

See original GitHub issue

Describe the bug

Adding env to a custom_target causes unexpected side-effects (stdout is empty).

To Reproduce

meson.build:

project('test02')

custom_target('without-env',
  command: ['echo', 'hello meson (1)'],
  output: ['nothing01'],
  build_by_default: true,
)
custom_target('env',
  command: ['echo', 'hello meson (2)'],
  output: ['nothing02'],
  build_by_default: true,
  env: {'QUARK': 'STRANGE'},
)
$ meson setup _builddir && meson compile -C _builddir
The Meson build system
Version: 0.59.0
Source dir: /home/rusty-snake/test02
Build dir: /home/rusty-snake/test02/_builddir
Build type: native build
Project name: test02
Project version: undefined
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program echo found: YES (/usr/bin/echo)
Program echo found: YES (/usr/bin/echo)
Build targets in project: 2

Found ninja-1.10.2 at /usr/bin/ninja
ninja: Entering directory `_builddir'
[1/2] Generating without-env with a custom command
hello meson (1)
[2/2] Generating env with a custom command (wrapped by meson to set env)
$ 

Expected behavior

Adding env doesn’t have any other effects than setting a environment variable.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)? plain native
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) Fedora 34
  • what Python version are you using e.g. 3.8.0 3.9.6
  • what meson --version 0.59.0
  • what ninja --version if it’s a Ninja build 1.10.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
eli-schwartzcommented, Jan 13, 2022

GitHub autocompletion of issue numbers never fails to ruin everything by randomly inserting the wrong issue number into your message. Apparently I deleted the wrong set of digits this time.

1reaction
eli-schwartzcommented, Jan 13, 2022

Fixed by #9794 but no Fixes #9794 was added to the commit message of that PR, so github didn’t auto-linkify the issue and close it. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing empty environment variables to child processes ...
The behavior of process.env hasn't changed between v7.x and v8.x so I expect it's caused by something in npm.
Read more >
Why is my $_ENV empty? - Stack Overflow
When I set the variables_order back to EGPCS , $_ENV is no longer empty. 2. When you use SetEnv in your .htaccess ,...
Read more >
cmake-generator-expressions(7)
One possible way to generate debug messages is to add a custom target: add_custom_target(genexdebug COMMAND ${CMAKE_COMMAND} ...
Read more >
Env Variable Operators - yq - GitBook
These operators are used to handle environment variables usage in expressions and documents. While environment variables can, of course, be passed in via ......
Read more >
Jenkins Pipeline Environment Variables - The Definitive Guide
In this blog post, I will show you how you can work with Jenkins pipeline environment variables effectively. You will learn how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found