Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from github/return-to-stock-fuse
Browse files Browse the repository at this point in the history
use flock to synchronize xattr access; use stock FUSE
  • Loading branch information
Ashe Connor committed Feb 11, 2019
2 parents 11d64cf + 7c971ca commit 35a3da8
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 117 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ host OS, and `user.*` extended attributes are supported on your host's
filesystem. See the [Using Docker containers][build-docker] section for
more details.

At present we require some custom modifications to the libfuse version 3.x
library, and therefore building libprojfs against a default installation
of libfuse will not work. We hope to work with the libfuse maintainers
to develop patches will can eventually be accepted upstream; see
[PR #346](https://github.com/libfuse/libfuse/pull/346) in the libfuse
project for the current status of this work.

To test libprojfs with the Microsoft VFSForGit `MirrorProvider`
(as we do not support the primary VFSForGit GVFS provider yet), .NET Core
must be installed and parts of the VFSForGit project built. See the
Expand Down
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ AC_CHECK_HEADER([fuse3/fuse.h], [],
AC_SEARCH_LIBS([fuse_loop_mt_31], [fuse3], [],
[AC_MSG_ERROR([FUSE version 3.2+ library not found])]dnl
)dnl
# TODO: remove when custom FUSE no longer used
AC_SEARCH_LIBS([fuse_context_node_userdata_release], [fuse3], [],
[AC_MSG_ERROR([FUSE library with per-node userdata support not found])]dnl
)dnl

AC_CONFIG_FILES([Makefile include/Makefile lib/Makefile t/Makefile
config.sh projfs.pc])
Expand Down
19 changes: 9 additions & 10 deletions docker/Dockerfile-fuse3
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@ LABEL org.label-schema.description="projfs Linux libfuse v3 image"
LABEL org.label-schema.vendor="GitHub"
LABEL org.label-schema.schema-version="1.0"

ARG FUSE_VERSION=3.3.0
ARG FUSE_SHA256=c554863405477cd138c38944be9cdc3781a51d78c369ab878083feb256111b65

WORKDIR /tmp

# fuse3 requires meson 0.42, available from stretch-backports
# wget depends on ca-certificates

RUN \
echo 'deb http://deb.debian.org/debian stretch-backports main' >> /etc/apt/sources.list.d/stretch-backports.list && \
apt-get update -qq && \
apt-get install -y -qq --no-install-recommends build-essential ca-certificates pkg-config wget udev && \
apt-get install -y -qq --no-install-recommends -t=stretch-backports meson && \
rm -rf /var/lib/apt/lists/*

ARG FUSE_NWO=kivikakk/libfuse
ARG FUSE_VERSION=3.4.1-kivikakk-userdata2
ARG FUSE_SHA256=94bf33301a8c40d88b16c79141b717ea5a7a4873d40c63acd0017346ad8fb425

WORKDIR /tmp

# fuse3 requires meson 0.42, available from stretch-backports
# wget depends on ca-certificates

ENV FUSE_RELEASE "fuse-$FUSE_VERSION"
ENV FUSE_DOWNLOAD "$FUSE_RELEASE.tar.xz"
ENV FUSE_URL_PATH "releases/download/$FUSE_RELEASE/$FUSE_DOWNLOAD"

RUN \
wget -q "https://github.com/$FUSE_NWO/$FUSE_URL_PATH" && \
wget -q "https://github.com/libfuse/libfuse/$FUSE_URL_PATH" && \
echo "$FUSE_SHA256 $FUSE_DOWNLOAD" | sha256sum -c -

RUN tar -xJf "$FUSE_DOWNLOAD"
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-integrate
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM microsoft/dotnet:2.2-sdk-stretch

ARG FUSE_VERSION=3.4.1
ARG FUSE_VERSION=3.3.0

WORKDIR /data/integrate
ENV HOME /data/integrate
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Here's how to get started:
The command `./projfs image COMPONENT` will build one of five tagged Docker images.

- `./projfs image fuse3` creates `github/fuse3-linux` from `Dockerfile-fuse3`. It installs development tools and build
prerequisites in a stock Debian stretch image, then fetches and builds our fork of FUSE.
prerequisites in a stock Debian stretch image, then fetches and builds FUSE 3.3.0.

- `./projfs image develop` creates `github/projfs-dev-linux` from `Dockerfile-develop`. It is based on
`github/fuse3-linux`, and installs only the build tools necessary for building libprojfs.
Expand Down
42 changes: 20 additions & 22 deletions docs/build-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,19 @@ suitable for all Linux distributions, we hope the preceding information
will suffice to assist those using other distros. Please let us know
if there are specific dependencies we should further enumerate!

## Building libfuse with Modifications
## Building libfuse3

We are currently using a slightly-modified fork of the upstream
libfuse project which allows libprojfs to store custom per-inode
data in memory, specifically a mutex and an empty-vs-full projection
status flag.
We are currently targetting FUSE 3.3.0; we plan to work toward compatibility
with FUSE 2.x in the future also, which can be found in most distribution's
package archives.

To build our modified version of libfuse, clone (or download as a
Zip archive) the [`context-node-userdata` branch][libfuse-userdata]
of our forked libfuse repository, and then build libfuse using Meson
and Ninja:
To build FUSE 3, clone (or download as a Zip archive) the [`fuse-3.3.0`
tag][libfuse-3.3.0] of `libfuse/libfuse` repository, and then build libfuse
using Meson and Ninja:
```
$ git clone https://github.com/kivikakk/libfuse.git libfuse-userdata
$ cd libfuse-userdata
$ git checkout context-node-userdata
$ git clone https://github.com/libfuse/libfuse.git
$ cd libfuse
$ git checkout fuse-3.3.0
$ mkdir build
$ cd build
Expand All @@ -64,7 +62,7 @@ $ meson .. && \
ninja
```

If you wish to install the modified libfuse somewhere other than
If you wish to install the libfuse somewhere other than
the default `/usr/local` system location, you may wish to supply
that path in the `--prefix` option when running Meson.

Expand All @@ -84,7 +82,7 @@ is already in place!
Because many distributions still supply libfuse v2.x as their default
libfuse package under `/usr`, however, unless you specifically have a
system which has a libfuse v3.x installation already, you may be safe
installing our modified libfuse into a system location. Note also that
installing FUSE 3 into a system location. Note also that
libfuse v3.x is designed to co-exist with libfuse v2.x; both libraries
can be installed under `/usr` as the v3.x libfuse header files will be
located in `/usr/include/fuse3`. But please *be cautious* and check
Expand All @@ -96,7 +94,7 @@ refresh the linker's cache using [`ldconfig`][ldconfig-man]:
$ sudo ldconfig
```

If you choose not to install your modified libfuse into a system
If you choose not to install FUSE 3 into a system
location, you will still likely benefit from installing it into
at least a working directory, for several reasons. First, libprojfs
will expect the version 3.x `fuse.h` to be within a `fuse3` directory,
Expand All @@ -113,7 +111,7 @@ To install libfuse into such a working location, you can use the
You will then need to supply the path to this location when building
libprojfs. The recommended way to do this is to use the `--with-libfusepkg`
option (described in the next section), which should ensure you do
not also need to supply the path to your modified libfuse when running
not also need to supply the path to your newly built FUSE 3 when running
the [VFSForGit `MirrorProvider`][vfs4git-mirror] test programs.

## Building libprojfs
Expand Down Expand Up @@ -152,13 +150,13 @@ the test provider we are developing against for now), add the
$ ./configure --enable-vfs-api && make && make test
```

Note that unless you installed your modified libfuse library into a system
Note that unless you installed FUSE 3 into a system
location, you will need to ensure that the `configure` script finds your
libfuse installation by either setting the `CPPFLAGS` and `LDFLAGS`
environment variables, or by providing the path to the `fuse3.pc` package
configuration metadata file with the `--with-libfusepkg` option.

For example, if you installed your modified libfuse library into
For example, if you installed FUSE 3 into
`/path/to/libfuse` and you have a `fuse3.pc` metadata file under
`lib64/pkgconfig/fuse3.pc`, you can use the `--with-libfusepkg` option
as follows (and note that this example also enables the VFSForGit API):
Expand Down Expand Up @@ -340,8 +338,8 @@ or if it's installed in a custom location, you will need to provide
that path in the `LD_LIBRARY_PATH` environment variable.

For instance, to use the `libprojfs.so` shared library without having
to install it (and assuming you supplied the location of your modified
libfuse to the linker by using the `-Wl,-R` compiler option when configuring
to install it (and assuming you supplied the location of
FUSE 3 to the linker by using the `-Wl,-R` compiler opTion when configuring
your libprojfs build), you may reference the `lib/.libs` hidden directory
that was created by the libprojfs build process:
```
Expand Down Expand Up @@ -407,7 +405,7 @@ Now start MirrorProvider; it should start successfully and
wait for a keypress to exit. The example below assumes that you have
compiled libprojfs but not installed it, and that you supplied an
`-Wl,-R/path/to/libfuse/lib` option in `LDFLAGS` when building libprojfs,
so that the location of your modified libfuse is in the runtime library
so that the location of FUSE 3 is in the runtime library
search path of `libprojfs.so`.
```
$ LD_LIBRARY_PATH=/path/to/libprojfs/lib/.libs \
Expand Down Expand Up @@ -530,7 +528,7 @@ specify the user ID which should run the libprojfs process.
[ldconfig-man]: http://man7.org/linux/man-pages/man8/ldconfig.8.html
[libfuse]: https://github.com/libfuse/libfuse
[libfuse-mount3]: http://man7.org/linux/man-pages/man1/fusermount3.1.html
[libfuse-userdata]: https://github.com/kivikakk/libfuse/tree/context-node-userdata
[libfuse-3.3.0]: https://github.com/libfuse/libfuse/tree/fuse-3.3.0
[libunwind]: https://www.nongnu.org/libunwind/
[lttng]: https://lttng.org/
[make]: https://www.gnu.org/software/make/
Expand Down
Loading

0 comments on commit 35a3da8

Please sign in to comment.