gramineproject / graphene

Graphene / Graphene-SGX - a library OS for Linux multi-process applications, with Intel SGX support
https://grapheneproject.io
GNU Lesser General Public License v3.0
771 stars 260 forks source link

Meson not recognizing different values for -Ddirect and -Dsgx when run back-to-back and build dir already exists #2623

Closed jinengandhi-intel closed 3 years ago

jinengandhi-intel commented 3 years ago

Description of the problem

If you follow the steps in the Quick Start Guide for non-SGX https://graphene.readthedocs.io/en/latest/quickstart.html#quick-start-without-sgx-support (-Ddirect=enabled -Dsgx=disabled) followed by the steps in the Quick Start Guide for SGX https://graphene.readthedocs.io/en/latest/quickstart.html#quick-start-with-sgx-support (-Ddirect=enabled -Dsgx=enabled) the SGX relevant libraries are not installed. Essentially the meson and ninja build commands for SGX are ignored and it says nothing to do and simply re-installs the libraries for graphene-direct.

The only way out of this is to delete the build folder and then run the meson, ninja build and install commands again with both -Ddirect and -Dsgx enabled.

Steps to reproduce

  1. Run the steps in Quick Start Guide for Graphene non-SGX.
  2. Run the steps in Quick Start Guide for Graphene SGX.

Expected results

After the commands for SGX are run, all Graphene SGX libs should be installed at relevant places.

Actual results

Graphene SGX libs are not installed.

woju commented 3 years ago

To change configuration of an existing build directory, you should use meson configure: https://mesonbuild.com/Commands.html#configure. This is quickstart, so I don't think we should bother with documenting meson intricacies here.

jinengandhi-intel commented 3 years ago

I kind of disagree here, we shouldn't expect users to be aware of meson, either we change the steps in the documentation which makes sure we never run into this issue, or we clearly call out the meson configure command to resolve the issue.

dimakuv commented 3 years ago

This deserves a note in the documentation, so I created a PR to fix this.

Indeed, meson <builddir> vs meson configure <builddir> is quite tricky. It doesn't help that our QuickStart "build directory" is called build which confuses users to think that meson build is a command, and not "first invocation of Meson to create a build/ directory". Actually, I find this decision of Meson a very confusing quirk.

mkow commented 3 years ago

Indeed, meson <builddir> vs meson configure <builddir> is quite tricky. It doesn't help that our QuickStart "build directory" is called build which confuses users to think that meson build is a command, and not "first invocation of Meson to create a build/ directory". Actually, I find this decision of Meson a very confusing quirk.

This is bad, I admit that I was confused myself with this. What about using meson build/ or meson setup build/ in our docs? (assuming that a trailing / is accepted)

dimakuv commented 3 years ago

@mkow's latest comment was implemented in https://github.com/oscarlab/graphene/pull/2629

jinengandhi-intel commented 3 years ago

Verified.