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

Fix build on FreeBSD again #3249

Merged
merged 1 commit into from Dec 12, 2019
Merged

Fix build on FreeBSD again #3249

merged 1 commit into from Dec 12, 2019

Conversation

ghost
Copy link

@ghost ghost commented Dec 10, 2019

json_ui.cc:29:9: error: use of undeclared identifier 'sprintf'
        sprintf(buffer, R"("#%02x%02x%02x")", color.r, color.g, color.b);
        ^
1 error generated.

Regressed by 7cdbe1d

json_ui.cc:29:9: error: use of undeclared identifier 'sprintf'
        sprintf(buffer, R"("#%02x%02x%02x")", color.r, color.g, color.b);
        ^
1 error generated.

Regressed by 7cdbe1d
@ghost
Copy link
Author

ghost commented Dec 10, 2019

This kind of error mostly happens because there is no FreeBSD CI. Cirrus CI supports FreeBSD and is free for open source projects. Would you in principle accept a PR that adds a basic .cirrus.yml?

@lenormf
Copy link
Contributor

lenormf commented Dec 10, 2019

Something like the following seems to do the job:

test_task:
  matrix:
    - name: linux
      container:
        image: gcc:7
    - name: osx
      osx_instance:
        image: mojave-base
    - name: freebsd
      freebsd_instance:
        image_family: freebsd-12-1
  test_script: make test

Do you have any experience with Cirrus? It's much faster, and writing .cirrus.yml was very easy because the file is so short…

The locale seems to be wrong in the Linux containers, and I don't know how to handle multiple compilers, do you know how to do that?

@ghost
Copy link
Author

ghost commented Dec 10, 2019

Something like the following seems to do the job:

I think it needs to be a little more complicated. For example, on FreeBSD make is not GNU make which needs to be installed first with pkg install -y gmake and needs to be invoked as gmake. The build at https://cirrus-ci.com/task/6142799119908864 did not even build anything. 😉

Something like (untested):

    - name: freebsd
      freebsd_instance:
        image_family: freebsd-12-1
        install_script: pkg install -y gmake
        test_script: gmake test
        env:
          LC_ALL: en_US.UTF-8

Do you have any experience with Cirrus?

Very little. I'm using it for some of my projects with no problems so far. The FreeBSD Wiki (https://wiki.freebsd.org/HostedCI) lists a bunch of projects that use Cirrus too.

https://github.com/newsboat/newsboat/blob/master/.cirrus.yml#L74 handles multiple compilers by setting some environment variables via env:.

As for the locale would something like

env:
  LC_ALL: en_US.UTF-8

work?

@Screwtapello
Copy link
Contributor

I've written a Cirrus CI build script for another project and it worked out pretty well.

@lenormf
Copy link
Contributor

lenormf commented Dec 11, 2019

Travis has been pretty slow and prone to error-ing out of test builds recently. If someone came up with a .cirrus.yml manifest in a fork and let Cirrus do its thing for a while (to verify whether it's more stable than Travis), I think switching over to it would be a good thing.

@ghost
Copy link
Author

ghost commented Dec 11, 2019

I have a working .cirrus.yml here: https://github.com/t6/kakoune/blob/bdee5f4ec9ab5090d7c407eee27d53f17d332f6d/.cirrus.yml
https://cirrus-ci.com/build/5012156017278976

@lenormf
Copy link
Contributor

lenormf commented Dec 11, 2019

Nice! Any idea how to handle compiling with Clang>=5 as well?

@ghost
Copy link
Author

ghost commented Dec 11, 2019

@ghost
Copy link
Author

ghost commented Dec 11, 2019

Note that there are lots of warnings when building with GCC9...

@mawww mawww merged commit fc2b5c5 into mawww:master Dec 12, 2019
@lenormf lenormf mentioned this pull request Dec 12, 2019
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.

None yet

3 participants