Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rattler-build #141

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

rattler-build #141

wants to merge 6 commits into from

Conversation

looooo
Copy link
Contributor

@looooo looooo commented Dec 28, 2024

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-admin
Copy link
Contributor

conda-forge-admin commented Dec 28, 2024

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe/recipe.yaml) and found some lint.

Here's what I've got...

For recipe/recipe.yaml:

  • ❌ There are 1 too many lines. There should be one empty line at the end of the file.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/12537229792. Examine the logs at this URL for more detail.

@looooo
Copy link
Contributor Author

looooo commented Dec 28, 2024

@conda-forge/rattler-build I wasn't able to convert the recipe with conda-recipe-manager, so I tried it manually but now I get this error when trying to rerender:

 File "/home/lo/.pixi/envs/conda/lib/python3.12/site-packages/rattler_build_conda_compat/jinja/jinja.py", line 117, in render_recipe_with_context
    rendered_content = template.render(context_variables)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lo/.pixi/envs/conda/lib/python3.12/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
  File "/home/lo/.pixi/envs/conda/lib/python3.12/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 6, in top-level template code
  File "/home/lo/.pixi/envs/conda/lib/python3.12/site-packages/jinja2/sandbox.py", line 319, in getattr
    value = getattr(obj, attribute)
            ^^^^^^^^^^^^^^^^^^^^^^^
jinja2.exceptions.UndefinedError: 'context' is undefined
``

version: 1.1dev

package:
name: ${{ context.name }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be just ${{ name }}

@wolfv
Copy link
Member

wolfv commented Dec 29, 2024

@looooo I made a few modifications to the recipe.yaml (pasted below). The remaining issue is that rattler-build currently enforces a sha256 hash for url sources. Is that a problem for the weekly releases?

In if: ... conditions, no ${{ ... }} is needed (it's always evaluated as a expression.

context:
  name: freecad
  version: 1.1dev
  build_number: 0

package:
  name: ${{ name }}
  version: ${{ version }}

source:
  - url: https://github.com/FreeCAD/FreeCAD-Bundle/releases/download/weekly-builds/freecad_source.tar.gz
    file_name: freecad_source_${{ build_number }}.tar.gz
    patches:
      - if: osx and arm64
        then:
          - patches/osx_arm64_cross_compiling.patch

build:
  number: ${{ build_number }}

requirements:
  build:
    - ${{ compiler("cxx") }}
    - ${{ stdlib("c") }}
    - if: build_platform != target_platform
      then:
        - python                             
        - cross-python
        - pybind11    
        - qt6-main
        - noqt5
    - if: linux
      then:
        - ${{ cdt('mesa-libgl-devel') }}
        - ${{ cdt('mesa-dri-drivers') }}
        - ${{ cdt('mesa-libegl-devel') }}
        - ${{ cdt('libselinux') }}
        - ${{ cdt('libxdamage') }}
        - ${{ cdt('libxfixes') }} 
        - ${{ cdt('libxxf86vm') }}
        - ${{ cdt('libxcb') }}
        - ${{ cdt('libxext') }}
        - ${{ cdt('xorg-x11-server-xvfb') }}
        - ${{ cdt('libxau') }}
        - ${{ cdt('libxi-devel') }}
    - if: unix
      then:
        - sed
    - cmake
    - swig
    - ninja
    - doxygen
  host:
    - if: linux
      then:
        - libspnav
    - coin3d
    - eigen
    - freetype
    - hdf5
    - libboost-devel
    - matplotlib-base
    - noqt5
    - occt
    - pcl
    - pivy
    - ply
    - pybind11
    - pyside6
    - python
    - qt6-main
    - six
    - smesh
    - vtk
    - xerces-c
    - yaml-cpp
    - zlib
  run:    
    - if: linux
      then:
        - libspnav
    - graphviz
    - gmsh
    - numpy
    - python
    - pyside6
    - pivy
    - pyyaml
    - ply
    - six

tests:
  - script:
     - freecadcmd -t 0

about:
  homepage: https://www.freecad.org/
  license: LGPL-2.1-or-later
  license_file: LICENSE
  summary: 'FreeCAD is a parametric 3D modeler made primarily to design real-life objects of any size.'
  description: |
    FreeCAD is a general purpose feature-based, parametric 3D modeler for
    CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering
    and product design but also fits a wider range of uses in engineering,
    such as architecture or other engineering specialties. It is 100% Open
    Source (LGPL2+ license) and extremely modular, allowing for very
    advanced extension and customization.
    FreeCAD is based on OpenCASCADE, a powerful geometry kernel, features an
    Open Inventor-compliant 3D scene representation model provided by the
    Coin 3D library, and a broad Python API. The interface is built with Qt.
    FreeCAD runs exactly the same way on Windows, Mac OSX, BSD and Linux
    platforms.
  documentation: https://wiki.freecad.org/Main_Page
  repository: https://github.com/FreeCAD/FreeCAD

extra:
  recipe-maintainers:
    - adrianinsaval
    - looooo

@looooo
Copy link
Contributor Author

looooo commented Dec 29, 2024

do not merge. this will go into a different branch (not conda)

@looooo
Copy link
Contributor Author

looooo commented Dec 29, 2024

thanks @wolfv for correcting my recipe. There is one follow up question I have:
how to skip the builds for py != 312. I tried with:

build:
  number: ${{ build_number }}
  skip:
    - py != 3.12

Rerendering run without error but no ci_scripts were generated.

@wolfv
Copy link
Member

wolfv commented Dec 30, 2024

It has to be if: match(python, "==3.12")

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I was trying to look for recipes to lint for you, but it appears we have a merge conflict. Please try to merge or rebase with the base branch to resolve this conflict.

Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug.

@looooo
Copy link
Contributor Author

looooo commented Jan 1, 2025

@wolfv I tried with your suggestion, but it didn't work:
is this the correct syntax for building only py313?

build:
  number: ${{ build_number }}
  skip:
    - if: match(python, "!=3.13")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants