Skip to content

build: Fix for building dist target outside of project root#18744

Open
crass wants to merge 1 commit into
openzfs:masterfrom
crass:fix-dist-target
Open

build: Fix for building dist target outside of project root#18744
crass wants to merge 1 commit into
openzfs:masterfrom
crass:fix-dist-target

Conversation

@crass

@crass crass commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Most projects that build with autoconf allow having a build directory separate from the source root directory. This is currently broken in zfs. This can be verified by running the following commands from zfs source root:

./autogen.sh
ZFSSRC=$PWD
mkdir -p ../zfs-build
cd ../zfs-build
$PWD/configure --with-config=user
make dist

I ran across this failure when trying to build the rpm-utils target, which uses the dist target, from a build directory.

Description

Do not change the working directory when doing copying because $distdir is a path relative to the working directory, and thus not valid after changing the working directory. This previously worked, when configure was run from the project root, because @srcdir@ was the same as the build working directory.

How Has This Been Tested?

Using the command described above. I could be nice to have the CI tests build outside the source directory.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Do not change the working directory when doing copying because $distdir
is a path relative to the working directory, and thus not valid after
changing the working directory. This previously worked, when configure
was run from the project root, because @srcdir@ was the same as the
build working directory.

Signed-off-by: Glenn Washburn <development@efficientek.com>
@crass crass force-pushed the fix-dist-target branch from dc8d08a to add76b1 Compare July 5, 2026 00:55
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

Successfully merging this pull request may close these issues.

1 participant