mesonbuild / mesonbuild/meson

configure_file can not replace variables after "\\"

Open
#13,697 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
confugre_file can not replace the @@ variables after \\ with meson 1.5.2.

To Reproduce

meson.build

project('test')

test_conf = configuration_data()
test_conf.set('A', 'str_a')
test_conf.set('B', 'str_b')

configure_file(input : 'test.h.in',
               output : 'test.h',
               configuration : test_conf)

test.h.in

const char *TEST_STR = "@A@\\\\@B@";

When you type meson setup build, meson 1.5.2 replaces only @A@.

const char *TEST_STR = "str_a\\@B@";

Expected behavior
test.h should be like this

const char *TEST_STR = "str_a\\str_b";

meson had the expected behavior at least three months ago (maybe 1.4.1)

system parameters

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

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 issue with the meson.build and test.h.in examples using Meson 1.5.2 on the reported native Windows setup. Trace configure_file substitution for @@ variables following escaped backslashes, then verify that both @A@ and @B@ are replaced and the output matches the expected C string.

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
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.