nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
42.18k stars 6.65k forks source link

Fix CI issues #3906

Closed barcode closed 1 year ago

barcode commented 1 year ago

I looked a bit at the ci_test_compilers_clang (10) issue. This PR did not change the affected test and it worked in earlier builds.

It seems the compiler and changed to a newer version.

old:

Compiler: clang version 10.0.0; Target: x86_64-unknown-linux-gnu; Thread model: posix; InstalledDir: /usr/local/bin

new:

Compiler: Debian clang version 10.0.1-++20210313014605+ef32c611aa21-1~exp1~20210313125208.190; Target: x86_64-pc-linux-gnu; Thread model: posix; InstalledDir: /usr/bin

Pull request checklist

Read the Contribution Guidelines for detailed information.

coveralls commented 1 year ago

Coverage Status

Coverage: 100.0%. Remained the same when pulling 03f655d85e0672b95027e8148f1f35d541bfc8bd on barcode:fix_ci_issue into da6b908c4fe63d8c6192c78f00d43ddb40cc563e on nlohmann:develop.

barcode commented 1 year ago

The error makes it pretty clear that libstdc++-8 is used.

/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_path.h

but span is only supported starting with libstdc++-10.

I guess the old version of the docker container had this or a more recent version installed, but i can't confirm, since i don't know how to get the old version of the image.

barcode commented 1 year ago

@nlohmann To get cirrus working you need to add their app to the repo. (I don't have the permissions to do this)

Also the .cirrus.yml has to be in the root dir of the repo.

barcode commented 1 year ago

It seems filesystem in libstdc++-8 does not really work when linking (even though -lstdc++fs is set):

https://github.com/nlohmann/json/actions/runs/3922291644/jobs/6705139818

  [148/166] : && /usr/bin/clang++ -g -lstdc++fs tests/CMakeFiles/test_main.dir/src/unit.cpp.o tests/CMakeFiles/test-regression2_cpp20.dir/src/unit-regression2.cpp.o -o tests/test-regression2_cpp20   && :
  FAILED: tests/test-regression2_cpp20 
  : && /usr/bin/clang++ -g -lstdc++fs tests/CMakeFiles/test_main.dir/src/unit.cpp.o tests/CMakeFiles/test-regression2_cpp20.dir/src/unit-regression2.cpp.o -o tests/test-regression2_cpp20   && :
  ...
  /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
  ...
  /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_path.h:545: undefined reference to 

To fix this we would need to build out own version of libstdc++ (there are no backports for debian buster). I deactivated filesystem for ci_test_compilers_clang (10), since building libstdc++ would take a lot of time in the runner.

Now we only need to finish replacing drone with cirrus. (Since cirrus is currently deactivated, I reactivated drone to prevent the checks from succeeding.)

nlohmann commented 1 year ago

@nlohmann To get cirrus working you need to add their app to the repo. (I don't have the permissions to do this)

I just did this.

Also the .cirrus.yml has to be in the root dir of the repo.

This should be done after merging, right?

barcode commented 1 year ago

I just did this.

Ok, now i have to figure out why cirrus does not want to build this branch...

This should be done after merging, right?

This will be done by this PR. It was meant as an explanation why the cirrus file is not placed in .github/external_ci.

barcode commented 1 year ago

There is clearly some strangeness going on with cirrus. If i change the file and already have the cirrus repo page open It gets updated with an entry: Screenshot from 2023-01-29 21-35-00

When clicking on it i get a not found error and on reloading it disappears.

@nlohmann Maybe there is some setting you can change. (not sure what it would be, but maybe the repo setting Require approval for builds from users without write permissions is activated)

Just in case you do not find some setting, I will try to contact the cirrus support. Maybe they can help.

nlohmann commented 1 year ago

There is clearly some strangeness going on with cirrus. If i change the file and already have the cirrus repo page open It gets updated with an entry: Screenshot from 2023-01-29 21-35-00

When clicking on it i get a not found error and on reloading it disappears.

@nlohmann Maybe there is some setting you can change. (not sure what it would be, but maybe the repo setting Require approval for builds from users without write permissions is activated)

Just in case you do not find some setting, I will try to contact the cirrus support. Maybe they can help.

This is how it looks like:

image

I switched on Require approval for builds from users without write permissions. Let me know if I should try anything else.

barcode commented 1 year ago

At least now the build job stays in https://cirrus-ci.com/github/nlohmann/json instead of disappearing again. I tried setting it up in my fork, but there i got the same issues. The builds disappear (even a manually triggered one. Maybe it has something to do with the current issues with github actions: https://www.githubstatus.com/

Investigating - We are investigating reports of degraded performance for Actions. Jan 30, 2023 - 12:07 UTC

barcode commented 1 year ago

@nlohmann can you try approving one of the jobs listed on https://cirrus-ci.com/github/nlohmann/json? Maybe this fixes some strangeness in their back end.

/edit Ok, i figured it out.. I accidentally named the file ' .cirrus.yml' (there was a space at the start of the file name) and this confused cirrus-ci. Now the jobs do not disappear anymore. @nlohmann can you turn of require approval? I will fix the pipeline for cirrus.

nlohmann commented 1 year ago

Done. I approved three builds and then turned off approvals.

barcode commented 1 year ago

Great it seems like we finally have a working CI again. Now this PR is ready for review.

nlohmann commented 1 year ago

Thanks a lot!!!!!