Comments (12)
We could first change the documentaiton to reflect this.
Please create a PR for the proposed change to address the current difference.
A better (maybe further looking) alternative would be to implement an equivalent to --build-tests in colcon.
Sounds like a good idea to me.
from colcon-core.
Please create a PR for the proposed change to address the current difference.
Sure thing, my understanding is that every where we give an example of using colcon build
we will add BUILD_TESTING=OFF
and modify the ament compatibility page to just say that --build-tests
is the default behavior.
I'll open a PR with that tomorrow if there's no objection on this ticket.
from colcon-core.
A new option to control this sounds good to me. I would rather not change the default though. Why not? Because that is not what a CMake user would expect when not configuring anything different. So an option to disable building tests seems more appropriate to me.
from colcon-core.
should the behavior of the tool change (topological order, something else)?
e.g. test_depends
would be removed from the dependency list of the package if the flag disabling test compilation is not provided
from colcon-core.
test_depends
would be removed from the dependency list of the package if the flag disabling test compilation is not provided
That would be an option. It might confuse users though if the set of packages they selected changes based on the option being toggled.
from colcon-core.
I would like to bump the priority of this item.
It might confuse users though if the set of packages they selected changes based on the option being toggled.
I currently have a use case where this is the behavior I want to exercise:
- One of the test dependencies of my packages cannot build on the platform I'm using
- I want to build my workspace without tests so I don't need that dependency
- I run
colcon build --packages-skip my_missing_test_dep --cmake-args -DBUILD_TESTING=OFF
- My build fails with the following error message:
colcon.colcon_cmake.task.cmake.build ERROR Failed to find the following files:
- C:\dev\ros2\install\share\my_missing_testing_dep\package.bat
Check that the following packages have been built:
- my_missing_testing_dep
Currently the only way to work around the issue is to remove the dependency from the package.xml of all the packages having that test dependency.
Having the --build-tests
flag modify the list of required dependencies passed to each task would be valuable.
Does that sound reasonable?
from colcon-core.
My build fails with the following error message:
A package which is "skipped" during the build is still considered to be present (and assumed to be built previously). What you want is to "ignore" that package as if it isn't even present in the workspace (or has a COLCON_IGNORE
marker). You should be able to achieve this with the following option: --packages-ignore my_missing_test_dep
from colcon-core.
Oh good to know I forgot an ignore option was available 👍
Then it can stay as an enhancement.
I still believe that a feature of this option (when not exercised) would be to demote test dependencies from the dependency list allowing people to not build their test dependencies when they decide to not build the tests
from colcon-core.
I still believe that a feature of this option (when not exercised) would be to demote test dependencies from the dependency list allowing people to not build their test dependencies when they decide to not build the tests
I see a "problem" with considering a test dependency a dependency in one build but not in another: basically the result of your build can become non-deterministic. When you do just one build with tests enabled the behavior might be different than a build which happens after a previous build was done without test dependencies (e.g. cached information in the CMakeCache.txt from previous run with different environment).
from colcon-core.
With the new mixin
feature available this could be addressed by adding a new "recipe" to the mixin repository, e.g.
"build-tests": {
"build": {
"cmake-args": ["-DBUILD_TESTING=1"]
}
}
I am just not sure about the naming of the mixin...
from colcon-core.
The build-testing mixins look good to me to be able to toggle the arguments.
I am just not sure about the naming of the mixin...
build-testing
seems fine for now 👍
I see a "problem" with considering a test dependency a dependency in one build but not in another: basically the result of your build can become non-deterministic. When you do just one build with tests enabled the behavior might be different than a build which happens after a previous build was done without test dependencies (e.g. cached information in the CMakeCache.txt from previous run with different environment).
I understand the concern. What would be a recommended alternative to ignore all the dependencies listed as test_depend in a workspace? (basically building all packages up to foo but removing the ones that are only test_depend
in the chain)
from colcon-core.
Since mixins for this flag have been added in colcon/colcon-mixin-repository#2 I will go ahead and close this.
from colcon-core.
Related Issues (20)
- `colcon build` uses the wrong Python version when inside a virtualenvironment on Windows HOT 2
- [bug] additional cmake args after CMAKE_TOOLCHAIN_FILE will clear it HOT 2
- Cache get_extension_points output
- empy version incompatibility HOT 4
- [Question] Correct way to build a ros driver which depends on a library without having to run 'sudo make install' on the library. HOT 6
- Design intent of setup.sh vs setup.bash HOT 4
- Why can data_files destinations not be absolute for ament_python packages? HOT 4
- [Question] Recommended way to invoke colcon on ubuntu noble? / request for release recent colcon in ROS APT ubuntu noble repos HOT 2
- Feature Request: Multiple `build-base` and `install-base` for multiple `base-paths`
- Colcon hangs when stdout / stderr is redirected and output line is longer than default buffer size HOT 2
- Colcon extends LD_LIBARAY_PATH with cross compiled libraries HOT 3
- Package includes directory has subdir of subdir of package name HOT 1
- Install colcon on x86 to cross compile ros2 HOT 4
- Error building after deleting a file: can't copy '<deleted-file> doesn't exist or not a regular file HOT 3
- colcon list Traceback (most recent call last): File "/usr/bin/colcon", line 33, in <module> sys.exit(load_entry_point('colcon-core==0.16.0', 'console_scripts', 'colcon')()) File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 118, in main return _main(command_name=command_name, argv=argv) File "/usr/lib/python3/dist-packages/colcon_core/command.py", line 185, in _main create_log_path(args.verb_name) File "/usr/lib/python3/dist-packages/colcon_core/location.py", line 186, in create_log_path os.makedirs(str(path)) File "/usr/lib/python3.10/os.py", line 225, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: 'log/list_2024-04-06_02-45-22' HOT 2
- colcon returns with success when extension loading fails
- No executable found for scripts when using --symlink-install and install(PROGRAMS) HOT 2
- Torch shared library: libc10.so: cannot open shared object file HOT 4
- About changing the default compilation method of colcon build HOT 1
- Several lines from _local_setup_util_sh.py contain this: E501 line too long
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colcon-core.