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

Old revision of oniguruma (from 15 Mar 2017) lacks certain changes that would allow make check to pass #2381

Closed
spacekitcat opened this issue Dec 4, 2021 · 2 comments

Comments

@spacekitcat
Copy link

Describe the bug
I tried to build jq from source recently and I got the following error:

posix.c:94:3: error: implicit declaration of function 'onig_end' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  onig_end();

This is happening because git submodule update --init pulls in revision 6fa38f4084b448592888ed9ee43c6e90a46b5f5c (15 Mar 2017) of oniguruma, which lacks the following explicit declaration in src/onigposix.h:

ONIG_EXTERN int onig_end P_((void));

This was added to oniguruma in revision 5a24a49d710a9e3bb8ff11d12e1eae5a9f9df40c (8 Sep 2017).

The workaround is to run git submodule update --remote --init in place of git submodule update --init. The problem with doing this is that git will pull in the latest revision of oniguruma and I know I wouldn't personally be comfortable doing that against a 3rd party repository. Fortunately, it looks like you can change the revision git points at (this Stack Overflow post provides great instructions).

n.b. Git submodule essentially pins the oniguruma module version to whatever revision it was at when the submodule definition was committed to this repository.

To reproduce

I just followed the build steps from the README.md, but here's a one liner for convenience:

git clone https://github.com/stedolan/jq && cd jq && git submodule update --init && autoreconf -fi && ./configure --with-oniguruma=builtin && make -j8 && make check

Output:

gcc -DHAVE_CONFIG_H -I. -I../src  -I../src -I/usr/local/include   -g -O2 -MT posix.o -MD -MP -MF .deps/posix.Tpo -c -o posix.o posix.c
posix.c:94:3: error: implicit declaration of function 'onig_end' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  onig_end();
  ^
1 error generated.

Expected behaviour
The build, or rather the make check step should complete without any errors.

Environment (please complete the following information):

  • macOS Monterey (12.0.1), arm64
  • jq from master, revision: a9f97e9

Additional context

Workaround one liner:

git clone https://github.com/stedolan/jq && cd jq && git submodule update --remote --init && autoreconf -fi && ./configure --with-oniguruma=builtin && make -j8 && make check
@spacekitcat
Copy link
Author

I would be more than happy to take responsibility for sorting this issue out if that's something that would interest the project?

@spacekitcat spacekitcat changed the title oniguruma submodule is from 2017 Old revision of oniguruma (from 15 Mar 2017) lacks certain changes that would allow make check to pass Dec 4, 2021
owenthereal added a commit that referenced this issue May 29, 2023
MacOS build [fails](https://github.com/jqlang/jq/actions/runs/5114162555/jobs/9194126677#step:6:3160) due to

```
posix.c:94:3: error: implicit declaration of function 'onig_end' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  onig_end();
```

The current `oniguruma` revision
6fa38f4084b448592888ed9ee43c6e90a46b5f5c (15 Mar 2017) lacks the following explicit declaration in src/onigposix.h:

```
ONIG_EXTERN int onig_end P_((void));
```

This was added to oniguruma in revision 5a24a49d710a9e3bb8ff11d12e1eae5a9f9df40c (8 Sep 2017).

Ref: #2381
owenthereal added a commit that referenced this issue Jun 1, 2023
* Try making some GitHub Actions

* GHA: Add OS X, Windows, and Linux w/ scan-build builds

* Add link to discord server

Add link to discord server

* Update Ubuntu to 22.04 for GitHub Actions

* Remove if condition for Ubuntu build

* Fix MacOS OS on GitHub Actions

* Fix python3 package on GitHub Actions

* Disalbe valgrind

Getting failed tests: https://github.com/jqlang/jq/actions/runs/5113866588/jobs/9193542140#step:9:341

* Format file

* Fix macos build

* Fix syntax errors of windows build

https://github.com/jqlang/jq/actions/runs/5114162556/workflow

* Install windows package with choco

* Pin oniguruma to 5a24a49d710a9e3bb8ff11d12e1eae5a9f9df40c

MacOS build [fails](https://github.com/jqlang/jq/actions/runs/5114162555/jobs/9194126677#step:6:3160) due to

```
posix.c:94:3: error: implicit declaration of function 'onig_end' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  onig_end();
```

The current `oniguruma` revision
6fa38f4084b448592888ed9ee43c6e90a46b5f5c (15 Mar 2017) lacks the following explicit declaration in src/onigposix.h:

```
ONIG_EXTERN int onig_end P_((void));
```

This was added to oniguruma in revision 5a24a49d710a9e3bb8ff11d12e1eae5a9f9df40c (8 Sep 2017).

Ref: #2381

* Revert windows build to use pacman

* Don't zip jq.exe

* Fixing windows build

* Update .gitattriutes for eol on Windows

* Skip workflow_dispatch for windows build

* Clean up builds

* Use LF line endings for all text

Ref: actions/checkout#135

* Fix test that has rounding error

#2596 (comment)

* Enable CI for all

---------

Co-authored-by: Nicolas Williams <[email protected]>
@owenthereal
Copy link
Member

Fixed as part of #2596

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

No branches or pull requests

2 participants