3 # Copyright (C) 2010-2012 CEA/DEN
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 import src.debug as DBG
25 # Compatibility python 2/3 for input function
26 # input stays input for python 3 and input = raw_input for python 2
33 # Define all possible option for the compile command : sat compile <options>
34 parser = src.options.Options()
35 parser.add_option('p', 'products', 'list2', 'products',
36 _('Optional: products to compile. This option accepts a comma separated list.'))
37 parser.add_option('f', 'force', 'boolean', 'force',
38 'Optional: force the compilation of product, even if it is already installed. The BUILD directory is cleaned before compilation.')
39 parser.add_option('', 'with_fathers', 'boolean', 'fathers',
40 _("Optional: build all necessary products to the given product (KERNEL is "
41 "build before building GUI)."), False)
42 parser.add_option('', 'with_children', 'boolean', 'children',
43 _("Optional: build all products using the given product (all SMESH plugins"
44 " are build after SMESH)."), False)
45 parser.add_option('', 'clean_all', 'boolean', 'clean_all',
46 _("Optional: clean BUILD dir and INSTALL dir before building product."),
48 parser.add_option('', 'clean_install', 'boolean', 'clean_install',
49 _("Optional: clean INSTALL dir before building product."), False)
50 parser.add_option('', 'make_flags', 'string', 'makeflags',
51 _("Optional: add extra options to the 'make' command."))
52 parser.add_option('', 'show', 'boolean', 'no_compile',
53 _("Optional: DO NOT COMPILE just show if products are installed or not."),
55 parser.add_option('', 'stop_first_fail', 'boolean', 'stop_first_fail', _(
56 "Optional: Stops the command at first product compilation"
58 parser.add_option('', 'check', 'boolean', 'check', _(
59 "Optional: execute the unit tests after compilation"), False)
61 parser.add_option('', 'clean_build_after', 'boolean', 'clean_build_after',
62 _('Optional: remove the build directory after successful compilation'), False)
65 # from sat product infos, represent the product dependencies in a simple python graph
66 # keys are nodes, the list of dependencies are values
67 def get_dependencies_graph(p_infos):
69 for (p_name,p_info) in p_infos:
70 graph[p_name]=p_info.depend
73 # this recursive function calculates all the dependencies of node start
74 def depth_search_graph(graph, start, visited=[]):
75 visited= visited+ [start]
76 for node in graph[start]: # for all nodes in start dependencies
77 if node not in visited:
78 visited=depth_search_graph(graph, node, visited)
81 # find a path from start node to end (a group of nodes)
82 def find_path_graph(graph, start, end, path=[]):
86 if start not in graph:
88 for node in graph[start]:
90 newpath = find_path_graph(graph, node, end, path)
91 if newpath: return newpath
94 # Topological sorting algo
95 # return in sorted_nodes the list of sorted nodes
96 def depth_first_topo_graph(graph, start, visited=[], sorted_nodes=[]):
97 visited = visited + [start]
98 if start not in graph:
99 raise src.SatException('Error in product dependencies : %s product is referenced in products dependencies but is not present in the application !' % start)
100 for node in graph[start]:
101 if node not in visited:
102 visited,sorted_nodes=depth_first_topo_graph(graph, node, visited,sorted_nodes)
104 if node not in sorted_nodes:
105 raise src.SatException('Error in product dependencies : cycle detection for node %s and %s !' % (start,node))
107 sorted_nodes = sorted_nodes + [start]
108 return visited,sorted_nodes
111 # check for p_name that all dependencies are installed
112 def check_dependencies(config, p_name_p_info, all_products_dict):
113 l_depends_not_installed = []
114 for prod in p_name_p_info[1]["depend_all"]:
115 # for each dependency, check the install
116 prod_name, prod_info=all_products_dict[prod]
117 if not(src.product.check_installation(config, prod_info)):
118 l_depends_not_installed.append(prod_name)
119 return l_depends_not_installed # non installed deps
121 def log_step(logger, header, step):
122 logger.write("\r%s%s" % (header, " " * 30), 3)
123 logger.write("\r%s%s" % (header, step), 3)
126 def log_res_step(logger, res):
128 logger.write("%s \n" % src.printcolors.printcSuccess("OK"), 4)
131 logger.write("%s \n" % src.printcolors.printcError("KO"), 4)
134 def compile_all_products(sat, config, options, products_infos, all_products_dict, logger):
135 '''Execute the proper configuration commands
136 in each product build directory.
138 :param config Config: The global configuration
139 :param products_info list: List of
140 (str, Config) => (product_name, product_info)
141 :param all_products_dict: Dict of all products
142 :param logger Logger: The logger instance to use for the display and logging
143 :return: the number of failing commands.
146 # first loop for the cleaning
147 check_salome_configuration=False
148 for p_name_info in products_infos:
150 p_name, p_info = p_name_info
152 # nothing to clean for native or fixed products
153 if (not src.product.product_compiles(p_info)) or\
154 src.product.product_is_native(p_info) or\
155 src.product.product_is_fixed(p_info):
158 # Clean the build and the install directories
159 # if the corresponding options was called
160 if options.clean_all:
161 sat.clean(config.VARS.application +
162 " --products " + p_name +
163 " --build --install",
166 logger_add_link = logger)
169 # Clean the the install directory
170 # if the corresponding option was called
171 if options.clean_install and not options.clean_all:
172 sat.clean(config.VARS.application +
173 " --products " + p_name +
177 logger_add_link = logger)
179 # Clean the the install directory
180 # if the corresponding option was called
181 if options.force and not options.clean_all:
182 sat.clean(config.VARS.application +
183 " --products " + p_name +
187 logger_add_link = logger)
188 if src.product.product_is_salome(p_info):
189 check_salome_configuration=True
191 if check_salome_configuration:
192 # For salome applications, we check if the sources of configuration modules are present
193 # configuration modules have the property "configure_dependency"
194 # they are implicit prerequisites of the compilation.
197 # get the list of all modules in application
198 all_products_infos = src.product.get_products_infos(config.APPLICATION.products,
201 # for configuration modules, check if sources are present
202 for prod in all_products_dict:
203 product_name, product_info = all_products_dict[prod]
204 if ("properties" in product_info and
205 "configure_dependency" in product_info.properties and
206 product_info.properties.configure_dependency == "yes"):
207 check_source = check_source and src.product.check_source(product_info)
209 logger.write(_("\nERROR : SOURCES of %s not found! It is required for"
210 " the configuration\n" % product_name))
211 logger.write(_(" Get it with the command : sat prepare %s -p %s \n" %
212 (config.APPLICATION.name, product_name)))
215 return res # error configure dependency : we stop the compilation
217 # second loop to compile
219 for p_name_info in products_infos:
221 p_name, p_info = p_name_info
225 header = _("Compilation of %s") % src.printcolors.printcLabel(p_name)
226 header += " %s " % ("." * (len_end_line - len(p_name)))
227 logger.write(header, 3)
230 # Do nothing if the product is not compilable
231 if not src.product.product_compiles(p_info):
232 log_step(logger, header, "ignored")
233 logger.write("\n", 3, False)
236 # Do nothing if the product is native
237 if src.product.product_is_native(p_info):
238 log_step(logger, header, "native")
239 logger.write("\n", 3, False)
242 # Do nothing if the product is fixed (already compiled by third party)
243 if src.product.product_is_fixed(p_info):
244 log_step(logger, header, "native")
245 logger.write("\n", 3, False)
249 # Recompute the product information to get the right install_dir
250 # (it could change if there is a clean of the install directory)
251 p_info = src.product.get_product_config(config, p_name)
253 # Check if sources was already successfully installed
254 check_source = src.product.check_source(p_info)
255 is_pip= (src.appli_test_property(config,"pip", "yes") and src.product.product_test_property(p_info,"pip", "yes"))
256 # don't check sources with option --show
257 # or for products managed by pip (there sources are in wheels stored in LOCAL.ARCHIVE
258 if not (options.no_compile or is_pip):
260 logger.write(_("Sources of product not found (try 'sat -h prepare') \n"))
261 res += 1 # one more error
264 # if we don't force compilation, check if the was already successfully installed.
265 # we don't compile in this case.
266 if (not options.force) and src.product.check_installation(config, p_info):
267 logger.write(_("Already installed"))
268 logger.write(_(" in %s" % p_info.install_dir), 4)
269 logger.write(_("\n"))
272 # If the show option was called, do not launch the compilation
273 if options.no_compile:
274 logger.write(_("Not installed in %s\n" % p_info.install_dir))
277 # Check if the dependencies are installed
278 l_depends_not_installed = check_dependencies(config, p_name_info, all_products_dict)
279 if len(l_depends_not_installed) > 0:
280 log_step(logger, header, "")
281 logger.write(src.printcolors.printcError(
282 _("ERROR : the following mandatory product(s) is(are) not installed: ")))
283 for prod_name in l_depends_not_installed:
284 logger.write(src.printcolors.printcError(prod_name + " "))
288 # Call the function to compile the product
289 res_prod, len_end_line, error_step = compile_product(
290 sat, p_name_info, config, options, logger, header, len_end_line)
294 # there was an error, we clean install dir, unless :
295 # - the error step is "check", or
296 # - the product is managed by pip and installed in python dir
297 do_not_clean_install=False
298 is_single_dir=(src.appli_test_property(config,"single_install_dir", "yes") and \
299 src.product.product_test_property(p_info,"single_install_dir", "yes"))
301 if (error_step == "CHECK") or (is_pip and src.appli_test_property(config,"pip_install_dir", "python")) or is_single_dir :
302 # cases for which we do not want to remove install dir
303 # for is_single_dir and is_pip, the test to determine if the product is already
304 # compiled is based on configuration file, not the directory
305 do_not_clean_install=True
307 if not do_not_clean_install:
308 # Clean the install directory if there is any
310 "Cleaning the install directory if there is any\n"),
312 sat.clean(config.VARS.application +
313 " --products " + p_name +
317 logger_add_link = logger)
319 # Clean the build directory if the compilation and tests succeed
320 if options.clean_build_after:
321 log_step(logger, header, "CLEAN BUILD")
322 sat.clean(config.VARS.application +
323 " --products " + p_name +
327 logger_add_link = logger)
331 logger.write("\r%s%s" % (header, " " * len_end_line), 3)
332 logger.write("\r" + header + src.printcolors.printcError("KO ") + error_step)
333 logger.write("\n==== %(KO)s in compile of %(name)s \n" %
334 { "name" : p_name , "KO" : src.printcolors.printcInfo("ERROR")}, 4)
335 if error_step == "CHECK":
336 logger.write(_("\nINSTALL directory = %s" %
337 src.printcolors.printcInfo(p_info.install_dir)), 3)
340 logger.write("\r%s%s" % (header, " " * len_end_line), 3)
341 logger.write("\r" + header + src.printcolors.printcSuccess("OK"))
342 logger.write(_("\nINSTALL directory = %s" %
343 src.printcolors.printcInfo(p_info.install_dir)), 3)
344 logger.write("\n==== %s \n" % src.printcolors.printcInfo("OK"), 4)
345 logger.write("\n==== Compilation of %(name)s %(OK)s \n" %
346 { "name" : p_name , "OK" : src.printcolors.printcInfo("OK")}, 4)
348 logger.write("\n", 3, False)
351 if res_prod != 0 and options.stop_first_fail:
356 def compile_product(sat, p_name_info, config, options, logger, header, len_end):
357 '''Execute the proper configuration command(s)
358 in the product build directory.
360 :param p_name_info tuple: (str, Config) => (product_name, product_info)
361 :param config Config: The global configuration
362 :param logger Logger: The logger instance to use for the display
364 :param header Str: the header to display when logging
365 :param len_end Int: the lenght of the the end of line (used in display)
366 :return: 1 if it fails, else 0.
370 p_name, p_info = p_name_info
372 # Get the build procedure from the product configuration.
374 # build_sources : autotools -> build_configure, configure, make, make install
375 # build_sources : cmake -> cmake, make, make install
376 # build_sources : script -> script executions
380 # check if pip should be used : the application and product have pip property
381 if (src.appli_test_property(config,"pip", "yes") and
382 src.product.product_test_property(p_info,"pip", "yes")):
383 res, len_end_line, error_step = compile_product_pip(sat,
391 if (src.product.product_is_autotools(p_info) or
392 src.product.product_is_cmake(p_info)):
393 res, len_end_line, error_step = compile_product_cmake_autotools(sat,
400 if src.product.product_has_script(p_info):
401 res, len_end_line, error_step = compile_product_script(sat,
409 # Check that the install directory exists
410 if res==0 and not(os.path.exists(p_info.install_dir)):
412 error_step = "NO INSTALL DIR"
413 msg = _("Error: despite the fact that all the steps ended successfully,"
414 " no install directory was found !")
415 logger.write(src.printcolors.printcError(msg), 4)
416 logger.write("\n", 4)
417 return res, len_end, error_step
419 # Add the config file corresponding to the dependencies/versions of the
420 # product that have been successfully compiled
422 logger.write(_("Add the config file in installation directory\n"), 5)
423 src.product.add_compile_config_file(p_info, config)
426 # Do the unit tests (call the check command)
427 log_step(logger, header, "CHECK")
428 res_check = sat.check(
429 config.VARS.application + " --products " + p_name,
431 logger_add_link = logger)
437 return res, len_end_line, error_step
440 def compile_product_pip(sat,
447 '''Execute the proper build procedure for pip products
448 :param p_name_info tuple: (str, Config) => (product_name, product_info)
449 :param config Config: The global configuration
450 :param logger Logger: The logger instance to use for the display
452 :param header Str: the header to display when logging
453 :param len_end Int: the lenght of the the end of line (used in display)
454 :return: 1 if it fails, else 0.
457 # pip needs openssl-dev. If openssl is declared in the application, we check it!
458 if "openssl" in config.APPLICATION.products:
459 openssl_cfg = src.product.get_product_config(config, "openssl")
460 if not src.product.check_installation(config, openssl_cfg):
461 raise src.SatException(_("please install system openssl development package, it is required for products managed by pip."))
463 p_name, p_info = p_name_info
466 pip_install_in_python=False
467 pip_wheels_dir=os.path.join(config.LOCAL.archive_dir,"wheels")
468 pip_install_cmd=config.INTERNAL.command.pip_install # parametrized in src/internal
470 # b) get the build environment (useful to get the installed python & pip3)
471 build_environ = src.environment.SalomeEnviron(config,
472 src.environment.Environ(dict(os.environ)),
474 environ_info = src.product.get_product_dependencies(config,
476 build_environ.silent = (config.USER.output_verbose_level < 5)
477 build_environ.set_full_environ(logger, environ_info)
479 # c- download : check/get pip wheel in pip_wheels_dir
480 pip_download_cmd=config.INTERNAL.command.pip_download +\
481 " --destination-directory %s --no-deps %s==%s " %\
482 (pip_wheels_dir, p_info.name, p_info.version)
483 logger.write("\n"+pip_download_cmd+"\n", 4, False)
484 res_pip_dwl = (subprocess.call(pip_download_cmd,
486 cwd=config.LOCAL.workdir,
487 env=build_environ.environ.environ,
488 stdout=logger.logTxtFile,
489 stderr=subprocess.STDOUT) == 0)
490 # error is not managed at the stage. error will be handled by pip install
491 # here we just print a message
493 logger.write("Error in pip download\n", 4, False)
496 # d- install (in python or in separate product directory)
497 if src.appli_test_property(config,"pip_install_dir", "python"):
498 # pip will install product in python directory"
499 pip_install_cmd+=" --find-links=%s --build %s %s==%s" %\
500 (pip_wheels_dir, p_info.build_dir, p_info.name, p_info.version)
501 pip_install_in_python=True
504 # pip will install product in product install_dir
505 pip_install_dir=os.path.join(p_info.install_dir, "lib", "python${PYTHON_VERSION:0:3}", "site-packages")
506 pip_install_cmd+=" --find-links=%s --build %s --target %s %s==%s" %\
507 (pip_wheels_dir, p_info.build_dir, pip_install_dir, p_info.name, p_info.version)
508 log_step(logger, header, "PIP")
509 logger.write("\n"+pip_install_cmd+"\n", 4)
510 len_end_line = len_end + 3
513 res_pip = (subprocess.call(pip_install_cmd,
515 cwd=config.LOCAL.workdir,
516 env=build_environ.environ.environ,
517 stdout=logger.logTxtFile,
518 stderr=subprocess.STDOUT) == 0)
522 #log_res_step(logger, res)
525 logger.write("\nError in pip command, please consult details with sat log command's internal traces\n", 3)
527 return res, len_end_line, error_step
531 def compile_product_cmake_autotools(sat,
538 '''Execute the proper build procedure for autotools or cmake
539 in the product build directory.
541 :param p_name_info tuple: (str, Config) => (product_name, product_info)
542 :param config Config: The global configuration
543 :param logger Logger: The logger instance to use for the display
545 :param header Str: the header to display when logging
546 :param len_end Int: the lenght of the the end of line (used in display)
547 :return: 1 if it fails, else 0.
550 p_name, p_info = p_name_info
552 # Execute "sat configure", "sat make" and "sat install"
556 # Logging and sat command call for configure step
557 len_end_line = len_end
558 log_step(logger, header, "CONFIGURE")
559 res_c = sat.configure(config.VARS.application + " --products " + p_name,
561 logger_add_link = logger)
562 log_res_step(logger, res_c)
566 error_step = "CONFIGURE"
568 # Logging and sat command call for make step
569 # Logging take account of the fact that the product has a compilation
571 if src.product.product_has_script(p_info):
572 # if the product has a compilation script,
573 # it is executed during make step
574 scrit_path_display = src.printcolors.printcLabel(
575 p_info.compil_script)
576 log_step(logger, header, "SCRIPT " + scrit_path_display)
577 len_end_line = len(scrit_path_display)
579 log_step(logger, header, "MAKE")
580 make_arguments = config.VARS.application + " --products " + p_name
581 # Get the make_flags option if there is any
582 if options.makeflags:
583 make_arguments += " --option -j" + options.makeflags
584 res_m = sat.make(make_arguments,
586 logger_add_link = logger)
587 log_res_step(logger, res_m)
593 # Logging and sat command call for make install step
594 log_step(logger, header, "MAKE INSTALL")
595 res_mi = sat.makeinstall(config.VARS.application +
599 logger_add_link = logger)
601 log_res_step(logger, res_mi)
605 error_step = "MAKE INSTALL"
607 return res, len_end_line, error_step
609 def compile_product_script(sat,
616 '''Execute the script build procedure in the product build directory.
618 :param p_name_info tuple: (str, Config) => (product_name, product_info)
619 :param config Config: The global configuration
620 :param logger Logger: The logger instance to use for the display
622 :param header Str: the header to display when logging
623 :param len_end Int: the lenght of the the end of line (used in display)
624 :return: 1 if it fails, else 0.
627 p_name, p_info = p_name_info
629 # Execute "sat configure", "sat make" and "sat install"
632 # Logging and sat command call for the script step
633 scrit_path_display = src.printcolors.printcLabel(p_info.compil_script)
634 log_step(logger, header, "SCRIPT " + scrit_path_display)
635 len_end_line = len_end + len(scrit_path_display)
636 res = sat.script(config.VARS.application + " --products " + p_name,
638 logger_add_link = logger)
639 log_res_step(logger, res)
641 return res, len_end_line, error_step
645 '''method that is called when salomeTools is called with --help option.
647 :return: The text to display for the compile command description.
650 return _("The compile command constructs the products of the application"
651 "\n\nexample:\nsat compile SALOME-master --products KERNEL,GUI,"
652 "MEDCOUPLING --clean_all")
654 def run(args, runner, logger):
655 '''method that is called when salomeTools is called with compile parameter.
658 (options, args) = parser.parse_args(args)
660 # Warn the user if he invoked the clean_all option
661 # without --products option
662 if (options.clean_all and
663 options.products is None and
664 not runner.options.batch):
665 rep = input(_("You used --clean_all without specifying a product"
666 " are you sure you want to continue? [Yes/No] "))
667 if rep.upper() != _("YES").upper():
670 # check that the command has been called with an application
671 src.check_config_has_application( runner.cfg )
673 # Print some informations
674 logger.write(_('Executing the compile commands in the build '
675 'directories of the products of '
676 'the application %s\n') %
677 src.printcolors.printcLabel(runner.cfg.VARS.application), 1)
680 (_("SOURCE directory"),
681 os.path.join(runner.cfg.APPLICATION.workdir, 'SOURCES')),
682 (_("BUILD directory"),
683 os.path.join(runner.cfg.APPLICATION.workdir, 'BUILD'))
685 src.print_info(logger, info)
687 # Get the list of all application products, and create its dependency graph
688 all_products_infos = src.product.get_products_infos(runner.cfg.APPLICATION.products,
690 all_products_graph=get_dependencies_graph(all_products_infos)
691 #logger.write("Dependency graph of all application products : %s\n" % all_products_graph, 6)
692 DBG.write("Dependency graph of all application products : ", all_products_graph)
694 # Get the list of products we have to compile
695 products_infos = src.product.get_products_list(options, runner.cfg, logger)
696 products_list = [pi[0] for pi in products_infos]
698 logger.write("Product we have to compile (as specified by user) : %s\n" % products_list, 5)
700 # Extend the list with all recursive dependencies of the given products
702 for p_name in products_list:
703 visited=depth_search_graph(all_products_graph, p_name, visited)
704 products_list = visited
706 logger.write("Product list to compile with fathers : %s\n" % products_list, 5)
708 # Extend the list with all products that depends upon the given products
710 for n in all_products_graph:
711 # for all products (that are not in products_list):
712 # if we we find a path from the product to the product list,
713 # then we product is a child and we add it to the children list
714 if (n not in children) and (n not in products_list):
715 if find_path_graph(all_products_graph, n, products_list):
716 children = children + [n]
717 # complete products_list (the products we have to compile) with the list of children
718 products_list = products_list + children
719 logger.write("Product list to compile with children : %s\n" % products_list, 5)
721 # Sort the list of all products (topological sort).
722 # the products listed first do not depend upon products listed after
725 for n in all_products_graph:
726 if n not in visited_nodes:
727 visited_nodes,sorted_nodes=depth_first_topo_graph(all_products_graph, n, visited_nodes,sorted_nodes)
728 logger.write("Complete dependency graph topological search (sorting): %s\n" % sorted_nodes, 6)
730 # Create a dict of all products to facilitate products_infos sorting
732 for (pname,pinfo) in all_products_infos:
733 all_products_dict[pname]=(pname,pinfo)
735 # Use the sorted list of all products to sort the list of products we have to compile
736 sorted_product_list=[]
737 product_list_runtime=[]
738 product_list_compiletime=[]
739 product_list_compile_and_runtime=[]
741 # store at beginning compile time products, we need to compile them before!
742 for n in sorted_nodes:
743 if n in products_list:
744 if src.product.product_is_compile_and_runtime(all_products_dict[n][1]):
745 # these products (python/graphviz) are used at compile and run time
746 # they have no dependencies.
747 # we always compile them in the first place
748 product_list_compile_and_runtime.append(n)
750 if src.product.product_is_compile_time(all_products_dict[n][1]):
751 product_list_compiletime.append(n)
753 product_list_runtime.append(n)
754 sorted_product_list = product_list_compile_and_runtime + product_list_compiletime + product_list_runtime
755 logger.write("Sorted list of products to compile : %s\n" % sorted_product_list, 5)
757 # from the sorted list of products to compile, build a sorted list of products infos
759 for product in sorted_product_list:
760 products_infos.append(all_products_dict[product])
762 # for all products to compile, store in "depend_all" field the complete dependencies (recursive)
763 # (will be used by check_dependencies funvtion)
764 for pi in products_infos:
766 dep_prod=depth_search_graph(all_products_graph,pi[0], dep_prod)
767 pi[1]["depend_all"]=dep_prod[1:]
770 # Call the function that will loop over all the products and execute
771 # the right command(s)
772 res = compile_all_products(runner, runner.cfg, options, products_infos, all_products_dict, logger)
774 # Print the final state
775 nb_products = len(products_infos)
781 logger.write(_("\nCompilation: %(status)s (%(valid_result)d/%(nb_products)d)\n") % \
782 { 'status': src.printcolors.printc(final_status),
783 'valid_result': nb_products - res,
784 'nb_products': nb_products }, 1)