View Issue Details

IDProjectCategoryView StatusLast Update
0004588FreeCADPatchpublic2021-03-11 19:43
Reportergarya Assigned ToKunda1  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.19 
Fixed in Version0.19 
Summary0004588: correct non-standard use of sed -i argument in cMake/FindPySide2Tools.cmake
DescriptioncMake/FindPySide2Tools.cmake uses a non-standard sed argument "-i" without an extension, causing a build to break on FreeBSD systems. It should be corrected to use POSIX standard syntax:

change
  sed -i "/^# /d" "${outfile}"
to
  sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
Steps To ReproduceOn a FreeBSD system:
$ cat - <<EOF >temp.tmp
> # comment line
> Non comment line
> EOF
$ sed -i "/^# /d" temp.tmp
sed: 1: "temp.tmp": undefined label 'emp.tmp'
$ sed "/^# /d" temp.tmp >temp.tmp.tmp && mv temp.tmp.tmp temp.tmp
$ cat temp.tmp
Non comment line
TagsFreeBSD
FreeCAD InformationOS: FreeBSD 11.4-RELEASE-p6 (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.b2ca86d8d
Build type: Release
Python version: 3.7.9
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.0
Locale: C/Default (C)

Activities

garya

2021-03-06 18:24

reporter  

patch-cMake_FindPySide2Tools.cmake (1,003 bytes)   
--- cMake/FindPySide2Tools.cmake.orig	2021-03-05 13:59:26 UTC
+++ cMake/FindPySide2Tools.cmake
@@ -58,7 +58,7 @@ MACRO(PYSIDE_WRAP_UI outfiles)
         # we follow the tool command with in-place sed.
         ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
           COMMAND "${PYSIDE2UICBINARY}" ${UICOPTIONS} "${infile}" -o "${outfile}"
-          COMMAND sed -i "/^# /d" "${outfile}"
+          COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
           MAIN_DEPENDENCY "${infile}"
         )
     endif()
@@ -85,7 +85,7 @@ MACRO(PYSIDE_WRAP_RC outfiles)
         # we follow the tool command with in-place sed.
         ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
           COMMAND "${PYSIDE2RCCBINARY}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
-          COMMAND sed -i "/^# /d" "${outfile}"
+          COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
           MAIN_DEPENDENCY "${infile}"
         )
     endif()

Kunda1

2021-03-06 20:00

administrator   ~0015491

FreeCAD Pull Request 4592

Kunda1

2021-03-08 13:26

administrator   ~0015495

FreeCAD master 971bb669
Waiting for SI plugin to close this ticket.

guest

2021-03-08 13:30

viewer   ~0015496

Fix committed to master branch.

Kunda1

2021-03-11 19:35

administrator   ~0015500

SI didn't close ticket :(
Closing manually

Related Changesets

FreeCAD: master 971bb669

2021-03-07 10:52:27

luz paz


Committer: wwmayer Details Diff
CMake: correct non-POSIX friendly 'sed-i' arg in FindPySide2Tools.cmake

resolves 0004588
ticket: https://tracker.freecadweb.org/view.php?id=4588
Patch provided by 'garya'
Tweaked comment to reflect the patch change. [skip ci]
Affected Issues
0004588
mod - cMake/FindPySide2Tools.cmake Diff File

Issue History

Date Modified Username Field Change
2021-03-06 18:24 garya New Issue
2021-03-06 18:24 garya File Added: patch-cMake_FindPySide2Tools.cmake
2021-03-06 20:00 Kunda1 Note Added: 0015491
2021-03-06 20:00 Kunda1 Assigned To => Kunda1
2021-03-06 20:00 Kunda1 Status new => assigned
2021-03-08 13:26 Kunda1 Note Added: 0015495
2021-03-08 13:27 Kunda1 Tag Attached: FreeBSD
2021-03-08 13:27 Kunda1 Tag Attached: #tobeclosed
2021-03-08 13:30 Changeset attached => FreeCAD master 971bb669
2021-03-08 13:30 guest Note Added: 0015496
2021-03-11 19:35 Kunda1 Status assigned => closed
2021-03-11 19:35 Kunda1 Resolution open => fixed
2021-03-11 19:35 Kunda1 Fixed in Version => 0.19
2021-03-11 19:35 Kunda1 Note Added: 0015500
2021-03-11 19:43 Kunda1 Tag Detached: #tobeclosed