devernay / cminpack

A C/C++ rewrite of the MINPACK software (originally in FORTRAN) for solving nonlinear equations and nonlinear least squares problems
http://devernay.free.fr/hacks/cminpack/
145 stars 63 forks source link

fix: EOL problems running CMake tests on Windows #63

Closed luau-project closed 2 months ago

luau-project commented 3 months ago

Description

I have improved cminpack build with CMake on Windows. In the actual behavior when building with CMake, in order for the tests to pass, you have to two ways:

  1. enforce git config --global core.autocrlf true before checking out the source code from github;
  2. download the released tarball and convert manually LF (\n) to CRLF (\r\n) all the reference test files (*.ref) found at examples/ref/

In the new behavior, there is no need to perform LF to CRLF conversion anymore.

How

Tests

To verify that my proposed changes were correct, I discarded the entries git config --global core.autocrlf true in the builds at CI services, which can be found at .github/workflows/windows-visual-studio-cminpack-install.yaml and appveyor.yml.

Bonus

I simplified the build on AppVeyor CI appveyor.yml.

luau-project commented 2 months ago

Update

On my branch, I was able to port MSYS2 CI to github. Github is much faster, because jobs run in parallel.

luau-project commented 2 months ago

Update

@devernay

In the current state, which I consider to be ready to merge, I removed the AppVeyor CI integration (deleted appveyor.yml) in favor of Github CI, because it is faster.

Rest assured that CI is now better, which you can check on my branch https://github.com/luau-project/cminpack/tree/fix-cmake-eol-on-tests Github actions (building correctly 49 different tests), including 24 tests with MSYS2 toolchains.

[!IMPORTANT]

In order to cancel AppVeyor CI, you have to log in on your account there, and delete the cminpack project on the project settings, otherwise it will continue to fail on each push.

luau-project commented 2 months ago

Update

Merged master, and restored back AppVeyor file for the checks to pass here.

[!IMPORTANT]

However, it is still highly recommended to turn off the AppVeyor CI removing the project on their website, because:

  • Github workflows is already setup for MSYS2 and MSVC
  • AppVeyor runs slower than Github, because Github jobs run in parallel
  • AppVeyor can fail (false-positive) while downloading packages or updates from MSYS2 due a great load on MSYS2 servers.
devernay commented 2 months ago

LGTM!