couchdb icon indicating copy to clipboard operation
couchdb copied to clipboard

Autodetect spidermonkey version in ./configure

Open frapa opened this issue 3 years ago • 12 comments

Hi, this is my first contribution here!

I have struggled with this point when building couchDB, because it's written nowhere in the documentation that you need to configure the version properly.

It seems that other people had the problem as well: https://couchdb.slack.com/archives/C49LEE7NW/p1632249155263400

The updated configure script automatically finds out the installed library version. It also introduces a dependency on sed, ldconfig and head which I hope are fine (will they work on MacOS?), and remove the default to version 1.8.5 which is old and not in most distributions anymore.

The argument was also removed from the CI scripts because it does not exist anymore.

frapa avatar Feb 17 '22 21:02 frapa

Thanks! I've been wanting to do something like this ever since I refactored those CI config files and found myself littering them with --spidermonkey-version flags everywhere. How do you feel about still allowing the use of --spidermonkey-version, and just using the autodetected version as a default if the user doesn't specify one?

It seems we have an unrelated problem with Jenkins today, we'll investigate that separately.

Also, Trento? That takes me back. I spent a few weeks at ECT when I was a graduate student years ago. Lovely place :)

kocolosk avatar Feb 18 '22 13:02 kocolosk

@kocolosk If you prefer keeping the options and using this as default, it's fine for me. In that case, should the CI script still be updated? I'll wait for more instructions and update the PR.

How can I find out if the CI works again?

Also, Trento? That takes me back. I spent a few weeks at ECT when I was a graduate student years ago. Lovely place :)

Cool! I come from very close to Trento, it's a really nice place. Looking forward to move back one day :-)

frapa avatar Feb 18 '22 19:02 frapa

CI is upgraded and back online courtesy of @nickva . I just re-submitted the job for this PR, but in order to test changes to Jenkinsfile.full I'll need to publish your changes in a specially-named branch in our repo. I can do that once we're confident about the changes here.

kocolosk avatar Feb 18 '22 20:02 kocolosk

In that case, should the CI script still be updated?

Yes, I like what you did there.

kocolosk avatar Feb 18 '22 20:02 kocolosk

@kocolosk I reintroduced the --spidermonkey-version, added a check for empty SM_VSN and removed the environment block. Let me know if can do anything else.

frapa avatar Feb 19 '22 15:02 frapa

@kocolosk Any news on this PR?

frapa avatar Feb 22 '22 19:02 frapa

@frapa I think this is looking good modulo a small typo or two in the error message. I pushed it to a specially-named jenkins-branch so we can test your changes to Jenkinsfile.full in CI:

https://ci-couchdb.apache.org/blue/organizations/jenkins/jenkins-cm1%2FFullPlatformMatrix/detail/jenkins-frapa-autodetect_spidermonkey_version/1/pipeline

Assuming all goes well there we can fix the typo and merge.

kocolosk avatar Feb 23 '22 02:02 kocolosk

Looks like this fails on macOS and FreeBSD. FreeBSD doesn't have the -p option to ldconfig, while macOS doesn't use it at all.

I'd be OK to make the ldconfig dance conditional on discovering Linux as the underlying platform if you want to go that route, otherwise maybe you can figure out a way to support this discovery for the other Unix-like systems?

kocolosk avatar Feb 23 '22 03:02 kocolosk

Thanks for running the CI. I made it Linux-only because I have no access to freeBSD or macOS to test alternatives. Could you update the branch so we see if the CI passes everywhere?

frapa avatar Feb 23 '22 21:02 frapa

OK that's fine. Can you add the spidermonkey_vsn back into the Jenkinsfile for the macOS and FreeBSD builds and add the flag back in generateNativeStage? Otherwise macOS is going to fail because the 1.8.5 default is incorrect.

kocolosk avatar Feb 24 '22 15:02 kocolosk

I think this PR should now be finished.

frapa avatar Mar 02 '22 20:03 frapa

Hi Francesco,

would you like to update and rebase your PR against the current main branch to easier review it?

big-r81 avatar Aug 25 '22 11:08 big-r81