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

Correct Ubuntu build instructions #984

Closed

Conversation

CodeWithOz
Copy link
Contributor

Associated issue: #847

The cmake and make commands given in the last section of the Ubuntu build instructions all need to be run from inside the folly folder rather than the _build folder, as indicated by @Orvid in #847. Also, the final step (make install) may need to be sudo make install to allow access to the /usr folder.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Orvid has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

README.md Outdated
@@ -141,12 +141,22 @@ sudo apt-get install \

In the folly directory, run:
```
mkdir _build && cd _build
mkdir _build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line below is cmake ..; that makes this change incorrect.

The reason for building from within the _build dir is to avoid cmake polluting the top-level dir with build artifacts, which it otherwise would do.

Copy link
Contributor Author

@CodeWithOz CodeWithOz Dec 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm do you mean the top level directory that contains the .md files and the build, folly and CMake folders? No build artifacts were added there. It's within the folly folder that a few new files and folders were created.

More so, the commands just didn't work inside [folly version]/folly/_build. #847 contains the error I got from running cmake .. inside it, but both make -j $(nproc) and make install gave errors that indicated necessary files were missing, and then they worked when I went back from [folly version]/folly/_build/ to [folly version]/folly/ as @Orvid suggested.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, top-level or folly/ subdir - we want to avoid build artifact pollution.

Was your shell in [folly-checkout]/folly/_build or in [folly-checkout]/_build when you ran cmake ..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was in [folly-checkout]/folly/_build when I ran it and got the errors. Should the _build folder have been made in [folly-checkout]/ rather than [folly-checkout]/folly/? The README says

In the folly directory

so I interpreted that as [folly-checkout]/folly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell should be in [folly-checkout]/_build, and cmake .. should be run from that directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks for clarifying. So what do you think of these changes:

In the root of the folly directory, run:

mkdir _build && cd _build # puts the shell in [folly-checkout]/_build

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that as a helpful comment because it merely restates the code into English.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so only the first line then?

In the root of the folly directory, run:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The X directory" and "the root of the X directory" mean the same thing. However you might say

In the folly directory (e.g. the checkout root or the archive unpack root), run:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thank you. I have updated the code.

README.md Outdated
> "/home/[yourname]/[folly-version]/folly/libfolly.a" to
> "/usr/local/lib/libfolly.a".

then you [need to use `sudo make install`](https://askubuntu.com/a/954877)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link does not need to exist - this random answer to a random question is not any kind of canonical or authoritative source text.

Copy link
Contributor Author

@CodeWithOz CodeWithOz Dec 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will remove it.

README.md Outdated
> "/usr/local/lib/libfolly.a".

then you [need to use `sudo make install`](https://askubuntu.com/a/954877)
as the last step instead of just `make install`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sold on this whole comment needing to exist. Installing things into the system is well-known to require admin privileges or the root user, and sudo is the well-known way to get those on Ubuntu.

Of course there are many people who don't know this, but it's not really about folly and it's more about getting familiar with the operating system.

At best, we can have an in-line comment suggesting either to use sudo or to use DESTDIR but without offering any explanation. E.g.:

  make install # with either sudo or DESTDIR as necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I will make the change.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yfeldblum has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

sandraiser pushed a commit to sandraiser/folly that referenced this pull request Mar 4, 2019
Summary:
Clarify the [last section](https://github.com/facebook/folly#ubuntu-1604-lts) of the Ubuntu build instructions about where commands need to be run from and how to invoke `make install`.

Fixes facebook#847.
Pull Request resolved: facebook#984

Reviewed By: Orvid

Differential Revision: D13406491

Pulled By: yfeldblum

fbshipit-source-id: d04121812d0d7394000ea6116745c236db67aa23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants