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

Build error with folly and fmt #97

Closed
pbhandar2 opened this issue Dec 10, 2021 · 4 comments
Closed

Build error with folly and fmt #97

pbhandar2 opened this issue Dec 10, 2021 · 4 comments

Comments

@pbhandar2
Copy link

I cloned and ran the build script on Ubuntu 18 and 20 but encountered the same error on both.

builderrcaache

I also tried it in a docker container with the following Dockerfile to get the same error

FROM ubuntu:18.04
RUN apt-get update && apt install git sudo -y
RUN git clone https://github.com/facebook/CacheLib
WORKDIR CacheLib
CMD ["./contrib/build.sh", "-j"]

@ankita-shankar
Copy link

ankita-shankar commented Dec 13, 2021

For fmt, the build error is being caused by, this commit: fmtlib/fmt@3a951a6
I think there needs to be either changes made in Cachelib to fix this, or make it point to one of the previous version of fmt.

@igchor
Copy link
Contributor

igchor commented Dec 14, 2021

To Meta team: could you please share what is the rationale behind fetching the latest dependencies on every build? Did you consider setting some specific version of each dependency in build-package.sh (e.g. to the latest release) and just updating them when necessary?

@agordon
Copy link
Contributor

agordon commented Dec 14, 2021

Hello @igchor ,

We can divide the dependencies into two groups: everything before folly (i.e. packages which do not depend on folly: zstd, googlelog, googletest, googleflags, fmt, sparsemap), then folly and all packages that do depend on it (folly, fizz, wangle, fbthrift) .

folly itself does not have a "release" or "stable" version. It is always being updated.
folly is added as git submodule to cachelib (like in many other projects which use folly). The difference is: other projects can decide to pin the folly git-submodule to a specific commit, and leave it as-is for a long time (effectively making it "stable").

But cachelib is a Facebook/Meta project, and the internal code base always tracks the latest folly build (observe all the commits at https://github.com/facebook/CacheLib/commits/main which just say "updating submodules" - those are automatic).

And so, when you update cachelib (with git pull) you also update the folly submodule commit version. Then you need to rebuild folly. and then you need to rebuild the downstream packages (fizz/wangle/fbthrift) which depend on folly.

For the other packages, you'll notice we do use a specific git tag or branch ( e.g https://github.com/facebook/CacheLib/blob/main/contrib/build-package.sh#L120 ). So those, even though we do a "git pull", it should remain in the same commit, and a make should be very fast.

I notice fmt is an exception - not pinned to a specific git tag or revision - likely an omission that can be fixed.

Hope this answered your question.
regards,
-assaf

@vereimyst
Copy link

Not sure if this was already cleared up (I'm assuming not since I ran into the same issue when reinstalling Cachelib today), but I managed to get around the folly build issue by doing ./contrib/build-package.sh -d. Definitely doesn't address the issue within the build script though...
Still in the midst of installation, so there may or may not be further issues down the line that I haven't encountered yet doing it this way.

wonglkd added a commit to wonglkd/CacheLib-1 that referenced this issue Feb 22, 2023
Change build script to pin fmt version at same version that folly uses to minimize future breaks.

_Context:_ OSS build broke between 3-5 Jan 2023, likely due to changes in folly. While switching to v9.1.0 or 9.0.0 fixes the issue at hand, it seems sensible to match folly, which specifies fmt v8.0.1: https://github.com/facebook/folly/blob/main/build/fbcode_builder/manifests/fmt

Changed it on a fresh clone of CacheLib and got it to build. (Also had to change `external_git_branch=dev` for zstd to deal with the cmake/zstd issue in facebook#194, but that should resolve when gets merged into release)

> facebook#62 @agordon: For the other packages, you'll notice we do use a specific git tag or branch… I notice `fmt` is an exception - not pinned to a specific git tag or revision - likely an omission that can be fixed.

Related CacheLib issues: facebook#186, facebook#189, facebook#107, facebook#97, facebook#62
Related CacheLib commit: 67cc11a

Last working (Jan 3): https://github.com/facebook/CacheLib/actions/runs/3826992478
First failed (Jan 5): https://github.com/facebook/CacheLib/actions/runs/3844002307/jobs/6546742348
```error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt```
facebook-github-bot pushed a commit that referenced this issue Feb 24, 2023
Summary:
Change build script to pin fmt version to same as folly's to minimize future breaks.

Pull Request resolved: #196

Test Plan:
Built successfully on a fresh clone of CacheLib. (Also had to change `external_git_branch=dev` for zstd to deal with the cmake/zstd issue in #194, but that should resolve when gets merged into release)

**Context:** OSS build broke between 3-5 Jan 2023, likely due to changes in folly. While switching to v9.1.0 or 9.0.0 fixes the issue at hand, it seems sensible to match folly, which specifies fmt v8.0.1: https://github.com/facebook/folly/blob/main/build/fbcode_builder/manifests/fmt

> #62 agordon: For the other packages, you'll notice we do use a specific git tag or branch… I notice `fmt` is an exception - not pinned to a specific git tag or revision - likely an omission that can be fixed.

Related CacheLib issues: #186, #189, #107, #97, #62
Possibly related CacheLib commit: 67cc11a

Last working (Jan 3): https://github.com/facebook/CacheLib/actions/runs/3826992478
First failed (Jan 5): https://github.com/facebook/CacheLib/actions/runs/3844002307/jobs/6546742348
Error: `error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt`

Reviewed By: therealgymmy

Differential Revision: D43517927

Pulled By: jiayuebao

fbshipit-source-id: 2d28791f7804d862b646263b96b10b835f843d8c
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

6 participants