Skip to content

Conversation

@jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Nov 25, 2025

Pull request overview

Description of the purpose of this PR

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
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

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 self-assigned this Nov 25, 2025
@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) labels Nov 25, 2025
Copy link
Contributor Author

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

I have launch a BUNCH of builds on my fork to get it to work.

But you can find the last working run on this branch's head (6011543 currently) at https://github.com/jmarrec/EnergyPlus/actions/runs/19665370975

I'm also running a workflow right now that basically backports the changes to v25.2.0 and will build a v25.2.0 windows arm64 installer that matches the official release. Whether we add it to the release page or not should be discussed. cf https://github.com/jmarrec/EnergyPlus/actions/runs/19668078998/job/56329806663

Comment on lines +57 to +66
- name: arm64
os: windows-11-arm
arch: arm64
python-arch: arm64
vs-generator: ARM64
package-arch: arm64
enable_hardened_runtime: OFF
pretty: "Windows arm64"
python-version: 3.12.10
allow_failure: true
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

Comment on lines +218 to +225
- name: arm64
os: windows-11-arm
test_config: win-arm64
package-arch: arm64
pretty: "Windows arm64"
python-version: 3.12.10
python-arch: arm64
allow_failure: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also added to test

Comment on lines 128 to 131
# - name: Downgrade cmake to 3.28
# run: |
# cmake --version
# choco install cmake --version=3.28.4 --allow-downgrade --installargs 'ADD_CMAKE_TO_PATH=System'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, so I will completely delete this block.

Anyways, this was previously needed because we were lazy and we needed to bring back python38.dll (at the time) that was gone.

Because I can't install cmake 3.28 from choco on arm64 windows, It's time to fix it

Comment on lines +982 to +996
# Note for future readers as this gets extremely confusing to write (and read).
# The bottom line is that you should inspect the resulting `build/src/cmake_install.cmake` to see what's the resulting command and ensure that is correctly quoted and evaluated
# Couple of pointers:
# - `${VAR}` evaluates at *configure* time
# - `\${VAR}` writes `${VAR}` verbatim, so that will be evaluated at *install* time
# - `\${CMAKE_COMMAND}` writes `${CMAKE_COMMAND}` verbatim, and I'm not doing `\"\${CMAKE_COMMAND}\"` because this is a single list argument and CMake will handle quoting appropriately already
# - We do want `CMAKE_INSTALL_PREFIX` evaluated at install time
# - I'm using `\"-DXXX=${VAR}\"` so that this single argument is definitely properly quoted in the resulting cmake_install.cmake even if there is a space in the value after -DXXX
# - eg: if RESOLVED_PYTHON_LIBRARY is `/path/to python/python.lib`, it becomes `"-DRESOLVED_PYTHON_LIB=/path/to python/python.lib"` which will be passed as single argument to the operating system which is what we want
install(
CODE "execute_process(
COMMAND ${CMAKE_COMMAND}
-DRESOLVED_PYTHON_LIB=${RESOLVED_PYTHON_LIBRARY}
-DEXECUTABLE_PATH=\${CMAKE_INSTALL_PREFIX}/energyplus${CMAKE_EXECUTABLE_SUFFIX}
-P ${PROJECT_SOURCE_DIR}/cmake/PythonGetLibAndLinkUp.cmake
COMMAND \${CMAKE_COMMAND}
\"-DRESOLVED_PYTHON_LIB=${RESOLVED_PYTHON_LIBRARY}\"
\"-DEXECUTABLE_PATH=\${CMAKE_INSTALL_PREFIX}/energyplus${CMAKE_EXECUTABLE_SUFFIX}\"
-P \"${PROJECT_SOURCE_DIR}/cmake/PythonGetLibAndLinkUp.cmake\"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the actual fix, and because it's such a mess to write/read this stuff, I'm putting comments to explain it (which will serve anyone looking at this in the future, including myself, because cmake variable expansion is such a mess and when wrapping it up in install(CODE you get triple the pain)

Comment on lines +180 to +202
def ensure_python_lib_is_there(self, install_path: Path, verbose: bool = False) -> None:
print("* Ensuring Python library is present in the installation...", end="")
if self.os == OS.Windows:
pattern = "python3*.dll"
elif self.os == OS.Linux:
pattern = "libpython3*.so*"
else: # Mac
pattern = "libpython3*.dylib"
found = list(install_path.glob(pattern))
# We should have found only one
if len(found) != 1:
raise Exception(f"Could not find the Python library with pattern {pattern} in {install_path}")
# Ensure this is a valid library and not a symlink
python_lib_path = found[0]
if not python_lib_path.is_file():
raise Exception(f"Found Python library '{python_lib_path}' is not file")

if python_lib_path.is_symlink():
raise Exception(f"Found Python library '{python_lib_path}' is not a real file but a symlink")

if verbose:
print(f" [{python_lib_path}]", end="")
print(" [DONE]!")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also added this test to ensure we have a python lib in the package

@mitchute
Copy link
Collaborator

@jmarrec I assume you've tested the release workflow over on your fork, or do you want to trigger a throwaway pre-release over here?

@jmarrec
Copy link
Contributor Author

jmarrec commented Nov 27, 2025

@jmarrec I assume you've tested the release workflow over on your fork, or do you want to trigger a throwaway pre-release over here?

You'll see above, in the review comment I have already added links to the workflows.

I ran a last one on https://github.com/jmarrec/EnergyPlus/actions/runs/19730951580 to produce the v25.2.0 installer (forgot to download a patched file) and this release has the binaries: https://github.com/jmarrec/EnergyPlus/releases/WoA which I have successfully installed on a windows-11 arm64 clean VM. I can confirm that even EP-Launch and EP-Launch-Python work fine, and I successfully ran a PythonPlugin simulation.

@jmarrec
Copy link
Contributor Author

jmarrec commented Nov 27, 2025

@mitchute I added the binaries to the v25.2.0 release, and added a note

image

@jmarrec jmarrec requested a review from mitchute December 1, 2025 16:37
@mitchute
Copy link
Collaborator

mitchute commented Dec 1, 2025

Thanks @jmarrec. Everything looks good here.

@mitchute mitchute merged commit 5ef996f into develop Dec 1, 2025
11 checks passed
@mitchute mitchute deleted the WoA branch December 1, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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 Windows native ARM64 release

5 participants