Skip to content

fix(Makefile): fix dcspec gen dependencies and hide error output #17043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 24, 2025

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Mar 21, 2025

I thought make gen was failing due to the red output, decided to just hide it. Fixed a few makefile deps while I was at it.

image

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

🙏

@mafredri mafredri force-pushed the mafredri/fix-makefile-dcspec-error-output branch from fe5caea to d915c56 Compare March 21, 2025 16:07
@mafredri mafredri force-pushed the mafredri/fix-makefile-dcspec-error-output branch 2 times, most recently from 916188f to 6c02c64 Compare March 24, 2025 10:27
@mafredri mafredri force-pushed the mafredri/fix-makefile-dcspec-error-output branch from 6c02c64 to cc0f78b Compare March 24, 2025 10:35
# the target "agent/agentcontainers/dcspec/dcspec_gen.go" depends on
# node/pnpm tooling.
mkdir -p node_modules
touch node_modules/.installed
Copy link
Member Author

Choose a reason for hiding this comment

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

/cc @deansheather lmk if you're unhappy about this change. Happy to solve this another way if you have a suggestion. I'm vary of allowing gen/mark-fresh to touch non-existent files (node_modules/.installed).

Copy link
Member

Choose a reason for hiding this comment

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

Could you add a new GO_SRC_FILES-adjacent variable that excludes this directory perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do that 👍🏻. It seems the vpn package is limited to importing codersdk and tailnet (+ sub paths), would it be alright to limit it to these or should we have a more exhaustive selection of src files?

(It'd be nice to eventually partially generate the Makefile and/or use Go src parsing to include relevant src files for targets.)

Copy link
Member

Choose a reason for hiding this comment

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

I think it would be fine to just exclude the problematic files for now. Even though it only imports those packages, those packages import a lot more.

Copy link
Member Author

@mafredri mafredri Mar 24, 2025

Choose a reason for hiding this comment

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

Makes sense, wdyt ef77ec5 (#17043)?

@mafredri mafredri force-pushed the mafredri/fix-makefile-dcspec-error-output branch from ef77ec5 to ea46eb6 Compare March 24, 2025 11:30
@@ -54,6 +54,16 @@ FIND_EXCLUSIONS= \
-not \( \( -path '*/.git/*' -o -path './build/*' -o -path './vendor/*' -o -path './.coderv2/*' -o -path '*/node_modules/*' -o -path '*/out/*' -o -path './coderd/apidoc/*' -o -path '*/.next/*' -o -path '*/.terraform/*' \) -prune \)
# Source files used for make targets, evaluated on use.
GO_SRC_FILES := $(shell find . $(FIND_EXCLUSIONS) -type f -name '*.go' -not -name '*_test.go')
# Same as GO_SRC_FILES but excluding certain files that have problematic
# Makefile dependencies (e.g. pnpm).
MOST_GO_SRC_FILES := $(shell \
Copy link
Member

Choose a reason for hiding this comment

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

To avoid the search again, could you do an inverse grep on GO_SRC_FILES instead perhaps? No stress if you have problems, this will be fine

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK the := assignment should be evaluated only if used, so only for make build/coder-dylib? If we do an inverse grep then we always have to evaluate GO_SRC_FILES too?

Copy link
Member

Choose a reason for hiding this comment

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

That's fair, all g then

@mafredri mafredri force-pushed the mafredri/fix-makefile-dcspec-error-output branch from ea46eb6 to feffa14 Compare March 24, 2025 11:31
@mafredri mafredri enabled auto-merge (squash) March 24, 2025 11:35
@mafredri mafredri merged commit 6bf22f8 into main Mar 24, 2025
29 of 32 checks passed
@mafredri mafredri deleted the mafredri/fix-makefile-dcspec-error-output branch March 24, 2025 11:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants