Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] conan build on 1.34.0 cant find build folder anymore #8566

Closed
kanrrra opened this issue Feb 26, 2021 · 8 comments
Closed

[bug] conan build on 1.34.0 cant find build folder anymore #8566

kanrrra opened this issue Feb 26, 2021 · 8 comments

Comments

@kanrrra
Copy link

kanrrra commented Feb 26, 2021

Environment Details (include every applicable attribute)

  • Operating System+version: Ubuntu 18.04
  • Compiler+version: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
  • Conan version: Conan version 1.34.0
  • Python version: Python 3.6.9

Steps to reproduce (Include if Applicable)

Our build is fine on 1.33.1 but fails on 1.34.0. Nothing else changed.
conan install completes fine. conan build fails because it cant find the build dir.

Logs (Executed commands with output) (Include/Attach if Applicable)

conan install . --install-folder build -s compiler.libcxx=libstdc++11 -s os=Linux -g virtualrunenv
[success]

conan build . --build-folder build --source-folder .
Using lockfile: '/code/bj-interpolator/build/conan.lock'
Using cached profile from lockfile
ERROR: Unable to build it successfully
File "/usr/local/lib/python3.6/dist-packages/conans/client/conanfile/build.py", line 12, in run_build_method
os.listdir(conanfile.build_folder))
FileNotFoundError: [Errno 2] No such file or directory: 'build'

checking to see if build exists:
root@13dd8b464545:/code/**********r# ls -l | grep build
drwxr-xr-x 4 root root 4096 Feb 26 12:32 build

@czoido czoido self-assigned this Feb 26, 2021
@czoido
Copy link
Contributor

czoido commented Feb 26, 2021

Hi @kanrrra,

Thanks for reporting. I'm trying to reproduce the issue but still had no luck.
Does it happen for you even with a very basic example like this one?

conan new pkg/1.0 -s
conan install . --install-folder build -g virtualrunenv
conan build . --build-folder build --source-folder .   

Could you please provide a more complete log ?

@czoido
Copy link
Contributor

czoido commented Feb 26, 2021

@kanrrra could you activate logging with conan config set log.level=10 ? there are some messages related to the build folder that could provide useful information.

@kanrrra
Copy link
Author

kanrrra commented Feb 26, 2021

@czoido Thanks for your help! The very basic example works fine.

root@13dd8b464545:/code/conantest# conan new pkg/1.0 -s
DEBUG :conan_api.py   [177]: INIT: Using config '/root/.conan/conan.conf' [2021-02-26 22:09:32,556]
DEBUG :tracer.py      [157]: CONAN_API: new(header=False,pure_c=False,test=False,exports_sources=True,bare=False,visual_versions=False,linux_gcc_versions=False,linux_clang_versions=False,gitignore=False,osx_clang_versions=False,shared=False,upload_url=None,gitlab_gcc_versions=False,gitlab_clang_versions=False,circleci_gcc_versions=False,circleci_clang_versions=False,circleci_osx_versions=False,template=None) [2021-02-26 22:09:32,558]
File saved: conanfile.py
File saved: src/CMakeLists.txt
File saved: src/pkg.cpp
File saved: src/pkg.h
root@13dd8b464545:/code/conantest# conan install . --install-folder build -g virtualrunenv
DEBUG :conan_api.py   [177]: INIT: Using config '/root/.conan/conan.conf' [2021-02-26 22:09:33,233]
DEBUG :tracer.py      [157]: CONAN_API: install(path=.,name=None,version=None,user=None,channel=None,settings=None,options=None,env=None,profile_names=None,profile_build=ProfileData(profiles=None, settings=None, options=None, env=None),remote_name=None,verify=None,manifests=None,manifests_interactive=None,build=None,update=False,generators=['virtualrunenv'],no_imports=False,install_folder=build,lockfile=None,lockfile_out=None) [2021-02-26 22:09:33,236]
DEBUG :profile_loader.py[116]: PROFILE LOAD: /root/.conan/profiles/default [2021-02-26 22:09:33,238]
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=7
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

DEBUG :graph_builder.py[68]: GRAPH: Time to load deps 0.0002155303955078125 [2021-02-26 22:09:33,323]
conanfile.py (pkg/1.0): Installing package
Requirements
Packages

Installing (downloading, building) binaries...
conanfile.py (pkg/1.0): Generator cmake created conanbuildinfo.cmake
conanfile.py (pkg/1.0): Generator txt created conanbuildinfo.txt
conanfile.py (pkg/1.0): Generator virtualrunenv created activate_run.ps1
conanfile.py (pkg/1.0): Generator virtualrunenv created deactivate_run.ps1
conanfile.py (pkg/1.0): Generator virtualrunenv created environment_run.ps1.env
conanfile.py (pkg/1.0): Generator virtualrunenv created activate_run.sh
conanfile.py (pkg/1.0): Generator virtualrunenv created deactivate_run.sh
conanfile.py (pkg/1.0): Generator virtualrunenv created environment_run.sh.env
conanfile.py (pkg/1.0): Generated conaninfo.txt
conanfile.py (pkg/1.0): Generated graphinfo
root@13dd8b464545:/code/conantest# conan build . --build-folder build --source-folder .  
DEBUG :conan_api.py   [177]: INIT: Using config '/root/.conan/conan.conf' [2021-02-26 22:09:37,947]
DEBUG :tracer.py      [157]: CONAN_API: build(conanfile_path=.,source_folder=.,package_folder=None,build_folder=build,install_folder=None,should_configure=True,should_build=True,should_install=True,should_test=True) [2021-02-26 22:09:37,949]
DEBUG :build.py       [17]: BUILD: folder '/code/conantest/build' [2021-02-26 22:09:37,952]
DEBUG :build.py       [18]: BUILD: Conanfile at '/code/conantest/conanfile.py' [2021-02-26 22:09:37,952]
Using lockfile: '/code/conantest/build/conan.lock'
Using cached profile from lockfile
DEBUG :build.py       [12]: Call conanfile.build() with files in build folder: ['environment_run.sh.env', 'conanbuildinfo.txt', 'conaninfo.txt', 'conan.lock', 'conanbuildinfo.cmake', 'activate_run.ps1', 'activate_run.sh', 'deactivate_run.ps1', 'environment_run.ps1.env', 'graph_info.json', 'deactivate_run.sh'] [2021-02-26 22:09:38,036]
conanfile.py (pkg/1.0): Calling build()
INFO  :cmake_flags.py [273]: Setting Cross build flags:  [2021-02-26 22:09:38,053]
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Adjusting fPIC flag (ON)
-- Conan: Compiler GCC>=5, checking major version 7
-- Conan: Checking correct version: 7
-- Conan: C++ stdlib: libstdc++
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DATAROOTDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR


-- Build files have been written to: /code/conantest/build
Scanning dependencies of target pkg
[ 50%] Building CXX object CMakeFiles/pkg.dir/pkg.cpp.o
[100%] Linking CXX static library lib/libpkg.a
[100%] Built target pkg

log of conan build of my own package

root@13dd8b464545:/code/bj-interpolator# conan build . --build-folder build --source-folder .
DEBUG :conan_api.py   [177]: INIT: Using config '/root/.conan/conan.conf' [2021-02-26 22:06:57,730]
DEBUG :tracer.py      [157]: CONAN_API: build(conanfile_path=.,source_folder=.,package_folder=None,build_folder=build,install_folder=None,should_configure=True,should_build=True,should_install=True,should_test=True) [2021-02-26 22:06:57,732]
DEBUG :build.py       [17]: BUILD: folder '/code/bj-interpolator/build' [2021-02-26 22:06:57,734]
DEBUG :build.py       [18]: BUILD: Conanfile at '/code/bj-interpolator/conanfile.py' [2021-02-26 22:06:57,735]
Using lockfile: '/code/bj-interpolator/build/conan.lock'
Using cached profile from lockfile
ERROR: Unable to build it successfully
  File "/usr/local/lib/python3.6/dist-packages/conans/client/conanfile/build.py", line 12, in run_build_method
    os.listdir(conanfile.build_folder))
FileNotFoundError: [Errno 2] No such file or directory: 'build'

@memsharded
Copy link
Member

I have also been trying to reproduce without success. It would be great to know details of your recipe that is causing this failure, I think the problem might be reproducible with a relatively simple recipe.

Also, please, if you could share what are the folders and files that you have after the conan install . --install-folder build -s compiler.libcxx=libstdc++11 -s os=Linux -g virtualrunenv and before the conan build command that would help. It seems there is not a build folder there, but it should be.

@kanrrra
Copy link
Author

kanrrra commented Feb 28, 2021

Ok here is the full command and log. The build folder does exist after conan install, see the output of ls.

Here is our conanfile renamed to .txt because I cant upload .py files.
conanfile.txt

root@13dd8b464545:/code/bj-interpolator# conan install . --install-folder build -s compiler.libcxx=libstdc++11 -s os=Linux -s bj-prometheus:compiler=gcc -s bj-prometheus:compiler.version=7 -s bj-signals-slots:compiler=gcc -s bj-signals-slots:compiler.version=5 -s bj-tracker-utils:compiler=gcc -s bj-tracker-utils:compiler.version=5 -s cppkafka:compiler=gcc -s cppkafka:compiler.version=5 -s rdkafka:compiler=gcc -s rdkafka:compiler.version=5 -g virtualrunenv
DEBUG :conan_api.py   [177]: INIT: Using config '/root/.conan/conan.conf' [2021-02-28 16:22:43,654]
DEBUG :tracer.py      [157]: CONAN_API: install(path=.,name=None,version=None,user=None,channel=None,settings=['compiler.libcxx=libstdc++11', 'os=Linux', 'bj-prometheus:compiler=gcc', 'bj-prometheus:compiler.version=7', 'bj-signals-slots:compiler=gcc', 'bj-signals-slots:compiler.version=5', 'bj-tracker-utils:compiler=gcc', 'bj-tracker-utils:compiler.version=5', 'cppkafka:compiler=gcc', 'cppkafka:compiler.version=5', 'rdkafka:compiler=gcc', 'rdkafka:compiler.version=5'],options=None,env=None,profile_names=None,profile_build=ProfileData(profiles=None, settings=None, options=None, env=None),remote_name=None,verify=None,manifests=None,manifests_interactive=None,build=None,update=False,generators=['virtualrunenv'],no_imports=False,install_folder=build,lockfile=None,lockfile_out=None) [2021-02-28 16:22:43,656]
DEBUG :profile_loader.py[116]: PROFILE LOAD: /root/.conan/profiles/default [2021-02-28 16:22:43,659]
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=7
os=Linux
os_build=Linux
bj-prometheus:compiler=gcc
bj-prometheus:compiler.version=7
bj-signals-slots:compiler=gcc
bj-signals-slots:compiler.version=5
bj-tracker-utils:compiler=gcc
bj-tracker-utils:compiler.version=5
cppkafka:compiler=gcc
cppkafka:compiler.version=5
rdkafka:compiler=gcc
rdkafka:compiler.version=5
[options]
[build_requires]
[env]

DEBUG :graph_builder.py[417]: GRAPH: new_node: bj-tracker-utils/4.1.3@balljames/dev [2021-02-28 16:22:44,148]
DEBUG :graph_builder.py[417]: GRAPH: new_node: bj-signals-slots/0.0.1@balljames/stable [2021-02-28 16:22:44,161]
DEBUG :graph_builder.py[417]: GRAPH: new_node: cppkafka/0.3.1+1@balljames/dev [2021-02-28 16:22:44,164]
DEBUG :graph_builder.py[417]: GRAPH: new_node: rdkafka/1.1.x+0@balljames/stable [2021-02-28 16:22:44,168]
DEBUG :graph_builder.py[417]: GRAPH: new_node: OpenSSL/1.1.1c@conan/stable [2021-02-28 16:22:44,179]
DEBUG :graph_builder.py[417]: GRAPH: new_node: zlib/1.2.11@conan/stable [2021-02-28 16:22:44,184]
DEBUG :graph_builder.py[417]: GRAPH: new_node: boost/1.71.0@conan/stable [2021-02-28 16:22:44,196]
DEBUG :graph_builder.py[417]: GRAPH: new_node: bzip2/1.0.8@conan/stable [2021-02-28 16:22:44,200]
DEBUG :graph_builder.py[417]: GRAPH: new_node: gflags/2.2.1@bincrafters/stable [2021-02-28 16:22:44,204]
DEBUG :graph_builder.py[417]: GRAPH: new_node: bj-prometheus/0.0.1@balljames/dev [2021-02-28 16:22:44,208]
DEBUG :graph_builder.py[417]: GRAPH: new_node: glog/0.3.5@bincrafters/stable [2021-02-28 16:22:44,211]
DEBUG :graph_builder.py[417]: GRAPH: new_node: nlohmann_json/3.8.0 [2021-02-28 16:22:44,218]
DEBUG :graph_builder.py[417]: GRAPH: new_node: curlpp/0.7.6@balljames/stable [2021-02-28 16:22:44,221]
DEBUG :graph_builder.py[417]: GRAPH: new_node: libcurl/7.61.1@bincrafters/stable [2021-02-28 16:22:44,228]
DEBUG :graph_builder.py[417]: GRAPH: new_node: base64/0.1.4@balljames/stable [2021-02-28 16:22:44,232]
DEBUG :graph_builder.py[417]: GRAPH: new_node: bj-opencv-nocuda/0.0.4@balljames/stable [2021-02-28 16:22:44,235]
DEBUG :graph_builder.py[417]: GRAPH: new_node: msgpack/3.1.1@bincrafters/stable [2021-02-28 16:22:44,239]
DEBUG :graph_builder.py[417]: GRAPH: new_node: bj-protobuf/2.6.1+0@balljames/dev [2021-02-28 16:22:44,242]
DEBUG :graph_builder.py[417]: GRAPH: new_node: gtest/1.8.0@bincrafters/stable [2021-02-28 16:22:44,247]
DEBUG :graph_builder.py[68]: GRAPH: Time to load deps 0.1042485237121582 [2021-02-28 16:22:44,248]
Version ranges solved
    Version range '~0.7.2' required by 'bj-tracker-utils/4.1.3@balljames/dev' resolved to 'curlpp/0.7.6@balljames/stable' in local cache

conanfile.py (bj-interpolator/None): Installing package
Requirements
    OpenSSL/1.1.1c@conan/stable from 'conan-center' - Cache
    base64/0.1.4@balljames/stable from 'balljames-conan' - Cache
    bj-opencv-nocuda/0.0.4@balljames/stable from 'balljames-conan' - Cache
    bj-prometheus/0.0.1@balljames/dev from 'balljames-conan' - Cache
    bj-protobuf/2.6.1+0@balljames/dev from 'balljames-conan' - Cache
    bj-signals-slots/0.0.1@balljames/stable from 'balljames-conan' - Cache
    bj-tracker-utils/4.1.3@balljames/dev from 'balljames-conan' - Cache
    boost/1.71.0@conan/stable from 'conan-center' - Cache
    bzip2/1.0.8@conan/stable from 'conan-center' - Cache
    cppkafka/0.3.1+1@balljames/dev from 'balljames-conan' - Cache
    curlpp/0.7.6@balljames/stable from 'balljames-conan' - Cache
    gflags/2.2.1@bincrafters/stable from 'conan-center' - Cache
    glog/0.3.5@bincrafters/stable from 'conan-center' - Cache
    gtest/1.8.0@bincrafters/stable from 'conan-center' - Cache
    libcurl/7.61.1@bincrafters/stable from 'conan-center' - Cache
    msgpack/3.1.1@bincrafters/stable from 'conan-center' - Cache
    nlohmann_json/3.8.0 from 'conan-center' - Cache
    rdkafka/1.1.x+0@balljames/stable from 'balljames-conan' - Cache
    zlib/1.2.11@conan/stable from 'conan-center' - Cache
Packages
    OpenSSL/1.1.1c@conan/stable:b781af3f476d0aa5070a0a35b544db7a3c193cc8 - Cache
    base64/0.1.4@balljames/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    bj-opencv-nocuda/0.0.4@balljames/stable:efbe354690ef83824a1e98c7a6076b7ab63bc1b3 - Cache
    bj-prometheus/0.0.1@balljames/dev:efbe354690ef83824a1e98c7a6076b7ab63bc1b3 - Cache
    bj-protobuf/2.6.1+0@balljames/dev:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    bj-signals-slots/0.0.1@balljames/stable:2a60d68a7e80ed98846190567cc9c8a460880454 - Cache
    bj-tracker-utils/4.1.3@balljames/dev:e5dde7edf0821a27a656d83b8dbb230939df6e97 - Cache
    boost/1.71.0@conan/stable:5b61a950a8e504865808bd4e284db10c833b020f - Cache
    bzip2/1.0.8@conan/stable:b27e2b40bcb70be2e7d6f0e0c6e43e35c530f8d3 - Cache
    cppkafka/0.3.1+1@balljames/dev:dc55566d34d949b2a770279a179c73aead10596e - Cache
    curlpp/0.7.6@balljames/stable:904bc732602cc6d6a684d26de25f9adb697d217b - Cache
    gflags/2.2.1@bincrafters/stable:3aaf66235ef4853bb71adf370cb23aecc784997f - Cache
    glog/0.3.5@bincrafters/stable:2b4cb6dfbcf1c891cb60c3a197f992eacfeabee9 - Cache
    gtest/1.8.0@bincrafters/stable:a35a0a3b7a63474ff0b9f5c125383d6614daa321 - Cache
    libcurl/7.61.1@bincrafters/stable:ce65897ce836adb3eb34ee8ea84017665908a349 - Cache
    msgpack/3.1.1@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    nlohmann_json/3.8.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    rdkafka/1.1.x+0@balljames/stable:10ec242b2e05546953928a7e12ead89af0cdb123 - Cache
    zlib/1.2.11@conan/stable:d50a0d523d98c15bb147b18fa7d203887c38be8b - Cache

Installing (downloading, building) binaries...
base64/0.1.4@balljames/stable: Already installed!
base64/0.1.4@balljames/stable: WARN: Lib folder doesn't exist, can't collect libraries: /root/.conan/data/base64/0.1.4/balljames/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib
bj-opencv-nocuda/0.0.4@balljames/stable: Already installed!
bj-prometheus/0.0.1@balljames/dev: Already installed!
bj-protobuf/2.6.1+0@balljames/dev: Already installed!
bj-signals-slots/0.0.1@balljames/stable: Already installed!
bj-signals-slots/0.0.1@balljames/stable: WARN: Lib folder doesn't exist, can't collect libraries: /root/.conan/data/bj-signals-slots/0.0.1/balljames/stable/package/2a60d68a7e80ed98846190567cc9c8a460880454/lib
bzip2/1.0.8@conan/stable: Already installed!
gflags/2.2.1@bincrafters/stable: Already installed!
gtest/1.8.0@bincrafters/stable: Already installed!
msgpack/3.1.1@bincrafters/stable: Already installed!
nlohmann_json/3.8.0: Already installed!
zlib/1.2.11@conan/stable: Already installed!
OpenSSL/1.1.1c@conan/stable: Already installed!
boost/1.71.0@conan/stable: Already installed!
boost/1.71.0@conan/stable: LIBRARIES: ['boost_wave', 'boost_container', 'boost_contract', 'boost_graph', 'boost_iostreams', 'boost_locale', 'boost_log', 'boost_program_options', 'boost_random', 'boost_regex', 'boost_serialization', 'boost_wserialization', 'boost_coroutine', 'boost_fiber', 'boost_context', 'boost_timer', 'boost_thread', 'boost_chrono', 'boost_date_time', 'boost_atomic', 'boost_filesystem', 'boost_system', 'boost_type_erasure', 'boost_log_setup', 'boost_math_c99', 'boost_math_c99f', 'boost_math_c99l', 'boost_math_tr1', 'boost_math_tr1f', 'boost_math_tr1l', 'boost_stacktrace_addr2line', 'boost_stacktrace_backtrace', 'boost_stacktrace_basic', 'boost_stacktrace_noop', 'boost_unit_test_framework']
boost/1.71.0@conan/stable: Package folder: /root/.conan/data/boost/1.71.0/conan/stable/package/5b61a950a8e504865808bd4e284db10c833b020f
glog/0.3.5@bincrafters/stable: Already installed!
libcurl/7.61.1@bincrafters/stable: Already installed!
rdkafka/1.1.x+0@balljames/stable: Already installed!
cppkafka/0.3.1+1@balljames/dev: Already installed!
curlpp/0.7.6@balljames/stable: Already installed!
bj-tracker-utils/4.1.3@balljames/dev: Already installed!
conanfile.py (bj-interpolator/None): Generator cmake created conanbuildinfo.cmake
conanfile.py (bj-interpolator/None): Generator txt created conanbuildinfo.txt
conanfile.py (bj-interpolator/None): Generator virtualrunenv created activate_run.ps1
conanfile.py (bj-interpolator/None): Generator virtualrunenv created deactivate_run.ps1
conanfile.py (bj-interpolator/None): Generator virtualrunenv created environment_run.ps1.env
conanfile.py (bj-interpolator/None): Generator virtualrunenv created activate_run.sh
conanfile.py (bj-interpolator/None): Generator virtualrunenv created deactivate_run.sh
conanfile.py (bj-interpolator/None): Generator virtualrunenv created environment_run.sh.env
conanfile.py (bj-interpolator/None): Generated conaninfo.txt
conanfile.py (bj-interpolator/None): Generated graphinfo
root@13dd8b464545:/code/bj-interpolator# 
root@13dd8b464545:/code/bj-interpolator# ls -l | grep build
-rw-r--r-- 1 1000 1000    743 Feb 26 13:23 Dockerfile.build
drwxr-xr-x 2 root root   4096 Feb 28 16:22 build
-rwxr-xr-x 1 1000 1000    719 Feb 23 09:03 conan_build.sh
root@13dd8b464545:/code/bj-interpolator# 
root@13dd8b464545:/code/bj-interpolator# conan build . --build-folder build --source-folder .  
DEBUG :conan_api.py   [177]: INIT: Using config '/root/.conan/conan.conf' [2021-02-28 16:23:36,505]
DEBUG :tracer.py      [157]: CONAN_API: build(conanfile_path=.,source_folder=.,package_folder=None,build_folder=build,install_folder=None,should_configure=True,should_build=True,should_install=True,should_test=True) [2021-02-28 16:23:36,507]
DEBUG :build.py       [17]: BUILD: folder '/code/bj-interpolator/build' [2021-02-28 16:23:36,510]
DEBUG :build.py       [18]: BUILD: Conanfile at '/code/bj-interpolator/conanfile.py' [2021-02-28 16:23:36,510]
Using lockfile: '/code/bj-interpolator/build/conan.lock'
Using cached profile from lockfile
ERROR: Unable to build it successfully
  File "/usr/local/lib/python3.6/dist-packages/conans/client/conanfile/build.py", line 12, in run_build_method
    os.listdir(conanfile.build_folder))
FileNotFoundError: [Errno 2] No such file or directory: 'build'

root@13dd8b464545:/code/bj-interpolator# 

@memsharded
Copy link
Member

Some unrelated comments:

  • Do not define top level fields like defines = {}. Public attributes and methods are reserved for Conan, check https://docs.conan.io/en/latest/reference/conanfile.html
  • Check the validate() method and consider that instead of the declared constraints like settings = {"os": "Linux", .... It is possible that Conan 2.0 will remove this way of raising invalid configurations, and validate() will be the way to go.
  • In case you are not using profiles, they are totally recommended for production. You can manage them with conan config install, but using very long command lines is discouraged and profiles can help here.

Thanks very much for the details, I have finally managed to reproduce. I'll investigate now what is happening.

@memsharded
Copy link
Member

Ok, I have identified the error. You are declaring in the recipe a public attribute build_folder:

class BallJamesConanFile(ConanFile):
	name = "bj-interpolator"
	project_dir = "."
	build_folder = "build"

So it seems the above "unrelated comment" was actually related. Read carefully https://docs.conan.io/en/latest/reference/conanfile.html, it is not possible to define public top level attributes or methods, because they will conflict with Conan own attributes and fields. The fact that it didn't fail before was luck, because Conan has used the build_folder attribute, check for example

write_generators(conanfile, conanfile.build_folder, self._output)
(from Conan 1.25)

@czoido czoido removed their assignment Mar 1, 2021
@kanrrra
Copy link
Author

kanrrra commented Mar 1, 2021

@memsharded Thank you so much! That fixed the issue and I'll definitely be looking into cleaning up our build process.

@kanrrra kanrrra closed this as completed Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants