Skip to contentSkip to conversation

cmake-native: Enable ccmake by default and depend on ncurses

PATCH In review Nathan Rossi 3 participants 10 messages Apr 3, 2019 – Apr 5, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 cmake-native: Enable ccmake by default and depend on ncurses

Enable the building of the curses based ui for cmake. This depends on ncurses.

---
This patch suggests enabling this in the cmake-native recipe, however this might be undesirable for bootstrapping reasons. Whilst ccmake is not used normally the added dependency on ncurses is likely required for other parts of the build so impact on build ordering and time should be relatively minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +2 -3
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"
 
 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \
@@ -13,10 +13,9 @@ SRC_URI += "file://OEToolchainConfig.cmake \
 B = "${WORKDIR}/build"
 do_configure[cleandirs] = "${B}"
 
-# Disable ccmake since we don't depend on ncurses
 CMAKE_EXTRACONF = "\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \

---
2.20.1

#1 lore raw

PATCH v2 2/3 ccmake.bbclass: Create a cml1 style class for the CMake curses UI

The ccmake bbclass implements two tasks. The first task 'ccmake' preserves the configured state of CMakeCache.txt (generated from the configure task) and invokes the 'ccmake' program within a oe_terminal execution. The user can then review, select and modify configuration options and once satisfied with the configuration exit ccmake. Once ccmake has exited the build can be run and the updated configuration should be reflected in the output build.

The ccmake bbclass has a second task 'ccmake_diffconfig' to compute the differences in configuration which was modified by ccmake. Since there are many ways to persist the configuration changes within recipes and layer configuration, the differences are emitted as a bitbake recipe fragment (configuration.inc) using EXTRA_OECMAKE as well as a CMake script file which can be used as a input to cmake via the '-C' argument. Both files are generated in the WORKDIR of the build and the paths to the files are written as output from the build. It is then up to the user to take this configuration and apply it to the desired location.

---
Changes in v2:
- Fix up bb.fatal using format of undefined variable 'e'
- Fix up indentation of else case "No configuration differences" message

---
 meta/classes/ccmake.bbclass | 97 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)
 create mode 100644 meta/classes/ccmake.bbclass
meta/classes/ccmake.bbclass new file +97 -0
new file mode 100644
index 0000000000..4114daa61b
@@ -0,0 +1,97 @@
+inherit terminal
+
+python do_ccmake() {
+    import shutil
+
+    # copy current config for diffing
+    config = os.path.join(d.getVar("B"), "CMakeCache.txt")
+    if os.path.exists(config):
+        shutil.copy(config, config + ".orig")
+
+    oe_terminal(d.expand("ccmake ${OECMAKE_GENERATOR_ARGS} ${OECMAKE_SOURCEPATH} -Wno-dev"),
+        d.getVar("PN") + " - ccmake", d)
+
+    if os.path.exists(config) and os.path.exists(config + ".orig"):
+        if bb.utils.md5_file(config) != bb.utils.md5_file(config + ".orig"):
+            # the cmake class uses cmake --build, which will by default
+            # regenerate configuration, simply mark the compile step as tainted
+            # to ensure it is re-run
+            bb.note("Configuration changed, recompile will be forced")
+            bb.build.write_taint('do_compile', d)
+
+}
+do_ccmake[depends] += "cmake-native:do_populate_sysroot"
+do_ccmake[nostamp] = "1"
+do_ccmake[dirs] = "${B}"
+addtask ccmake after do_configure
+
+def cmake_parse_config_cache(path):
+    with open(path, "r") as f:
+        for i in f:
+            i = i.rstrip("\n")
+            if len(i) == 0 or i.startswith("//") or i.startswith("#"):
+                continue # empty or comment
+            key, value = i.split("=", 1)
+            key, keytype = key.split(":")
+            if keytype in ["INTERNAL", "STATIC"]:
+                continue # skip internal and static config options
+            yield key, keytype, value
+
+def cmake_diff_config_vars(a, b):
+    removed, added = [], []
+
+    for ak, akt, av in a:
+        found = False
+        for bk, bkt, bv in b:
+            if bk == ak:
+                found = True
+                if bkt != akt or bv != av: # changed
+                    removed.append((ak, akt, av))
+                    added.append((bk, bkt, bv))
+                break
+        # remove any missing from b
+        if not found:
+            removed.append((ak, akt, av))
+
+    # add any missing from a
+    for bk, bkt, bv in b:
+        if not any(bk == ak for ak, akt, av in a):
+            added.append((bk, bkt, bv))
+
+    return removed, added
+
+python do_ccmake_diffconfig() {
+    import shutil
+    config = os.path.join(d.getVar("B"), "CMakeCache.txt")
+    if os.path.exists(config) and os.path.exists(config + ".orig"):
+        if bb.utils.md5_file(config) != bb.utils.md5_file(config + ".orig"):
+            # scan the changed options
+            old = list(cmake_parse_config_cache(config + ".orig"))
+            new = list(cmake_parse_config_cache(config))
+            _, added = cmake_diff_config_vars(old, new)
+
+            if len(added) != 0:
+                with open(d.expand("${WORKDIR}/configuration.inc"), "w") as f:
+                    f.write("EXTRA_OECMAKE += \" \\\n")
+                    for k, kt, v in added:
+                        escaped = v if " " not in v else "\"{0}\"".format(v)
+                        f.write("    -D{0}:{1}={2} \\\n".format(k, kt, escaped))
+                    f.write("    \"\n")
+                bb.plain("Configuration recipe fragment written to: {0}".format(d.expand("${WORKDIR}/configuration.inc")))
+
+                with open(d.expand("${WORKDIR}/site-file.cmake"), "w") as f:
+                    for k, kt, v in added:
+                        f.write("SET({0} \"{1}\" CACHE {2} "")\n".format(k, v, kt))
+                bb.plain("Configuration cmake fragment written to: {0}".format(d.expand("${WORKDIR}/site-file.cmake")))
+
+                # restore the original config
+                shutil.copy(config + ".orig", config)
+        else:
+            bb.plain("No configuration differences, skipping configuration fragment generation.")
+    else:
+        bb.fatal("No config files found. Did you run ccmake?")
+}
+do_ccmake_diffconfig[nostamp] = "1"
+do_ccmake_diffconfig[dirs] = "${B}"
+addtask ccmake_diffconfig
+

---
2.20.1

#2 lore raw

PATCH v2 3/3 devtool: standard: Handle exporting generated config fragments

In reply to Nathan Rossi

The cml1 and ccmake bbclasses generate configuration fragment source files that must be exported from the WORKDIR as a source file to be preserved across builds. This change adds detection of the current recipes inherited classes and for cml1 and ccmake classes checks for the specific generated configuration fragment files. These files are then exported by devtool and included as SRC_URI files from within the target layer.

---
Changes in v2:
- None

---
 scripts/lib/devtool/standard.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
scripts/lib/devtool/standard.py +14 -0
index ea09bbff31..0a1e329e61 100644
@@ -1328,6 +1328,20 @@ def _export_local_files(srctree, rd, destdir, srctreebase):
                 if os.path.exists(os.path.join(local_files_dir, fragment_fn)):
                     os.unlink(os.path.join(local_files_dir, fragment_fn))
 
+    # Special handling for cml1, ccmake, etc bbclasses that generated
+    # configuration fragment files that are consumed as source files
+    for frag_class, frag_name in [("cml1", "fragment.cfg"), ("ccmake", "site-file.cmake")]:
+        if bb.data.inherits_class(frag_class, rd):
+            srcpath = os.path.join(rd.getVar('WORKDIR'), frag_name)
+            if os.path.exists(srcpath):
+                if frag_name not in new_set:
+                    new_set.append(frag_name)
+                # copy fragment into destdir
+                shutil.copy2(srcpath, destdir)
+                # copy fragment into local files if exists
+                if os.path.isdir(local_files_dir):
+                    shutil.copy2(srcpath, local_files_dir)
+
     if new_set is not None:
         for fname in new_set:
             if fname in existing_files:

---
2.20.1

#3 lore raw
In reply to Nathan Rossi
Quoted 3 lines

Enable the building of the curses based ui for cmake. This depends on ncurses.

I think this is acceptable. It might also be useful for people wanting to use ccmake inside an SDK.

Quoted 48 lines

---
This patch suggests enabling this in the cmake-native recipe, however this might be undesirable for bootstrapping reasons. Whilst ccmake is not used normally the added dependency on ncurses is likely required for other parts of the build so impact on build ordering and time should be relatively minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -1
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native

curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"

 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \ @@ -13,10 +13,9 @@ SRC_URI +=

"file://OEToolchainConfig.cmake \ B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

-# Disable ccmake since we don't depend on ncurses CMAKE_EXTRACONF =

"\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +1 -2
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
---

2.20.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
Quoted 7 lines · Pascal
Quoted 4 lines

Enable the building of the curses based ui for cmake. This depends on ncurses.

I think this is acceptable. It might also be useful for people wanting to use ccmake inside an SDK.

Adding dependencies do serialize builds and might have penalty on build time, better is to turn this into a packageconfig option and keep it disabled by default.

Quoted 53 lines
Quoted 42 lines

---
This patch suggests enabling this in the cmake-native recipe, however this might be undesirable for bootstrapping reasons. Whilst ccmake is not used normally the added dependency on ncurses is likely required for other parts of the build so impact on build ordering and time should be relatively minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -1
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native

curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"

 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \ @@ -13,10 +13,9 @@ SRC_URI +=

"file://OEToolchainConfig.cmake \ B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

-# Disable ccmake since we don't depend on ncurses CMAKE_EXTRACONF =

"\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +1 -2
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
---
Quoted 6 lines

2.20.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#5 lore raw
Quoted 8 lines · Khem Raj
Quoted 6 lines · Pascal
Quoted 4 lines

Enable the building of the curses based ui for cmake. This depends on ncurses.

I think this is acceptable. It might also be useful for people wanting to use ccmake inside an SDK.

Just to be clear, this change only affects cmake-native, the recipe for target/nativesdk is unchanged. Although interestingly the cmake (target/nativesdk) recipe already depends on ncurses (despite disabling ccmake).

Quoted 5 lines
Quoted 1 line

Adding dependencies do serialize builds and might have penalty on build time, better is to turn this into a packageconfig option and keep it disabled by default.

I can rework this patch to make it a PACKAGECONFIG option. However the reason for enabling ccmake by default is due to the addition of the ccmake bbclass in this series, which relies on having ccmake available in the native sysroot. Having to override PACKAGECONFIG to use the ccmake class seemed broken (since it is not particularly a distro config).

I could not find a good example of this sort of requirement for configuration for any other bbclass except for maybe gobject-introspection (which relies on qemu-native configured correctly to have linux-user for the target).

Another approach I considered to have this working without requiring the user to setup PACKAGECONFIG would be to have a "ccmake-native" recipe which built the ccmake binary. But this seemed like it would be extra maintenance burden compared to this patch which has minimal build time overhead.

Regards,
Nathan

Quoted 54 lines
Quoted 54 lines
Quoted 43 lines

---
This patch suggests enabling this in the cmake-native recipe, however this might be undesirable for bootstrapping reasons. Whilst ccmake is not used normally the added dependency on ncurses is likely required for other parts of the build so impact on build ordering and time should be relatively minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -1
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native

curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"

 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \ @@ -13,10 +13,9 @@ SRC_URI +=

"file://OEToolchainConfig.cmake \ B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

-# Disable ccmake since we don't depend on ncurses CMAKE_EXTRACONF =

"\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +1 -2
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
---
Quoted 6 lines

2.20.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#6 lore raw
Quoted 34 lines · Nathan Rossi
Quoted 8 lines · Khem Raj
Quoted 6 lines · Pascal
Quoted 4 lines

Enable the building of the curses based ui for cmake. This depends on ncurses.

I think this is acceptable. It might also be useful for people wanting to use ccmake inside an SDK.

Just to be clear, this change only affects cmake-native, the recipe for target/nativesdk is unchanged. Although interestingly the cmake (target/nativesdk) recipe already depends on ncurses (despite disabling ccmake).

Quoted 5 lines
Quoted 1 line

Adding dependencies do serialize builds and might have penalty on build time, better is to turn this into a packageconfig option and keep it disabled by default.

I can rework this patch to make it a PACKAGECONFIG option. However the reason for enabling ccmake by default is due to the addition of the ccmake bbclass in this series, which relies on having ccmake available in the native sysroot. Having to override PACKAGECONFIG to use the ccmake class seemed broken (since it is not particularly a distro config).

I could not find a good example of this sort of requirement for configuration for any other bbclass except for maybe gobject-introspection (which relies on qemu-native configured correctly to have linux-user for the target).

Quoted 6 lines

Another approach I considered to have this working without requiring the user to setup PACKAGECONFIG would be to have a "ccmake-native" recipe which built the ccmake binary. But this seemed like it would be extra maintenance burden compared to this patch which has minimal build time overhead.

this seems fine, if the number of recipes needing this bbclass are far less than one the needing cmake bbclass.

Quoted 57 lines

Regards,
Nathan

Quoted 54 lines
Quoted 54 lines
Quoted 43 lines

---
This patch suggests enabling this in the cmake-native recipe, however this might be undesirable for bootstrapping reasons. Whilst ccmake is not used normally the added dependency on ncurses is likely required for other parts of the build so impact on build ordering and time should be relatively minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -1
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native

curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"

 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \ @@ -13,10 +13,9 @@ SRC_URI +=

"file://OEToolchainConfig.cmake \ B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

-# Disable ccmake since we don't depend on ncurses CMAKE_EXTRACONF =

"\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +1 -2
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
---
Quoted 6 lines

2.20.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#7 lore raw
Quoted 43 lines · Khem Raj
Quoted 34 lines · Nathan Rossi
Quoted 8 lines · Khem Raj
Quoted 6 lines · Pascal
Quoted 4 lines

Enable the building of the curses based ui for cmake. This depends on ncurses.

I think this is acceptable. It might also be useful for people wanting to use ccmake inside an SDK.

Just to be clear, this change only affects cmake-native, the recipe for target/nativesdk is unchanged. Although interestingly the cmake (target/nativesdk) recipe already depends on ncurses (despite disabling ccmake).

Quoted 5 lines
Quoted 1 line

Adding dependencies do serialize builds and might have penalty on build time, better is to turn this into a packageconfig option and keep it disabled by default.

I can rework this patch to make it a PACKAGECONFIG option. However the reason for enabling ccmake by default is due to the addition of the ccmake bbclass in this series, which relies on having ccmake available in the native sysroot. Having to override PACKAGECONFIG to use the ccmake class seemed broken (since it is not particularly a distro config).

I could not find a good example of this sort of requirement for configuration for any other bbclass except for maybe gobject-introspection (which relies on qemu-native configured correctly to have linux-user for the target).

Quoted 6 lines

Another approach I considered to have this working without requiring the user to setup PACKAGECONFIG would be to have a "ccmake-native" recipe which built the ccmake binary. But this seemed like it would be extra maintenance burden compared to this patch which has minimal build time overhead.

Quoted 2 lines

this seems fine, if the number of recipes needing this bbclass are far less than one the needing cmake bbclass.

Just to clarify, are you suggesting that making a ccmake-native recipe would be fine? Or that requiring the PACKAGECONFIG setup would be acceptable/preferred?

Thanks,
Nathan

Quoted 58 lines
Quoted 58 lines

Regards,
Nathan

Quoted 54 lines
Quoted 54 lines
Quoted 43 lines

---
This patch suggests enabling this in the cmake-native recipe, however this might be undesirable for bootstrapping reasons. Whilst ccmake is not used normally the added dependency on ncurses is likely required for other parts of the build so impact on build ordering and time should be relatively minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -1
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native

curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"

 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \ @@ -13,10 +13,9 @@ SRC_URI +=

"file://OEToolchainConfig.cmake \ B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

-# Disable ccmake since we don't depend on ncurses CMAKE_EXTRACONF =

"\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +1 -2
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
---
Quoted 6 lines

2.20.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#8 lore raw
Quoted 48 lines · Nathan Rossi
Quoted 2 lines · Khem Raj

On Wed, Apr 3, 2019 at 8:28 PM Nathan Rossi <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines · Khem Raj
Quoted 2 lines

On Wed, Apr 3, 2019 at 2:26 AM Bach, Pascal <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Enable the building of the curses based ui for cmake. This

depends on

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

ncurses.

I think this is acceptable. It might also be useful for people

wanting to use ccmake inside an SDK.

Quoted 31 lines
Quoted 30 lines

Just to be clear, this change only affects cmake-native, the recipe for target/nativesdk is unchanged. Although interestingly the cmake (target/nativesdk) recipe already depends on ncurses (despite disabling ccmake).

Quoted 5 lines
Quoted 1 line

Adding dependencies do serialize builds and might have penalty on build time, better is to turn this into a packageconfig option and keep it disabled by default.

I can rework this patch to make it a PACKAGECONFIG option. However the reason for enabling ccmake by default is due to the addition of the ccmake bbclass in this series, which relies on having ccmake available in the native sysroot. Having to override PACKAGECONFIG to use the ccmake class seemed broken (since it is not particularly a distro config).

I could not find a good example of this sort of requirement for configuration for any other bbclass except for maybe gobject-introspection (which relies on qemu-native configured correctly to have linux-user for the target).

Another approach I considered to have this working without requiring the user to setup PACKAGECONFIG would be to have a "ccmake-native" recipe which built the ccmake binary. But this seemed like it would be extra maintenance burden compared to this patch which has minimal build time overhead.

Quoted 7 lines
Quoted 1 line

this seems fine, if the number of recipes needing this bbclass are far

less than

Quoted 1 line

one the needing cmake bbclass.

Just to clarify, are you suggesting that making a ccmake-native recipe would be fine? Or that requiring the PACKAGECONFIG setup would be acceptable/preferred?

I don’t have enough of data to lean on either way
Are we adding this to every cmake using recipes benefit or is it only a handful

Quoted 72 lines

Thanks,
Nathan

Quoted 8 lines
Quoted 8 lines

Regards,
Nathan

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

---
This patch suggests enabling this in the cmake-native recipe,

however this

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

might be undesirable for bootstrapping reasons. Whilst ccmake is

not used

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

normally the added dependency on ncurses is likely required for

other parts

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

of the build so impact on build ordering and time should be

relatively

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -0
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

meta/recipes-devtools/cmake/cmake-native_3.14.0.bb line 4

Quoted 1 line
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -1
-DEPENDS += "bzip2-replacement-native expat-native xz-native

zlib-native

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native

zlib-native

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

curl-native ncurses-native"

 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \ @@ -13,10 +13,9 @@

SRC_URI +=

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

"file://OEToolchainConfig.cmake \ B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

-# Disable ccmake since we don't depend on ncurses

CMAKE_EXTRACONF =

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 8 lines
"\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +1 -2
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
---
Quoted 6 lines

2.20.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#9 lore raw
Quoted 52 lines · Khem Raj
Quoted 48 lines · Nathan Rossi
Quoted 45 lines · Khem Raj
Quoted 34 lines · Nathan Rossi
Quoted 8 lines · Khem Raj
Quoted 6 lines · Pascal
Quoted 4 lines

Enable the building of the curses based ui for cmake. This depends on ncurses.

I think this is acceptable. It might also be useful for people wanting to use ccmake inside an SDK.

Just to be clear, this change only affects cmake-native, the recipe for target/nativesdk is unchanged. Although interestingly the cmake (target/nativesdk) recipe already depends on ncurses (despite disabling ccmake).

Quoted 5 lines
Quoted 1 line

Adding dependencies do serialize builds and might have penalty on build time, better is to turn this into a packageconfig option and keep it disabled by default.

I can rework this patch to make it a PACKAGECONFIG option. However the reason for enabling ccmake by default is due to the addition of the ccmake bbclass in this series, which relies on having ccmake available in the native sysroot. Having to override PACKAGECONFIG to use the ccmake class seemed broken (since it is not particularly a distro config).

I could not find a good example of this sort of requirement for configuration for any other bbclass except for maybe gobject-introspection (which relies on qemu-native configured correctly to have linux-user for the target).

Quoted 6 lines

Another approach I considered to have this working without requiring the user to setup PACKAGECONFIG would be to have a "ccmake-native" recipe which built the ccmake binary. But this seemed like it would be extra maintenance burden compared to this patch which has minimal build time overhead.

this seems fine, if the number of recipes needing this bbclass are far less than one the needing cmake bbclass.

Quoted 7 lines
Quoted 3 lines

Just to clarify, are you suggesting that making a ccmake-native recipe would be fine? Or that requiring the PACKAGECONFIG setup would be acceptable/preferred?

I don’t have enough of data to lean on either way
Are we adding this to every cmake using recipes benefit or is it only a handful

At the moment there is no intention to enable the ccmake bbclass in any general or board sense. Mainly leaving it as a per recipe opt in for recipes where user configuration is desired.

Thanks,
Nathan

Quoted 64 lines
Quoted 64 lines

Thanks,
Nathan

Quoted 58 lines
Quoted 58 lines

Regards,
Nathan

Quoted 54 lines
Quoted 54 lines
Quoted 43 lines

---
This patch suggests enabling this in the cmake-native recipe, however this might be undesirable for bootstrapping reasons. Whilst ccmake is not used normally the added dependency on ncurses is likely required for other parts of the build so impact on build ordering and time should be relatively minimal.

Changes in v2:
- None

---
 meta/recipes-devtools/cmake/cmake-native_3.14.0.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +0 -1
index fedcf3d4bd..b2952ee5f5 100644
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native

curl-native"
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"

 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \ @@ -13,10 +13,9 @@ SRC_URI +=

"file://OEToolchainConfig.cmake \ B = "${WORKDIR}/build"
do_configure[cleandirs] = "${B}"

-# Disable ccmake since we don't depend on ncurses CMAKE_EXTRACONF =

"\
     -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
meta/recipes-devtools/cmake/cmake-native_3.14.0.bb +1 -2
-    -DBUILD_CursesDialog=0 \
+    -DBUILD_CursesDialog=1 \
     -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
     -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
---
Quoted 6 lines

2.20.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core