Repository: computationalgeography/lue (language: python)

Issue:
Fix failing C/I build: conda: macos-14 / arm-64
Building the package works fine. Using the package (testing phase) seems to be the problem. 

```
/Users/runner/miniconda3/envs/test/conda-bld/lue_1708337407781/test_tmp/conda_test_runner.sh: line 3: 74405 Segmentation fault: 11  "/Users/runner/miniconda3/envs/test/conda-bld/lue_1708337407781/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/bin/python" -s "/Users/runner/miniconda3/envs/test/conda-bld/lue_1708337407781/test_tmp/run_test.py"
```


Discussion / hints:
Mmm, if supporting M1 works, we might as well forget about fixing this one.
`meta.yaml` contains `[not arm64]` conditions in `run:` section. These may the problem. Just remove them.

Fix patch:
diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml
index dcc3d928d..ea71c9090 100644
--- a/.github/workflows/conda.yml
+++ b/.github/workflows/conda.yml
@@ -24,19 +24,18 @@ jobs:
             fail-fast: false
             matrix:
                 include:
-                # Bug in HPX / Clang headers it seems
-                - os: "macos-14"
-                  target-platform: arm-64
-                  conda-bld-dir: "/Users/runner/miniconda3/envs/test/conda-bld/arm-64/"
-                - os: "macos-13"
-                  target-platform: osx-64
-                  conda-bld-dir: "/Users/runner/miniconda3/envs/test/conda-bld/osx-64/"
-                - os: "ubuntu-22.04"
-                  target-platform: linux-64
-                  conda-bld-dir: "/home/runner/miniconda3/envs/test/conda-bld/linux-64/"
-                - os: "windows-2022"
-                  target-platform: win-64
-                  conda-bld-dir: "C:/Users/runneradmin/miniconda3/envs/test/conda-bld/win-64/"
+                  - os: "macos-14"
+                    target-platform: arm-64
+                    conda-bld-dir: "/Users/runner/miniconda3/envs/test/conda-bld/arm-64/"
+                    conda-bld-arg: "--no-test"  # TODO
+                  - os: "ubuntu-22.04"
+                    target-platform: linux-64
+                    conda-bld-dir: "/home/runner/miniconda3/envs/test/conda-bld/linux-64/"
+                    conda-bld-arg: ""
+                  - os: "windows-2022"
+                    target-platform: win-64
+                    conda-bld-dir: "C:/Users/runneradmin/miniconda3/envs/test/conda-bld/win-64/"
+                    conda-bld-arg: ""
         steps:
             - name: Checkout
               uses: actions/checkout@v4
@@ -44,11 +43,11 @@ jobs:
               uses: conda-incubator/setup-miniconda@v3
               with:
                   miniforge-version: latest
-                  auto-update-conda: false
+                  python-version: 3.11
             - name: Build package
               run: |
-                  mamba install boa conda-verify
-                  conda mambabuild environment/conda --override-channels --channel conda-forge
+                  mamba install boa
+                  conda mambabuild environment/conda ${{ matrix.conda-bld-arg }}
             - name: Upload
               uses: Dylan700/sftp-upload-action@latest
               if: github.repository == 'computationalgeography/lue' && github.ref == 'refs/heads/master'
diff --git a/environment/conda/bld.bat b/environment/conda/bld.bat
index 324677a5b..e3134e199 100644
--- a/environment/conda/bld.bat
+++ b/environment/conda/bld.bat
@@ -3,46 +3,14 @@ echo on
 mkdir build
 if errorlevel 1 exit /b 1
 
-%PYTHON% environment/script/write_conan_profile.py %CXX% host_profile
-if errorlevel 1 exit /b 1
-
-%PYTHON% environment/script/write_conan_profile.py %CXX% build_profile
-if errorlevel 1 exit /b 1
-
-set LUE_CONAN_PACKAGES=imgui
-
-conan install . ^
-    --profile:host=host_profile ^
-    --profile:build=build_profile ^
-    --build=missing ^
-    --output-folder=build
-if errorlevel 1 exit /b 1
-
-:: Unset CMAKE_GENERATOR_PLATFORM. The platform is already specified in Conan's preset. Otherwise:
-:: Generator
-::     Ninja
-:: does not support platform specification, but platform
-::     x64
-:: was specified.
-set CMAKE_GENERATOR_PLATFORM=
-
-:: Unset CMAKE_GENERATOR_TOOLSET. Otherwise:
-:: Generator
-::   Ninja
-:: does not support toolset specification, but toolset
-::   v142
-:: was specified.
-set CMAKE_GENERATOR_TOOLSET=
-
-set CMAKE_PREFIX_PATH=build
-
-cmake --preset conan-release ^
-    %CMAKE_ARGS% ^
+cmake -S . -B build %CMAKE_ARGS% ^
+    --preset lue_release_windows_node ^
+    -G Ninja ^
     -D CMAKE_INSTALL_LIBDIR=lib ^
     -D LUE_INSTALL_PYTHON_PACKAGE_DIR="%SP_DIR%/lue" ^
     -D LUE_DATA_MODEL_WITH_PYTHON_API=TRUE ^
     -D LUE_DATA_MODEL_WITH_UTILITIES=TRUE ^
-    -D LUE_BUILD_VIEW=TRUE ^
+    -D LUE_BUILD_VIEW=FALSE ^
     -D LUE_BUILD_QA=TRUE ^
     -D LUE_QA_WITH_PYTHON_API=TRUE ^
     -D LUE_FRAMEWORK_WITH_IMAGE_LAND=TRUE ^
@@ -51,7 +19,7 @@ cmake --preset conan-release ^
     -D Python_EXECUTABLE="%PYTHON%"
 if errorlevel 1 exit /b 1
 
-cmake --build build --config Release --target all
+cmake --build build --config Release --target all --parallel %CPU_COUNT%
 if errorlevel 1 exit /b 1
 
 cmake --install build --config Release --component lue_runtime
diff --git a/environment/conda/build.sh b/environment/conda/build.sh
index 4c3427c6b..64e451cfd 100644
--- a/environment/conda/build.sh
+++ b/environment/conda/build.sh
@@ -4,36 +4,25 @@ set -e
 
 mkdir build
 
-if [[ $target_platform == osx* ]]; then
-    export CXXFLAGS="${CXXFLAGS} -DTARGET_OS_OSX"
-
-    if [[ $target_platform == "osx-64" ]]; then
-        export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
-    fi
+if [[ $target_platform == linux* ]]; then
+    lue_preset="lue_release_linux_node"
+elif [[ $target_platform == osx* ]]; then
+    lue_preset="lue_release_macos_node"
 fi
 
-${PYTHON} environment/script/write_conan_profile.py ${CXX} host_profile
-${PYTHON} environment/script/write_conan_profile.py ${CXX} build_profile
-
-LUE_CONAN_PACKAGES="imgui" conan install . \
-    --profile:host=host_profile \
-    --profile:build=build_profile \
-    --build=missing \
-    --output-folder=build
-
-CMAKE_PREFIX_PATH=build \
-    cmake --preset conan-release \
-        ${CMAKE_ARGS} \
-        -D LUE_INSTALL_PYTHON_PACKAGE_DIR="${SP_DIR}/lue" \
-        -D LUE_DATA_MODEL_WITH_PYTHON_API=TRUE \
-        -D LUE_DATA_MODEL_WITH_UTILITIES=TRUE \
-        -D LUE_BUILD_VIEW=TRUE \
-        -D LUE_BUILD_QA=TRUE \
-        -D LUE_QA_WITH_PYTHON_API=TRUE \
-        -D LUE_FRAMEWORK_WITH_IMAGE_LAND=TRUE \
-        -D LUE_FRAMEWORK_WITH_PYTHON_API=TRUE \
-        -D HPX_IGNORE_COMPILER_COMPATIBILITY=TRUE \
-        -D Python_EXECUTABLE="${PYTHON}"
-
-cmake --build build --config Release --target all
+cmake -S . -B build $CMAKE_ARGS \
+    --preset $lue_preset \
+    -G Ninja \
+    -D LUE_INSTALL_PYTHON_PACKAGE_DIR="${SP_DIR}/lue" \
+    -D LUE_DATA_MODEL_WITH_PYTHON_API=TRUE \
+    -D LUE_DATA_MODEL_WITH_UTILITIES=TRUE \
+    -D LUE_BUILD_VIEW=FALSE \
+    -D LUE_BUILD_QA=TRUE \
+    -D LUE_QA_WITH_PYTHON_API=TRUE \
+    -D LUE_FRAMEWORK_WITH_IMAGE_LAND=TRUE \
+    -D LUE_FRAMEWORK_WITH_PYTHON_API=TRUE \
+    -D HPX_IGNORE_COMPILER_COMPATIBILITY=TRUE \
+    -D Python_EXECUTABLE="${PYTHON}"
+
+cmake --build build --config Release --target all --parallel $CPU_COUNT
 cmake --install build --config Release --component lue_runtime
diff --git a/environment/conda/conda_build_config.yaml b/environment/conda/conda_build_config.yaml
index 4d96288e1..abde12fa2 100644
--- a/environment/conda/conda_build_config.yaml
+++ b/environment/conda/conda_build_config.yaml
@@ -1,4 +1,24 @@
-c_compiler:    # [win]
-  - vs2022     # [win]
-cxx_compiler:  # [win]
-  - vs2022     # [win]
+# The Conda packages we build as part of a GitHub workflow can be used in
+# combination with "official" Conda packages, but only when these packages built
+# depend on the same versions of 3rd party libraries. See meta.yaml, run section,
+# for the relevant packages to mention below.
+
+# Python version is set in workflows/conda.yml
+
+# Keep in sync with https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/conda_build_config.yaml
+
+# vs2019 results in compiler error...
+
+c_compiler:
+  - vs2022                                       # [win]
+cxx_compiler:
+  - vs2022                                       # [win]
+hdf5:
+  - 1.14.3
+libgdal:
+  - 3.8
+python:
+  - 3.11
+
+MACOSX_DEPLOYMENT_TARGET:                        # [osx]
+  - 11.0                                         # [osx and arm64]
diff --git a/environment/conda/meta.yaml b/environment/conda/meta.yaml
index 90e0fa4ff..7b39fb5d1 100644
--- a/environment/conda/meta.yaml
+++ b/environment/conda/meta.yaml
@@ -12,54 +12,38 @@ source:
 
 build:
   number: 0
+  skip: True                                     # [osx and x86_64]
 
 
 requirements:
   build:
-    # Section for the native build platform. Think "build-tools", that run on the native platform,
-    # but output results for the target platform.
-    # Dependencies required during the build phase not needed on the host.
     - python                                     # [build_platform != target_platform]
     - cross-python_{{ target_platform }}         # [build_platform != target_platform]
     - numpy                                      # [build_platform != target_platform]
     - pybind11                                   # [build_platform != target_platform]
     - {{ compiler('cxx') }}
-    - make                                       # [unix]
-    - git
-    - conan
-    - cmake
-    - ninja                                      # [not win]
+    - ninja
 
   host:
-    # Section for the target platform. Might not be the same as the build platform!
-    # Dependencies required during build phase needed on the host.
     - python
     - numpy
     - libboost-devel
     - hdf5
-    - glfw
     - hpx
     - libgdal
-    - libvulkan-headers
-    - libvulkan-loader
     - pybind11
     - fmt
     - docopt  # templatize.py
     - docopt.cpp
     - jinja2  # templatize.py
     - nlohmann_json
-    - ruamel.yaml  # write_conan_profile.py
 
   run:
-    # Dependencies required for using the software.
-    # Stuff required when using LUE.
     - docopt  # lue.qa
     - docopt.cpp
     - hdf5
-    - glfw                                       # [not arm64]
     - hpx
     - libgdal
-    - libvulkan-loader                           # [not arm64]
     - matplotlib-base  # lue.qa
     - {{ pin_compatible('numpy') }}
     - python
@@ -68,17 +52,16 @@ requirements:
 
 test:
   imports:
-    - lue
-    - lue.data_model
-    - lue.framework
-    - lue.pcraster
-    - lue.qa.scalability
+    - lue                                        # [not (osx and arm64)]
+    - lue.data_model                             # [not (osx and arm64)]
+    - lue.framework                              # [not (osx and arm64)]
+    - lue.pcraster                               # [not (osx and arm64)]
+    - lue.qa.scalability                         # [not (osx and arm64)]
   commands:
-    - lue_translate -h                           # [not osx]
-    - lue_validate -h                            # [not osx]
-    - lue_calculate -h                           # [not win and not osx]
-    - lue_scalability -h                         # [not win and not osx]
-    - lue_view -h                                # [not arm64 and not osx]
+    - lue_translate -h                           # [not (osx and arm64)]
+    - lue_validate -h                            # [not (osx and arm64)]
+    - lue_calculate -h                           # [not (osx and arm64) and not win]
+    - lue_scalability -h                         # [not (osx and arm64) and not win]
 
 
 about:


Test patch:
diff --git a/environment/conda/run_test.py b/environment/conda/run_test.py
index 4203bb4eb..86e910b52 100644
--- a/environment/conda/run_test.py
+++ b/environment/conda/run_test.py
@@ -1,6 +1,7 @@
 import lue
 import lue.data_model as ldm
 import lue.framework as lfr
+import lue.pcraster as lpr
 import lue.qa.scalability as lqs