Skip to content

Remove BSD-4-Clause glob files inherited from Greenplum - #1997

Open
tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:remove-bsd4-glob
Open

tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:remove-bsd4-glob

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Sep 14, 2026

Copy link
Copy Markdown
Member

src/port/glob.c, src/port/glob.h and src/include/port/win32_msvc/glob.h carry the original 4-clause BSD license from the Regents of the University of California, with the advertising clause intact. The ASF lists that variant under Category X, which may not be distributed in source or binary form, and the files have shipped in every release so far. Reported by Justin Mclean during the 2.2.0-rc1 IPMC vote.

The files are not PostgreSQL code and can simply go away:

  • PostgreSQL has no glob.c, glob.h or win32_msvc/glob.h on master, REL_16_STABLE or REL_14_STABLE; upstream's win32_msvc directory holds only dirent.h, sys, unistd.h and utime.h. src/port/glob.c still carries a PHP CVS keyword ($Id: glob.c,v 1.7 2007/11/10 09:56:37 dmitry Exp $), so it came from PHP's win32 glob by way of Greenplum, and src/port/glob.h arrived with "Move gpfdist to gpdb core".
  • The only consumers are the Windows gpfdist builds. In src/bin/gpfdist/Makefile the object was added under ifeq ($(PORTNAME),win32), and src/bin/gpfdist/CMakeLists.txt is a standalone MSVC project (/MP /wd4996 compiler switches, ws2_32 and Crypt32, libapr-1.lib) that nothing in the build system invokes. Cloudberry neither supports nor produces Windows builds.
  • The two places that really use glob, src/backend/utils/adt/dbsize.c and src/backend/utils/misc/fstream/fstream.c, include <glob.h> and resolve to the system header.

The win32 block in the gpfdist Makefile is removed whole rather than trimmed: its -I$(top_builddir)/src/port was added by the same commit that added src/port/glob.h and existed only to find that header.

The LICENSE section covering these files and licenses/LICENSE-glob.txt go with them. Note that the section listed only two of the three files; src/port/glob.h was never registered.

Checked on Rocky 9 that no reference to glob.c, glob.o or LICENSE-glob remains anywhere in the tree, and that gpfdist builds byte-identically before and after (133152 bytes) and still runs; PORTNAME is linux there, so the removed block never fired to begin with.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


src/port/glob.c, src/port/glob.h and src/include/port/win32_msvc/glob.h
carry the original 4-clause BSD license from the Regents of the
University of California, with the advertising clause intact.  The ASF
lists that variant under Category X, which may not be distributed in
source or binary form, and the files have shipped in every release so
far.  Reported by Justin Mclean during the 2.2.0-rc1 IPMC vote.

The files are not PostgreSQL code and can simply go away:

  - PostgreSQL has no glob.c, glob.h or win32_msvc/glob.h on master,
    REL_16_STABLE or REL_14_STABLE; upstream's win32_msvc directory
    holds only dirent.h, sys, unistd.h and utime.h.  src/port/glob.c
    still carries a PHP CVS keyword ($Id: glob.c,v 1.7 2007/11/10
    09:56:37 dmitry Exp $), so it came from PHP's win32 glob by way of
    Greenplum, and src/port/glob.h arrived with "Move gpfdist to gpdb
    core".
  - The only consumers are the Windows gpfdist builds.  In
    src/bin/gpfdist/Makefile the object was added under
    ifeq ($(PORTNAME),win32), and src/bin/gpfdist/CMakeLists.txt is a
    standalone MSVC project (/MP /wd4996 compiler switches, ws2_32 and
    Crypt32, libapr-1.lib) that nothing in the build system invokes.
    Cloudberry neither supports nor produces Windows builds.
  - The two places that really use glob, src/backend/utils/adt/dbsize.c
    and src/backend/utils/misc/fstream/fstream.c, include <glob.h> and
    resolve to the system header.

The win32 block in the gpfdist Makefile is removed whole rather than
trimmed: its -I$(top_builddir)/src/port was added by the same commit
that added src/port/glob.h and existed only to find that header.

The LICENSE section covering these files and licenses/LICENSE-glob.txt
go with them.  Note that the section listed only two of the three files;
src/port/glob.h was never registered.

Checked on Rocky 9 that no reference to glob.c, glob.o or LICENSE-glob
remains anywhere in the tree, and that gpfdist builds byte-identically
before and after (133152 bytes) and still runs; PORTNAME is linux there,
so the removed block never fired to begin with.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, indeed postgres does not have such files https://github.com/postgres/postgres/tree/master/src/port

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.

2 participants