Skip to content

Conversation

@zjumathcode
Copy link
Contributor

@zjumathcode zjumathcode commented Dec 1, 2025

Related Issues

Proposed Changes

From Go 1.17, the preferred syntax for build constraints is //go:build,
which replaces the old // +build form. The old style is now considered
deprecated but still supported for backward compatibility.

This change removes the obsolete // +build xxx line, keeping only the
modern //go:build xxx directive.

More info: golang/go#41184 and https://go.dev/doc/go1.17#build-lines

Design Doc / Proposal:
https://go.dev/design/draft-gobuild

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

@github-project-automation github-project-automation bot moved this to 📌 Triage in FilOz Dec 1, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

@github-project-automation github-project-automation bot moved this from 📌 Triage to ⌨️ In Progress in FilOz Dec 1, 2025
@zjumathcode zjumathcode changed the title cleanup: remove obsolete // +build tag chore: remove obsolete // +build tag Dec 1, 2025
@github-actions github-actions bot dismissed their stale review December 1, 2025 10:24

PR title now matches the required format.

@zjumathcode
Copy link
Contributor Author

@rvagg
Copy link
Member

rvagg commented Dec 1, 2025

Nice, thanks, but if you wouldn't mind running git grep '// +build' and getting all of them that have go: variants (other than those in extern/filecoin-ffi which come from https://github.com/filecoin-project/filecoin-ffi) then we can avoid the inevitable follow-up PRs.

@zjumathcode
Copy link
Contributor Author

Nice, thanks, but if you wouldn't mind running git grep '// +build' and getting all of them that have go: variants (other than those in extern/filecoin-ffi which come from https://github.com/filecoin-project/filecoin-ffi) then we can avoid the inevitable follow-up PRs.

@rvagg Thank you for your suggestions. I have reviewed, revised, and resubmitted. I have confirmed that there are no similar examples.

image

@BigLep BigLep moved this from ⌨️ In Progress to 🔎 Awaiting Review in FilOz Dec 1, 2025
@BigLep BigLep requested review from Copilot and rvagg December 1, 2025 19:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the codebase by removing deprecated // +build build constraint syntax in favor of the modern //go:build directive introduced in Go 1.17. The changes are purely cosmetic cleanup with no functional impact.

Key Changes:

  • Removed obsolete // +build tags from 24 files across the codebase
  • Retained modern //go:build directives that are semantically equivalent to the removed tags

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
storage/sealer/fsutil/statfs_unix.go Removed // +build !windows tag
storage/sealer/fsutil/filesize_unix.go Removed // +build !windows tag
storage/sealer/fsutil/dealloc_other.go Removed // +build !linux tag
lib/ulimit/ulimit_unix.go Removed // +build darwin linux netbsd openbsd tag
lib/ulimit/ulimit_test.go Removed // +build !windows tag
lib/ulimit/ulimit_freebsd.go Removed // +build freebsd tag
chain/types/message_fuzz.go Removed // +build gofuzz tag
build/tools.go Removed // +build tools tag
build/builtin_actors_gen_test.go Removed // +build release tag
build/buildconstants/params_testground_test.go Removed // +build testground tag
build/buildconstants/params_testground.go Removed // +build testground tag
build/buildconstants/params_shared_vals.go Removed // +build !testground tag
build/buildconstants/params_mainnet_test.go Removed // +build !debug,!2k,!testground,!calibnet,!butterflynet,!interopnet tag
build/buildconstants/params_mainnet.go Removed // +build !debug,!2k,!testground,!calibnet,!butterflynet,!interopnet tag
build/buildconstants/params_interop_test.go Removed // +build interopnet tag
build/buildconstants/params_interop.go Removed // +build interopnet tag
build/buildconstants/params_debug.go Removed // +build debug tag
build/buildconstants/params_calibnet_test.go Removed // +build calibnet tag
build/buildconstants/params_calibnet.go Removed // +build calibnet tag
build/buildconstants/params_butterfly_test.go Removed // +build butterflynet tag
build/buildconstants/params_butterfly.go Removed // +build butterflynet tag
build/buildconstants/params_2k_test.go Removed // +build debug 2k tag
build/buildconstants/params_2k.go Removed // +build debug 2k tag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BigLep BigLep added the skip/changelog This change does not require CHANGELOG.md update label Dec 1, 2025
@rvagg
Copy link
Member

rvagg commented Dec 2, 2025

By my reckoning these are still missing @zjumathcode:

chain/proofs/ffi/verifier_cgo.go:// +build cgo
cli/lotus/daemon.go:// +build !nodaemon
cli/lotus/daemon_nodaemon.go:// +build nodaemon
cli/lotus/debug_advance.go:// +build debug
storage/sealer/cgroups.go:// +build !linux
storage/sealer/cgroups_linux.go:// +build linux
storage/sealer/ffiwrapper/prover_cgo.go:// +build cgo
storage/sealer/ffiwrapper/sealer_cgo.go:// +build cgo
storage/sealer/ffiwrapper/verifier_cgo.go:// +build cgo

@zjumathcode
Copy link
Contributor Author

By my reckoning these are still missing @zjumathcode:

chain/proofs/ffi/verifier_cgo.go:// +build cgo
cli/lotus/daemon.go:// +build !nodaemon
cli/lotus/daemon_nodaemon.go:// +build nodaemon
cli/lotus/debug_advance.go:// +build debug
storage/sealer/cgroups.go:// +build !linux
storage/sealer/cgroups_linux.go:// +build linux
storage/sealer/ffiwrapper/prover_cgo.go:// +build cgo
storage/sealer/ffiwrapper/sealer_cgo.go:// +build cgo
storage/sealer/ffiwrapper/verifier_cgo.go:// +build cgo

@rvagg Oh, indeed. I checked and found the reason: it's because the + has a special meaning in regular expressions. I should use ag '// \+build' to search. The git grep '// +build' you provided is also completely correct.

Modified. Thank you very much for your guidance.

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting Review to ✔️ Approved by reviewer in FilOz Dec 2, 2025
@rvagg
Copy link
Member

rvagg commented Dec 2, 2025

Excellent, thanks

@rvagg rvagg merged commit 7f90651 into filecoin-project:master Dec 2, 2025
95 checks passed
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does not require CHANGELOG.md update

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

3 participants