msys2 / msys2/msys2-runtime

Using msys2/mingw32 to cross-compile open62541 with conan and MSYS2_ARG_CONV_EXCL

Open
#145 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
240
Forks
60
Avg merge
2d 3h
Merged PRs (30d)
1

Description

I'm trying to cross-compile open62541 with conan/cmake/msys2/mingw32 and this fails with a particular error relating to paths.
I've narrowed it down to this command, invoked by cmake/make as part of a custom_command to generate some files.

/C/.conan/1fbf05/1/bin/msys64/mingw32/bin/python3.10.exe C:/.conan/bd88a7/1/src/tools/generate_datatypes.py --selected-types=C:/.conan/bd88a7/1/src/tools/schema/datatypes_transport.txt --type-bsd=C:/.conan/bd88a7/1/src/tools/schema/Custom.Opc.Ua.Transport.bsd --import=TYPES#C:.conan/bd88a7/1/src/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd --type-csv=C:/.conan/bd88a7/1/src/deps/ua-nodeset/Schema/NodeIds.csv --no-builtin --internal C:/.conan/bd88a7/1/build/Release/src_generated/open62541/transport
Traceback (most recent call last):
File "C:.conan\bd88a7\1\src\tools\generate_datatypes.py", line 95, in
parser.create_types()
File "C:/.conan\bd88a7\1\src\tools/nodeset_compiler/type_parser.py", line 384, in create_types
self.parse_types()
File "C:/.conan\bd88a7\1\src\tools/nodeset_compiler/type_parser.py", line 411, in parse_types
self.parseTypeDefinitions(outname_import, file_import)
File "C:/.conan\bd88a7\1\src\tools/nodeset_compiler/type_parser.py", line 304, in parseTypeDefinitions
xmlDoc = etree.iterparse(
File "C:/.conan/1fbf05/1/bin/msys64/mingw32/lib/python3.10/xml/etree/ElementTree.py", line 1272, in iterparse
next(it)
File "C:/.conan/1fbf05/1/bin/msys64/mingw32/lib/python3.10/xml/etree/ElementTree.py", line 1249, in iterator
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'C;.conan\bd88a7\1\src\deps\ua-nodeset\Schema\Opc.Ua.Types.bsd'

Disabling the path conversion altogether works:

MSYS2_ARG_CONV_EXCL=- /C/.conan/1fbf05/1/bin/msys64/mingw32/bin/python3.10.exe C:/.conan/bd88a7/1/src/tools/generate_datatypes.py --selected-types=C:/.conan/bd88a7/1/src/tools/schema/datatypes_transport.txt --type-bsd=C:/.conan/bd88a7/1/src/tools/schema/Custom.Opc.Ua.Transport.bsd --import=TYPES#C:/.conan/bd88a7/1/src/deps/ua-nodeset/Schema/Opc.Ua.Types.bsd --type-csv=C:/.conan/bd88a7/1/src/deps/ua-nodeset/Schema/NodeIds.csv --no-builtin --internal C:/.conan/bd88a7/1/build/Release/src_generated/open62541/transport

I updated the python-script with some additional logging to print the arguments.

['C:/.conan/bd88a7/1/src/tools/generate_datatypes.py', '--selected-types=C:/.conan/bd88a7/1/src/tools/schema/datatypes_transport.txt', '--type-bsd=C:/.conan/bd88a7/1/src/tools/schema/Custom.Opc.Ua.Transport.bsd', '--import=TYPES#C;.conan\bd88a7\1\src\deps\ua-nodeset\Schema\Opc.Ua.Types.bsd', '--type-csv=C:/.conan/bd88a7/1/src/deps/ua-nodeset/Schema/NodeIds.csv', '--no-builtin', '--internal', 'C:/.conan/bd88a7/1/build/Release/src_generated/open62541/transport']

The reason I'm asking here is that the issue is specifically with the path that is prefixed with TYPES#, the others are unaffected.
Can you help me understand why? Hopefully that'll point me in the right direction to solve this. Thanks!

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the shown generate_datatypes.py command with and without MSYS2_ARG_CONV_EXCL=-, then inspect how MSYS2 path conversion handles the --import=TYPES# argument. The relevant Python entry points are tools/generate_datatypes.py and tools/nodeset_compiler/type_parser.py; done means the import path remains usable without breaking the other arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake, python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.