You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ hugo version
hugo v0.121.1+extended linux/amd64 BuildDate=2024-02-06T18:00:00-06:00 VendorInfo=Fedora:0.121.1-1.fc39
Hugo includes optional code to support website deployment. This code brings in many dependencies, and Hugo provides an option to deactivate it (-tags nodeploy).
I maintain the official Hugo package for Fedora. Packaging the deploy code's dependencies has become difficult, so I now build the Hugo package without the deploy features. The trouble is that the Fedora packaging system automatically resolves dependencies by inspecting the imports found in Go code. I can partially address this by removing the "deploy" directory before building. However, config/allconfig/allconfig.go and config/allconfig/alldecoders.go import from the deploy directory regardless of the presence of the nodeploy tag.
Would it be possible to make conditional the use of deploy in allconfig.go and alldecoders.go with something like this
//go:build !nodeploy
// +build !nodeploy
?
That would go a long way to make packaging less fragile and more straight forward.
Here are my current steps, which might help illustrate what I am trying to describe:
rm -rf deploy.
Patch things with sed:
sed -i '/"github.com\/gohugoio\/hugo\/deploy"/d' config/allconfig/allconfig.go # Remove import.
sed -i 's/Deployment deploy.DeployConfig/Deployment bool/g' config/allconfig/allconfig.go # Replace use with bool.
sed -i '/"github.com\/gohugoio\/hugo\/deploy"/d' config/allconfig/alldecoders.go # Remove import.
sed -i 's/p.c.Deployment, err =/\/\/ p.c.Deployment, err =/g' config/allconfig/alldecoders.go # Comment out use.
Run go build with -tags nodeploy.
Run go test with -tags nodeploy.
Steps 1, 3, and 4 are fine. Step 2 is what I would like to avoid.
The text was updated successfully, but these errors were encountered:
Hugo includes optional code to support website deployment. This code brings in many dependencies, and Hugo provides an option to deactivate it (-tags nodeploy).
I maintain the official Hugo package for Fedora. Packaging the deploy code's dependencies has become difficult, so I now build the Hugo package without the deploy features. The trouble is that the Fedora packaging system automatically resolves dependencies by inspecting the imports found in Go code. I can partially address this by removing the "deploy" directory before building. However, config/allconfig/allconfig.go and config/allconfig/alldecoders.go import from the deploy directory regardless of the presence of the nodeploy tag.
Would it be possible to make conditional the use of deploy in allconfig.go and alldecoders.go with something like this
?
That would go a long way to make packaging less fragile and more straight forward.
Here are my current steps, which might help illustrate what I am trying to describe:
rm -rf deploy
.sed -i '/"github.com\/gohugoio\/hugo\/deploy"/d' config/allconfig/allconfig.go # Remove import.
sed -i 's/Deployment deploy.DeployConfig/Deployment bool/g' config/allconfig/allconfig.go # Replace use with bool.
sed -i '/"github.com\/gohugoio\/hugo\/deploy"/d' config/allconfig/alldecoders.go # Remove import.
sed -i 's/p.c.Deployment, err =/\/\/ p.c.Deployment, err =/g' config/allconfig/alldecoders.go # Comment out use.
-tags nodeploy
.-tags nodeploy
.Steps 1, 3, and 4 are fine. Step 2 is what I would like to avoid.
The text was updated successfully, but these errors were encountered: