Skip to content

Conversation

@jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Feb 25, 2025

Pull request overview

Description of the purpose of this PR

Test release on my fork at https://github.com/jmarrec/EnergyPlus/releases/tag/v25.1.0-IOFreeze-Ubuntu-arm64-macfixup

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus AuxiliaryTool Related to an auxiliary tool, not EnergyPlus itself (readvars, preprocessor, ep-launch, etc.) Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) labels Feb 25, 2025
@jmarrec jmarrec self-assigned this Feb 25, 2025
@Myoldmopar
Copy link
Member

  • Reverted some of the shenanigans @Myoldmopar had to do to release IOFreeze

Shenanigans!??? Don't you mean incredibly brave and clever workarounds?

Comment on lines +8 to +13
inputs:
BUILD_DOCS:
description: 'Whether to build docs or not as it takes 15 minutes to install MacTex'
required: true
type: boolean
default: false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bonus: on workflow_dispatch, ask if BUILD_DOCS should be enabled or not. Avoids having to tweak the workflow file to turn it off.

Copy link
Member

Choose a reason for hiding this comment

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

Beautiful. Should we do this on all of them? I could imagine setting up a very generic build workflow where you provide a bunch of switches or CMake args to configure basically the whole build like a normal local setup. That way we could quickly set a specific configuration with caching/python linking/etc. Anyway, this is great.

Comment on lines +32 to +39
macos_dev_target: [12.1, 13.0]
include:
# - macos_dev_target: 12.1
# os: macos-12
# allow_failure: false
# arch: x86_64
# python-arch: x64
# pretty: "Mac x64"
- macos_dev_target: 12.1
os: macos-13
allow_failure: false
arch: x86_64
python-arch: x64
pretty: "Mac x64"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revert the commenting out from @Myoldmopar . hopefully I caught everything that needed reverting...

Copy link
Member

Choose a reason for hiding this comment

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

I'm sure it's fine.

- name: Set up Python ${{ env.Python_REQUIRED_VERSION }}
id: setup-python
uses: jmarrec/setup-python@v5
uses: jmarrec/setup-python@v5.4.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using my new python binaries

Copy link
Member

Choose a reason for hiding this comment

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

You are a great hero in properly building out the Python versions we need. It's annoying that we do need them, but I appreciate you handling that.

Comment on lines +132 to +135
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
BUILD_DOCS="${{ inputs.BUILD_DOCS }}"
echo "BUILD_DOCS=$BUILD_DOCS" >> $GITHUB_ENV
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Overwrite env.BUILD_DOCS when workflow_dispatch

push:
tags:
- '*'
workflow_dispatch:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added workflow_dispatch events for linux and windows too. Useful when testing instead of having to tag a release.

Copy link
Member

Choose a reason for hiding this comment

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

That's really great, but how does that work with the upload-release-action? That's why I hadn't done this in the past, I assumed it would require some logic down in the workflow to handle whether it was a release or just an artifact.

with:
name: energyplus-${{ matrix.os }}
path: build/EnergyPlus-*-x86_64.tar.gz
path: build/EnergyPlus-*-${{ matrix.arch }}.tar.gz
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

Comment on lines +149 to +152
- os: ubuntu-22.04-arm
test_key: ubuntu2204-arm64
- os: ubuntu-24.04-arm
test_key: ubuntu2404-arm64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test the arm ones too

# python-arch: x64
# pretty: "Mac x64"
- macos_dev_target: 12.1
os: macos-13
Copy link
Contributor Author

Choose a reason for hiding this comment

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

macos-12 is bye bye. macos-13 is the last x86_64 machine available for macOS

Copy link
Member

Choose a reason for hiding this comment

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

👍 And what's the EOL for macos-13 I wonder. Will they keep it around a while to support an x86_64 Mac?

Anyway, good stuff.

Comment on lines -144 to -146
# as a very quick test, I wonder what happens if we just let it continue without this dep...I'll force fail the workflow as a reminder
sys.exit(0)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove

Comment on lines +92 to +97
'ubuntu2204-arm64': {
'os': OS.Linux, 'bitness': 'arm64', 'asset_pattern': 'Linux-Ubuntu22.04-arm64.tar.gz', 'os_version': '22.04'
},
'ubuntu2404-arm64': {
'os': OS.Linux, 'bitness': 'arm64', 'asset_pattern': 'Linux-Ubuntu24.04-arm64.tar.gz', 'os_version': '24.04'
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New test keys.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@jmarrec
Copy link
Contributor Author

jmarrec commented Feb 25, 2025

Before fix: with v25.1.0-IOFreeze

aria2c https://github.com/NREL/EnergyPlus/releases/download/v25.1.0-IOFreeze/EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64.tar.gz
sudo xattr -d com.apple.quarantine EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64.tar.gz
tar xfz EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64.tar.gz

./EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64/energyplus auxiliary eplaunch
Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "/Users/julien/Downloads/temp/python/EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64/python_lib/eplaunch/tk_runner.py", line 1, in <module>
    from eplaunch.interface.frame_main import EPLaunchWindow
  File "/Users/julien/Downloads/temp/python/EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64/python_lib/eplaunch/interface/__init__.py", line 4, in <module>
    from tkinter import PhotoImage, Tk, Toplevel
  File "/Users/julien/Downloads/temp/python/EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64/python_lib/tkinter/__init__.py", line 38, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
    ^^^^^^^^^^^^^^^
ImportError: dlopen(/Users/julien/Downloads/temp/python/EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64/python_lib/lib-dynload/_tkinter.cpython-312-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib
  Referenced from: <C66EF5E9-817E-3F86-B278-F1BA42A0A80D> /Users/julien/Downloads/temp/python/EnergyPlus-25.1.0-46864d6807-Darwin-macOS13-arm64/python_lib/lib-dynload/_tkinter.cpython-312-darwin.so
  Reason: tried: '/opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib' (no such file), '/opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib' (no such file), '/opt/homebrew/Cellar/tcl-tk/9.0.1/lib/libtcl8.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/tcl-tk/9.0.1/lib/libtcl8.6.dylib' (no such file), '/opt/homebrew/Cellar/tcl-tk/9.0.1/lib/libtcl8.6.dylib' (no such file)
libc++abi: terminating due to uncaught exception of type std::runtime_error: Error executing Python code
Abort trap: 6

After fix: on my release

aria2c https://github.com/jmarrec/EnergyPlus/releases/download/v25.1.0-IOFreeze-Ubuntu-arm64-macfixup/EnergyPlus-25.1.0-ab8eee336c-Darwin-macOS13-arm64.tar.gz
sudo xattr -d com.apple.quarantine EnergyPlus-25.1.0-ab8eee336c-Darwin-macOS13-arm64.tar.gz

./EnergyPlus-25.1.0-ab8eee336c-Darwin-macOS13-arm64/energyplus auxiliary eplaunch
image

@jmarrec jmarrec requested a review from Myoldmopar February 25, 2025 18:56
Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

This is awesome. Thank you @jmarrec!

push:
tags:
- '*'
workflow_dispatch:
Copy link
Member

Choose a reason for hiding this comment

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

That's really great, but how does that work with the upload-release-action? That's why I hadn't done this in the past, I assumed it would require some logic down in the workflow to handle whether it was a release or just an artifact.

Comment on lines +24 to +39
- os: ubuntu-22.04
pretty: "Ubuntu 22.04"
arch: x86_64
python-arch: x64
- os: ubuntu-24.04
pretty: "Ubuntu 24.04"
arch: x86_64
python-arch: x64
- os: ubuntu-22.04-arm
pretty: "Ubuntu 22.04 arm64"
arch: arm64
python-arch: arm64
- os: ubuntu-24.04-arm
pretty: "Ubuntu 24.04 arm64"
arch: arm64
python-arch: arm64
Copy link
Member

Choose a reason for hiding this comment

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

Got it. This is good stuff. I was kinda surprised to see 22.04 added in here, but hey it's fine for a while.

- name: Set up Python ${{ env.Python_REQUIRED_VERSION }}
id: setup-python
uses: jmarrec/setup-python@v5
uses: jmarrec/setup-python@v5.4.0
Copy link
Member

Choose a reason for hiding this comment

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

Yes, very good. Very good.

uses: jmarrec/setup-qtifw@v1
with:
qtifw-version: '4.6.1'
qtifw-version: '4.8.1'
Copy link
Member

Choose a reason for hiding this comment

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

Got it. And we are using your fork because they didn't take your PR to pass arguments down into binarycreator, right? Or something like that? Over time it would be really great to get back to mainline actions so we don't have to rely on custom built ones, but I do appreciate your patches to them.

Comment on lines +8 to +13
inputs:
BUILD_DOCS:
description: 'Whether to build docs or not as it takes 15 minutes to install MacTex'
required: true
type: boolean
default: false
Copy link
Member

Choose a reason for hiding this comment

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

Beautiful. Should we do this on all of them? I could imagine setting up a very generic build workflow where you provide a bunch of switches or CMake args to configure basically the whole build like a normal local setup. That way we could quickly set a specific configuration with caching/python linking/etc. Anyway, this is great.

Comment on lines +32 to +39
macos_dev_target: [12.1, 13.0]
include:
# - macos_dev_target: 12.1
# os: macos-12
# allow_failure: false
# arch: x86_64
# python-arch: x64
# pretty: "Mac x64"
- macos_dev_target: 12.1
os: macos-13
allow_failure: false
arch: x86_64
python-arch: x64
pretty: "Mac x64"
Copy link
Member

Choose a reason for hiding this comment

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

I'm sure it's fine.

- name: Set up Python ${{ env.Python_REQUIRED_VERSION }}
id: setup-python
uses: jmarrec/setup-python@v5
uses: jmarrec/setup-python@v5.4.0
Copy link
Member

Choose a reason for hiding this comment

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

You are a great hero in properly building out the Python versions we need. It's annoying that we do need them, but I appreciate you handling that.

uses: jmarrec/setup-qtifw@v1
with:
qtifw-version: '4.6.1'
qtifw-version: '4.8.1'
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Looks like it's in the April-June roadmap on GitHub Action's public roadmap. (github/roadmap#1098). So we shouldn't be waiting long.

sos = list(_python_dir.glob("lib-dynload/_tkinter*.so"))
def locate_tk_so(python_dir: Path) -> Path:
print(f"Searching for _tkinter so in {python_dir}")
sos = list(python_dir.glob("lib-dynload/_tkinter*.so"))
Copy link
Member

Choose a reason for hiding this comment

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

My renaming here was just to avoid variable shadowing from the outer scope. But that's fine, it can go back to shadowing.

Comment on lines +92 to +97
'ubuntu2204-arm64': {
'os': OS.Linux, 'bitness': 'arm64', 'asset_pattern': 'Linux-Ubuntu22.04-arm64.tar.gz', 'os_version': '22.04'
},
'ubuntu2404-arm64': {
'os': OS.Linux, 'bitness': 'arm64', 'asset_pattern': 'Linux-Ubuntu24.04-arm64.tar.gz', 'os_version': '24.04'
},
Copy link
Member

Choose a reason for hiding this comment

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

👍

@Myoldmopar
Copy link
Member

No reason to wait on this, thanks for fixing this all up @jmarrec. Merging.

@Myoldmopar Myoldmopar merged commit a25ffdb into NREL:develop Feb 26, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AuxiliaryTool Related to an auxiliary tool, not EnergyPlus itself (readvars, preprocessor, ep-launch, etc.) Defect Includes code to repair a defect in EnergyPlus Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Ubuntu arm64 workflows TCL Issue on GHA

4 participants