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.

TypeError: cannot deepcopy this pattern object

See original GitHub issue

Describe the bug With Meson 0.56 and the example below, I get a “TypeError: cannot deepcopy this pattern object” exception (the example in #7457 does not give an exception on this system with 0.56). If I rollback to 0.55 this example works as expected, but the example in #7457 throws the exception.

To Reproduce meson.build

project('cmake_dep_regression','cpp')
cmake = import('cmake')

xtensor_dep = dependency('xtensor',
    version: ['>=0.21.4', '<1.0.0'],
    fallback: ['xtensor', 'xtensor_dep'],
    include_type: 'system',
    method : 'pkg-config')
exe1 = executable('main_xt', ['main_xt.cpp'], dependencies: [xtensor_dep])

# xerces_dep = cmake.subproject('xerces-c').dependency('xerces-c').as_system('system')
# exe1 = executable('main_cm', ['main_cm.cpp'], dependencies: [xerces_dep])

main_xt.cpp

#include <iostream>
#include <xtensor/xarray.hpp>
#include <xtensor/xio.hpp>
#include <xtensor/xview.hpp>

int main(void) {
  xt::xarray<double> arr1
      {{1.0, 2.0, 3.0},
       {2.0, 5.0, 7.0},
       {2.0, 5.0, 7.0}};

  std::cout << arr1 << std::endl;
  
  return 0;
}

xtensor.wrap

[wrap-file]
directory=xtensor-0.21.5

source_url=https://github.com/xtensor-stack/xtensor/archive/0.21.5.zip
source_filename=xtensor-0.21.5.zip
source_hash=f08aca41dc89128524dec04c82b590d9e0f1e923311e82bab9f024c99e7bb73a

patch_url=https://github.com/kyonifer/meson-wraps/raw/master/zips/xtensor-0.21.5-patches-1.zip
patch_filename=xtensor-0.21.5-patches-1.zip
patch_hash=d935d94a6b80d5466114cb29e49c2a358f42d0a1edceaa91f1ff76833b6c03e2

xtl.wrap

[wrap-file]
directory=xtl-0.6.12

source_url=https://github.com/xtensor-stack/xtl/archive/0.6.12.zip
source_filename=xtl-0.6.12.zip
source_hash=4ad3204312f72bce52951fb69acd1cd09e7f20f52c7e3b684140a4484acb5597

patch_url=https://github.com/kyonifer/meson-wraps/raw/master/zips/xtl-0.6.12-patches-2.zip
patch_filename=xtl-0.6.12-patches-2.zip
patch_hash=a65faee12aec22dd07f640863a0cae1b5310ea804e5d87c4a5ed73ee357ba6e1

nlohmann_json.wrap

[wrap-file]
directory = json-3.5.0

source_url = https://github.com/nlohmann/json/archive/v3.5.0.zip
source_filename = nlohmann_json-3.5.0.zip
source_hash = a65127f2797487cf07fdf1caacdff56ba3197ff02095cf0fde5bb35e91c86980

patch_url=https://github.com/kyonifer/meson-wraps/raw/master/zips/nlohmann_json-3.5.0-patches-1.zip
patch_filename=nlohmann_json-3.5.0-patches-1.zip
patch_hash=6585b48ef5cbf133d9c689c0b3748cc0ecb7324260ce87b96cf00d09bb0a1cdd

Expected behavior successful build with both 0.55 and 0.56.

system parameters

Ubuntu 18.04.4 LTS Python 3.6.9 meson 0.55.0 (works) meson 0.56.0 (fails) ninja 1.8.2

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
borg323commented, Dec 2, 2020

I have posted a minimal test case in https://github.com/mesonbuild/meson/issues/7920

0reactions
drmoosecommented, Nov 30, 2020

It may be worth noting that this bug appears to be specific to Python 3.6. Newer Pythons don’t seem to reproduce it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: cannot deepcopy this pattern object - Stack Overflow
I now understand that I need to deepcopy this class, but now I run into "TypeError: cannot deepcopy this pattern object".
Read more >
Deepcopy error when trying to airflow clear - Google Groups
File "/usr/lib/python2.7/copy.py", line 174, in deepcopy. y = copier(memo) ... TypeError: cannot deepcopy this pattern object. Same via the UI.
Read more >
Issue 10076: Regex objects became uncopyable in 2.5
... line 173, in deepcopy y = copier(memo) TypeError: cannot deepcopy this pattern object I'll attach a patch against 2.7 to correct this....
Read more >
1075503 – Unable to deepcopy compiled regexp
... deepcopy y = copier(memo) TypeError: cannot deepcopy this pattern object Actual results: Unable to deepcopy compiled regular expression.
Read more >
Complete Guide to Python deepcopy with Examples - eduCBA
deepcopy is a technique of creating copies of a python object where the user can work on mutable objects without altering or modifying...
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