mesonbuild / mesonbuild/meson

Multiple @BASENAME@ for configure_file() raising warning

Open
#4,532 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

I have this snippet of meson :

configure_file(
  input: 'intel_sanitize_gpu.in',
  output: '@BASENAME@',
  install_dir: get_option('bindir'),
  configuration: sanitize_data,
)

libintel_sanitize_gpu = shared_library(
  'intel_sanitize_gpu',
  files('intel_sanitize_gpu.c'),
  dependencies : [dep_dl, dep_thread],
  include_directories : [inc_common, inc_intel, inc_drm_uapi],
  link_with : [libintel_common, libmesa_util],
  c_args : [c_vis_args, no_override_init_args],
  install_dir: get_option('libexecdir'),
  install: true,
)

configure_file(
  input : 'intel_dump_gpu.in',
  output : '@BASENAME@',
  install_dir: get_option('bindir'),
  configuration: sanitize_data,
)

It's raising the following warning :

WARNING: Output file "src/intel/tools/@BASENAME@" for configure_file() at src/intel/tools/meson.build:67 overwrites configure_file() output at src/intel/tools/meson.build:49

(line 49 is first configure_file(), line 67 and the second one)

The resulting files are fine, it's just odd to raise a warning on a template that should be replaced.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two configure_file() calls from the issue in a meson.build file, then trace configure_file() output-name handling and the warning for duplicate outputs. Done means the @BASENAME@ placeholders resolve to distinct files without the spurious overwrite warning, while genuine duplicate outputs still warn.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.