Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32608

Setting DESTDIR equal to OUT_PWD breaks build of static libs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.1.0
    • Build tools: qmake
    • None
    • Qt Creator 2.7.2

      On Linux and Mac, compilation fails for library projects where the DESTDIR has been set to $$OUT_PWD during a shadow build in Qt Creator 2.7.2. This seems to be because the compiled .a file is first deleted in the DESTDIR directory and then the .a file is copied from OUT_PWD to DESTDIR. But since both directories are the same, the .a file is first deleted and then attempted to be moved, which obviously fails.

      I think the solution is to check if DESTDIR is the same as where the final output is generated, and if so, don't do the delete and move portion of the build. An example of the compilation output is below:

      ...
      rm -f libqwt.a
      ar cqs libqwt.a build/qwt_abstract_scale_draw.o build/qwt_clipper.o build/qwt_color_map.o build/qwt_column_symbol.o build/qwt_date.o build/qwt_date_scale_draw.o build/qwt_date_scale_engine.o build/qwt_dyngrid_layout.o build/qwt_event_pattern.o build/qwt_graphic.o build/qwt_interval.o build/qwt_interval_symbol.o build/qwt_math.o build/qwt_magnifier.o build/qwt_null_paintdevice.o build/qwt_painter.o build/qwt_painter_command.o build/qwt_panner.o build/qwt_picker.o build/qwt_picker_machine.o build/qwt_pixel_matrix.o build/qwt_point_3d.o build/qwt_point_polar.o build/qwt_round_scale_draw.o build/qwt_scale_div.o build/qwt_scale_draw.o build/qwt_scale_map.o build/qwt_spline.o build/qwt_scale_engine.o build/qwt_symbol.o build/qwt_system_clock.o build/qwt_text_engine.o build/qwt_text_label.o build/qwt_text.o build/qwt_transform.o build/qwt_widget_overlay.o build/qwt_curve_fitter.o build/qwt_abstract_legend.o build/qwt_legend.o build/qwt_legend_data.o build/qwt_legend_label.o build/qwt_plot.o build/qwt_plot_renderer.o build/qwt_plot_xml.o build/qwt_plot_axis.o build/qwt_plot_curve.o build/qwt_plot_dict.o build/qwt_plot_directpainter.o build/qwt_plot_grid.o build/qwt_plot_histogram.o build/qwt_plot_item.o build/qwt_plot_abstract_barchart.o build/qwt_plot_barchart.o build/qwt_plot_multi_barchart.o build/qwt_plot_intervalcurve.o build/qwt_plot_zoneitem.o build/qwt_plot_tradingcurve.o build/qwt_plot_spectrogram.o build/qwt_plot_spectrocurve.o build/qwt_plot_scaleitem.o build/qwt_plot_legenditem.o build/qwt_plot_seriesitem.o build/qwt_plot_shapeitem.o build/qwt_plot_marker.o build/qwt_plot_textlabel.o build/qwt_plot_layout.o build/qwt_plot_canvas.o build/qwt_plot_panner.o build/qwt_plot_rasteritem.o build/qwt_plot_picker.o build/qwt_plot_zoomer.o build/qwt_plot_magnifier.o build/qwt_plot_rescaler.o build/qwt_point_mapper.o build/qwt_raster_data.o build/qwt_matrix_raster_data.o build/qwt_sampling_thread.o build/qwt_series_data.o build/qwt_point_data.o build/qwt_scale_widget.o build/qwt_plot_svgitem.o build/qwt_abstract_slider.o build/qwt_abstract_scale.o build/qwt_arrow_button.o build/qwt_analog_clock.o build/qwt_compass.o build/qwt_compass_rose.o build/qwt_counter.o build/qwt_dial.o build/qwt_dial_needle.o build/qwt_knob.o build/qwt_slider.o build/qwt_thermo.o build/qwt_wheel.o build/moc_qwt_dyngrid_layout.o build/moc_qwt_magnifier.o build/moc_qwt_panner.o build/moc_qwt_picker.o build/moc_qwt_text_label.o build/moc_qwt_abstract_legend.o build/moc_qwt_legend.o build/moc_qwt_legend_label.o build/moc_qwt_plot.o build/moc_qwt_plot_renderer.o build/moc_qwt_plot_canvas.o build/moc_qwt_plot_panner.o build/moc_qwt_plot_picker.o build/moc_qwt_plot_zoomer.o build/moc_qwt_plot_magnifier.o build/moc_qwt_sampling_thread.o build/moc_qwt_scale_widget.o build/moc_qwt_abstract_slider.o build/moc_qwt_abstract_scale.o build/moc_qwt_analog_clock.o build/moc_qwt_compass.o build/moc_qwt_counter.o build/moc_qwt_dial.o build/moc_qwt_knob.o build/moc_qwt_slider.o build/moc_qwt_thermo.o build/moc_qwt_wheel.o
      rm -f ./libqwt.a
      mv -f libqwt.a ./ 
      mv: cannot stat 'libqwt.a': No such file or directory
      make: [libqwt.a] Error 1 (ignored)
      06:21:20: The process "/usr/bin/make" exited normally.
      06:21:20: Elapsed time: 00:19.
      

      But if I perform a non-shadow build, then the library is generated properly:

      ...
      rm -f libqwt.a
      ar cqs libqwt.a build/qwt_abstract_scale_draw.o build/qwt_clipper.o build/qwt_color_map.o build/qwt_column_symbol.o build/qwt_date.o build/qwt_date_scale_draw.o build/qwt_date_scale_engine.o build/qwt_dyngrid_layout.o build/qwt_event_pattern.o build/qwt_graphic.o build/qwt_interval.o build/qwt_interval_symbol.o build/qwt_math.o build/qwt_magnifier.o build/qwt_null_paintdevice.o build/qwt_painter.o build/qwt_painter_command.o build/qwt_panner.o build/qwt_picker.o build/qwt_picker_machine.o build/qwt_pixel_matrix.o build/qwt_point_3d.o build/qwt_point_polar.o build/qwt_round_scale_draw.o build/qwt_scale_div.o build/qwt_scale_draw.o build/qwt_scale_map.o build/qwt_spline.o build/qwt_scale_engine.o build/qwt_symbol.o build/qwt_system_clock.o build/qwt_text_engine.o build/qwt_text_label.o build/qwt_text.o build/qwt_transform.o build/qwt_widget_overlay.o build/qwt_curve_fitter.o build/qwt_abstract_legend.o build/qwt_legend.o build/qwt_legend_data.o build/qwt_legend_label.o build/qwt_plot.o build/qwt_plot_renderer.o build/qwt_plot_xml.o build/qwt_plot_axis.o build/qwt_plot_curve.o build/qwt_plot_dict.o build/qwt_plot_directpainter.o build/qwt_plot_grid.o build/qwt_plot_histogram.o build/qwt_plot_item.o build/qwt_plot_abstract_barchart.o build/qwt_plot_barchart.o build/qwt_plot_multi_barchart.o build/qwt_plot_intervalcurve.o build/qwt_plot_zoneitem.o build/qwt_plot_tradingcurve.o build/qwt_plot_spectrogram.o build/qwt_plot_spectrocurve.o build/qwt_plot_scaleitem.o build/qwt_plot_legenditem.o build/qwt_plot_seriesitem.o build/qwt_plot_shapeitem.o build/qwt_plot_marker.o build/qwt_plot_textlabel.o build/qwt_plot_layout.o build/qwt_plot_canvas.o build/qwt_plot_panner.o build/qwt_plot_rasteritem.o build/qwt_plot_picker.o build/qwt_plot_zoomer.o build/qwt_plot_magnifier.o build/qwt_plot_rescaler.o build/qwt_point_mapper.o build/qwt_raster_data.o build/qwt_matrix_raster_data.o build/qwt_sampling_thread.o build/qwt_series_data.o build/qwt_point_data.o build/qwt_scale_widget.o build/qwt_plot_svgitem.o build/qwt_abstract_slider.o build/qwt_abstract_scale.o build/qwt_arrow_button.o build/qwt_analog_clock.o build/qwt_compass.o build/qwt_compass_rose.o build/qwt_counter.o build/qwt_dial.o build/qwt_dial_needle.o build/qwt_knob.o build/qwt_slider.o build/qwt_thermo.o build/qwt_wheel.o build/moc_qwt_dyngrid_layout.o build/moc_qwt_magnifier.o build/moc_qwt_panner.o build/moc_qwt_picker.o build/moc_qwt_text_label.o build/moc_qwt_abstract_legend.o build/moc_qwt_legend.o build/moc_qwt_legend_label.o build/moc_qwt_plot.o build/moc_qwt_plot_renderer.o build/moc_qwt_plot_canvas.o build/moc_qwt_plot_panner.o build/moc_qwt_plot_picker.o build/moc_qwt_plot_zoomer.o build/moc_qwt_plot_magnifier.o build/moc_qwt_sampling_thread.o build/moc_qwt_scale_widget.o build/moc_qwt_abstract_slider.o build/moc_qwt_abstract_scale.o build/moc_qwt_analog_clock.o build/moc_qwt_compass.o build/moc_qwt_counter.o build/moc_qwt_dial.o build/moc_qwt_knob.o build/moc_qwt_slider.o build/moc_qwt_thermo.o build/moc_qwt_wheel.o
      06:26:47: The process "/usr/bin/make" exited normally.
      06:26:47: Elapsed time: 00:18.
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            buddenha Oswald Buddenhagen
            susurrus Bryant
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes