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

Support deterministic builds #4580

Open
joaohf opened this issue May 8, 2023 · 1 comment
Open

Support deterministic builds #4580

joaohf opened this issue May 8, 2023 · 1 comment

Comments

@joaohf
Copy link

joaohf commented May 8, 2023

Summary

Prepare couchdb to support deterministic builds.

Desired Behaviour

For same use cases deterministic build is necessary. Erlang 25 supports that via compile flags like:

export ERL_COMPILER_OPTIONS="deterministic"

In fact, when setting ERL_COMPILER_OPTIONS to deterministic the couchdb build as expected. However a few things should be fixed:

WARNING: couchdb-3.3.2-r0 do_package_qa: QA Issue: File /opt/couchdb/lib/couch-3.3.2/priv/couch_js/86/util.d in package couchdb contains reference to TMPDIR
File /opt/couchdb/lib/couch-3.3.2/priv/couch_js/86/main.d in package couchdb contains reference to TMPDIR
File /opt/couchdb/lib/couch-3.3.2/priv/couch_ejson_compare/couch_ejson_compare.d in package couchdb contains reference to TMPDIR
File /opt/couchdb/releases/RELEASES in package couchdb contains reference to TMPDIR [buildpaths]

I'm building couchdb using Yocto Project and there is a quality assurance step which verifies if all installed files do not have references to the build host paths. It looks like the file: /opt/couchdb/releases/RELEASES has some build paths inside the file.

The Makefile says to install the output from rel/couchdb into the destination folder:

# target: install- install CouchDB :)
install: release
        @echo
        @echo "Notice: There is no 'make install' command for CouchDB 2.x+."
        @echo
        @echo "    To install CouchDB into your system, copy the rel/couchdb"
        @echo "    to your desired installation location. For example:"
        @echo "    cp -r rel/couchdb /usr/local/lib"

But installing everything from rel/couchdb also brings some compilation files (.d, .o), I think these files is not necessary to be installed:

File /opt/couchdb/lib/couch-3.3.2/priv/couch_js/86/main.d in package couchdb contains reference to TMPDIR
File /opt/couchdb/lib/couch-3.3.2/priv/couch_ejson_compare/couch_ejson_compare.d in package couchdb contains reference to TMPDIR
@nickva
Copy link
Contributor

nickva commented May 8, 2023

Thanks for reaching out @joaohf and for giving a it a try to build CouchDB with a deterministic option. We could probably even make that a configure option or even the default.

Good find about .d .o files we do not need to install those with the release. It's an omission on our part.

@nickva nickva added bug and removed needs-triage labels May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants