Skip to content

Instantly share code, notes, and snippets.

@traversaro
Last active January 1, 2025 15:22
Show Gist options
  • Select an option

  • Save traversaro/9e7c6059a517ed26240255a2a4d5a2d8 to your computer and use it in GitHub Desktop.

Select an option

Save traversaro/9e7c6059a517ed26240255a2a4d5a2d8 to your computer and use it in GitHub Desktop.
Reproduce missing support for handling hardcoded install prefix in CMake files in rattler-build 0.33
# SCM syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
# pixi environments
.pixi
*.egg-info
# output folder of rattler-build
output/

To reproduce, run:

pixi run reproduce
cmake_minimum_required(VERSION 3.14)
project(nonrelocatable VERSION 0.0.1 LANGUAGES NONE)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/nonrelocatableConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/nonrelocatableConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/nonrelocatable
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/nonrelocatableConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/nonrelocatable
)
c_compiler:
- ${{ "gcc" if linux }}
- ${{ "clang" if osx }}
- ${{ "vs2019" if win }}
cxx_compiler:
- ${{ "gxx" if linux }}
- ${{ "clangxx" if osx }}
- ${{ "vs2019" if win }}
BSD 3-Clause License
Copyright (c) 2018, the respective contributors, as shown by the AUTHORS file.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@PACKAGE_INIT@
set(NON_RELOCATABLE_VARIABLE @CMAKE_INSTALL_PREFIX@)
if(NOT EXISTS ${NON_RELOCATABLE_VARIABLE})
message(FATAL_ERROR "The variable NON_RELOCATABLE_VARIABLE has value ${NON_RELOCATABLE_VARIABLE} that is not an existing directory.")
else()
message(STATUS "The variable NON_RELOCATABLE_VARIABLE has value ${NON_RELOCATABLE_VARIABLE} and this is an existing directory.")
endif()
version: 6
environments:
default:
channels:
- url: https://conda.anaconda.org/conda-forge/
packages:
linux-64:
- conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
- conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2
- conda: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.12.14-hbcca054_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.4.0-hb9d3cd8_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/patchelf-0.17.2-h58526e2_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/rattler-build-0.33.1-hbcf9e9b_0.conda
osx-arm64:
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/rattler-build-0.33.1-h760a855_0.conda
win-64:
- conda: https://conda.anaconda.org/conda-forge/win-64/rattler-build-0.33.1-ha8cf89e_0.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.22621.0-h57928b3_1.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.3-ha32ba9b_23.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.42.34433-he29a5d6_23.conda
packages:
- conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726
md5: d7c89558ba9fa0495403155b64376d81
license: None
size: 2562
timestamp: 1578324546067
- conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2
build_number: 16
sha256: fbe2c5e56a653bebb982eda4876a9178aedfc2b545f25d0ce9c4c0b508253d22
md5: 73aaf86a425cc6e73fcf236a5a46396d
depends:
- _libgcc_mutex 0.1 conda_forge
- libgomp >=7.5.0
constrains:
- openmp_impl 9999
license: BSD-3-Clause
license_family: BSD
size: 23621
timestamp: 1650670423406
- conda: https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2024.12.14-hbcca054_0.conda
sha256: 1afd7274cbc9a334d6d0bc62fa760acc7afdaceb0b91a8df370ec01fd75dc7dd
md5: 720523eb0d6a9b0f6120c16b2aa4e7de
license: ISC
size: 157088
timestamp: 1734208393264
- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-14.2.0-h77fa898_1.conda
sha256: 53eb8a79365e58849e7b1a068d31f4f9e718dc938d6f2c03e960345739a03569
md5: 3cb76c3f10d3bc7f1105b2fc9db984df
depends:
- _libgcc_mutex 0.1 conda_forge
- _openmp_mutex >=4.5
constrains:
- libgomp 14.2.0 h77fa898_1
- libgcc-ng ==14.2.0=*_1
license: GPL-3.0-only WITH GCC-exception-3.1
license_family: GPL
size: 848745
timestamp: 1729027721139
- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.2.0-h69a702a_1.conda
sha256: 3a76969c80e9af8b6e7a55090088bc41da4cffcde9e2c71b17f44d37b7cb87f7
md5: e39480b9ca41323497b05492a63bc35b
depends:
- libgcc 14.2.0 h77fa898_1
license: GPL-3.0-only WITH GCC-exception-3.1
license_family: GPL
size: 54142
timestamp: 1729027726517
- conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.2.0-h77fa898_1.conda
sha256: 1911c29975ec99b6b906904040c855772ccb265a1c79d5d75c8ceec4ed89cd63
md5: cc3573974587f12dda90d96e3e55a702
depends:
- _libgcc_mutex 0.1 conda_forge
license: GPL-3.0-only WITH GCC-exception-3.1
license_family: GPL
size: 460992
timestamp: 1729027639220
- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-14.2.0-hc0a3c3a_1.conda
sha256: 4661af0eb9bdcbb5fb33e5d0023b001ad4be828fccdcc56500059d56f9869462
md5: 234a5554c53625688d51062645337328
depends:
- libgcc 14.2.0 h77fa898_1
license: GPL-3.0-only WITH GCC-exception-3.1
license_family: GPL
size: 3893695
timestamp: 1729027746910
- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.2.0-h4852527_1.conda
sha256: 25bb30b827d4f6d6f0522cc0579e431695503822f144043b93c50237017fffd8
md5: 8371ac6457591af2cf6159439c1fd051
depends:
- libstdcxx 14.2.0 hc0a3c3a_1
license: GPL-3.0-only WITH GCC-exception-3.1
license_family: GPL
size: 54105
timestamp: 1729027780628
- conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.4.0-hb9d3cd8_0.conda
sha256: 814b9dff1847b132c676ee6cc1a8cb2d427320779b93e1b6d76552275c128705
md5: 23cc74f77eb99315c0360ec3533147a9
depends:
- __glibc >=2.17,<3.0.a0
- ca-certificates
- libgcc >=13
license: Apache-2.0
license_family: Apache
size: 2947466
timestamp: 1731377666602
- conda: https://conda.anaconda.org/conda-forge/linux-64/patchelf-0.17.2-h58526e2_0.conda
sha256: eb355ac225be2f698e19dba4dcab7cb0748225677a9799e9cc8e4cadc3cb738f
md5: ba76a6a448819560b5f8b08a9c74f415
depends:
- libgcc-ng >=7.5.0
- libstdcxx-ng >=7.5.0
license: GPL-3.0-or-later
license_family: GPL
size: 94048
timestamp: 1673473024463
- conda: https://conda.anaconda.org/conda-forge/linux-64/rattler-build-0.33.1-hbcf9e9b_0.conda
sha256: fce23e047bf1eab95fe7a4591ff62b51dfde412abd20ef34323993000cb38235
md5: cbc6b1b15f46ba5e736c0b2e3f86472a
depends:
- __glibc >=2.17,<3.0.a0
- openssl >=3.4.0,<4.0a0
- patchelf
constrains:
- __glibc >=2.17
license: BSD-3-Clause
license_family: BSD
size: 11223316
timestamp: 1734956445362
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/rattler-build-0.33.1-h760a855_0.conda
sha256: e89b61fe5ea0127552ea05f00cf92c188d4155e734e3a6587726e12b9e0c5702
md5: 4a2fd9af3b609f9c78b99736086e0977
depends:
- __osx >=11.0
constrains:
- __osx >=11.0
arch: arm64
platform: osx
license: BSD-3-Clause
license_family: BSD
size: 9136714
timestamp: 1734956818450
- conda: https://conda.anaconda.org/conda-forge/win-64/rattler-build-0.33.1-ha8cf89e_0.conda
sha256: 1fa0f513b321b9746db9692865fed726968848691dc385cb334a806e1cb9e2e3
md5: 0e2118e59dfdd2364c4651a11c04e131
depends:
- ucrt >=10.0.20348.0
- vc >=14.3,<15
- vc14_runtime >=14.42.34433
license: BSD-3-Clause
license_family: BSD
size: 8886994
timestamp: 1734957175022
- conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.22621.0-h57928b3_1.conda
sha256: db8dead3dd30fb1a032737554ce91e2819b43496a0db09927edf01c32b577450
md5: 6797b005cd0f439c4c5c9ac565783700
constrains:
- vs2015_runtime >=14.29.30037
license: LicenseRef-MicrosoftWindowsSDK10
size: 559710
timestamp: 1728377334097
- conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.3-ha32ba9b_23.conda
sha256: 986ddaf8feec2904eac9535a7ddb7acda1a1dfb9482088fdb8129f1595181663
md5: 7c10ec3158d1eb4ddff7007c9101adb0
depends:
- vc14_runtime >=14.38.33135
track_features:
- vc14
license: BSD-3-Clause
license_family: BSD
size: 17479
timestamp: 1731710827215
- conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.42.34433-he29a5d6_23.conda
sha256: c483b090c4251a260aba6ff3e83a307bcfb5fb24ad7ced872ab5d02971bd3a49
md5: 32b37d0cfa80da34548501cdc913a832
depends:
- ucrt >=10.0.20348.0
constrains:
- vs2015_runtime 14.42.34433.* *_23
license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime
license_family: Proprietary
size: 754247
timestamp: 1731710681163
[project]
authors = ["Silvio Traversaro <[email protected]>"]
channels = ["conda-forge"]
description = "Add a short description here"
name = "reproduce-rattler"
platforms = ["win-64", "linux-64", "osx-arm64"]
version = "0.1.0"
[tasks]
reproduce = "rattler-build build -m ./conda_build_config.yaml"
[dependencies]
rattler-build = "*"
context:
version: "0.0.1"
package:
name: nonrelocatable
version: ${{ version }}
build:
number: 0
script:
- if: win
then: |
cmake -GNinja ^
-D BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
%RECIPE_DIR%
ninja install
else: |
cmake -GNinja \
-DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX \
$RECIPE_DIR
ninja install
requirements:
build:
- cmake
- ninja
tests:
- package_contents:
files:
- ${{ "Library/" if win }}lib/cmake/nonrelocatable/nonrelocatableConfig.cmake
- script:
- cmake-package-check nonrelocatable
requirements:
run:
- cmake-package-check
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
about:
homepage: https://github.com/xtensor-stack/xtensor
license: BSD-3-Clause
license_file: LICENSE
summary: The C++ tensor algebra library
description: Multi dimensional arrays with broadcasting and lazy computing
documentation: https://xtensor.readthedocs.io
repository: https://github.com/xtensor-stack/xtensor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment