Skip to content

Fix FreeBSD build by defining createTokenFile - #1707

Open
kinchan wants to merge 1 commit into
cloudflare:masterfrom
kinchan:fix-freebsd-createtokenfile
Open

Fix FreeBSD build by defining createTokenFile#1707
kinchan wants to merge 1 commit into
cloudflare:masterfrom
kinchan:fix-freebsd-createtokenfile

Conversation

@kinchan

@kinchan kinchan commented Aug 2, 2026

Copy link
Copy Markdown

Need issues #1365 patch first.

Summary

Building cloudflared on FreeBSD currently fails with:

cmd/cloudflared/common_service.go:56:12: undefined: createTokenFile

This worked around mid-July 2026, but no longer builds on the current HEAD.

Environment

  • OS: FreeBSD 14 and 15 (amd64)
  • Build command:
gmake cloudflared

Cause

createTokenFile is defined for Linux, macOS, and Windows, but there is no corresponding definition for FreeBSD.

Current implementations:

  • cmd/cloudflared/linux_service.go
  • cmd/cloudflared/macos_service.go
  • cmd/cloudflared/windows_service.go

FreeBSD is missing an equivalent definition.

Fix

Adding the following file restores the build successfully:

cmd/cloudflared/freebsd_service.go

//go:build freebsd

package main

var createTokenFile = createTokenFileUnix

Verification

After adding the file:

  • gmake cloudflared completes successfully.
  • The resulting cloudflared binary starts correctly.
  • Basic tunnel operation has been verified on FreeBSD.

This change only affects FreeBSD builds and does not modify behavior on other platforms.

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