Multi-module workspaces

This issue has been created since 2022-03-24.

I think currently multi-module workspaces do not seem to be supported, when I try to build caddy with one like this:

xcaddy --with example.net/testing/caddy-test/v1/core=/Users/silas/Workspace/testing/caddy-test

While my caddy-test project contains this go.work file:

go 1.18

use (
	./core // example.net/testing/caddy-test/v1/core
	./state // example.net/testing/caddy-test/v1/state
)

It fails with this:

2022/03/24 17:47:28 [INFO] Build environment ready
2022/03/24 17:47:28 [INFO] Building Caddy
2022/03/24 17:47:28 [INFO] exec (timeout=0s): /usr/local/bin/go mod tidy
go: finding module for package example.net/testing/caddy-test/v1/state/Users/silas/Workspace/testing/caddy-test
caddy imports
	example.net/testing/caddy-test/v1/state/Users/silas/Workspace/testing/caddy-test: module example.net/testing/caddy-test/v1/[email protected] found (v0.0.0-00010101000000-000000000000, replaced by /Users/silas/Workspace/testing/caddy-test/state), but does not contain package example.net/testing/caddy-test/v1/state/Users/silas/Workspace/testing/caddy-test
2022/03/24 17:47:30 [INFO] Cleaning up temporary folder: /Users/silas/Workspace/testing/caddy-test/buildenv_2022-03-24-1747.4263064286
2022/03/24 17:47:30 [ERROR] exit status 1
francislavoie wrote this answer on 2022-03-24

Hmm, I have no idea how this is supposed to work. xcaddy basically just runs go mod commands. What would you suggest it needs to do for this to be supported?

lenovouser wrote this answer on 2022-03-25

I got it to work with:

xcaddy \
    --with example.net/testing/caddy-test/v1/core=/Users/silas/Workspace/testing/caddy-test/core  \
    --with example.net/testing/caddy-test/v1/state=/Users/silas/Workspace/testing/caddy-test/state

So this is a good work-around for now, in case anyone else runs into this. Only problem is that you need to add a line for each sub-module you add to the (theoretical) single workspace. One needs to keep that in mind, which most of the time doesn't happen, so it takes a few seconds until you read through the lines of the failure until you get it.

What would you suggest it needs to do for this to be supported?

Ideally it should behave like the plugin project itself when used with Go directly. With Go directly, all the modules I import from other modules in the same multi-module workspace get resolved, everything just works. Even though nothing is actually published anywhere online, so it has no chance of resolving these from somewhere else. It just somehow realizes it is part of a multi-module workspace, and then searches for the related packages in said workspace.

I am not sure why this doesn't already work, because it uses go mod commands already like you said, but I am also not familiar enough with the matter to figure out why it doesn't.

mholt wrote this answer on 2022-06-11

That is strange that it doesn't work. I don't have time to investigate this right now but I really appreciate you sharing a workaround in the meantime!

More Details About Repo
Owner Name caddyserver
Repo Name xcaddy
Full Name caddyserver/xcaddy
Language Go
Created Date 2020-03-21
Updated Date 2022-09-22
Star Count 381
Watcher Count 14
Fork Count 72
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Fatal Exception: java.lang.IllegalArgumentException: mobile.android.myapp: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE 0 2021-12-04 2022-07-25
tig000001 is discarded? where can I find out about the filtering step for tig0000001 0 2022-05-06 2022-08-21
BME280 - occasional wrong humidity readings 1 2021-01-02 2022-07-21
Update of workflow schema breaks using login shell in defaults 1 2022-02-07 2022-08-28
Issues with mamba (possibly temporary?) 3 2022-02-11 2022-08-09
Druxt Office Hours - 22/01/19 1 2022-01-18 2022-08-06
make generated bom.xml and bom.json reproducible 4 2021-02-02 2022-07-24
Terminus Keeps Auto Hiding/Minimizing 2 2021-08-25 2022-08-28
Slotting into non-children prop of React component fails 1 2022-09-19 2022-09-28
Quitting the application causes cursor location to be printed. 10 2021-08-17 2022-09-11
Submissions - Allow markdown in question bodies 9 2022-03-15 2022-07-31
Make the shared dropdown component keyboard-friendly 0 2022-03-15 2022-09-15
[Android]How to add Realtime Form Validations in android Using Livedata, Viewmodel and Data Binding 4 2021-12-31 2022-09-01
Introduction to Web MIDI API 3 2021-12-31 2022-07-26
run nvidia-smi err in pod 0 2022-08-13 2022-08-30
get constructor data is error when string[] 0 2021-08-29 2022-08-09
当Cell有Swift里的属性时,会crash. 1 2022-04-06 2022-09-10
Show top marker genes per model for the layer-level results 1 2021-09-30 2022-07-11
Duplicated colnames in count matrix 1 2021-10-06 2021-12-22
Change which window is currently being shared. 1 2022-06-14 2022-09-26
Building fails on FreeBSD 0 2022-08-04 2022-09-21
Runner API Options no longer match GitLab API 0 2022-04-04 2022-09-28
[Feature Request] Ability to declare an enddate 16 2021-09-29 2022-09-02
New command 2 2021-08-26 2022-01-09
ContainedPartDisplayDriver add Display 4 2021-10-11 2022-09-10
Can't authenticate any more with Batch Explorer 6 2022-02-05 2022-09-21
RLlib: agent.restore(checkpoint) TypeError: can't convert np.ndarray of type numpy.object_. 2 2022-07-29 2022-09-29
Pulling Private OCI dependencies in Helm Chart 5 2022-01-12 2022-09-01
My Public Address to Receive LTC ltc1qy2vj0cx0uus9hfn0quy7lqk7uxkt7tydlp0rw0 Pay me via Trust Wallet: https://link.trustwallet.com/send?coin=2&address=ltc1qy2vj0cx0uus9hfn0quy7lqk7uxkt7tydlp0rw0 0 2022-07-30 2022-08-23
[Semantic API] Type inclusion info lost in the signature of a record/object type symbol 0 2021-10-29 2022-07-05
error if preg_match_all third parameter doesn't exist yet while it that isn't needed 1 2020-10-29 2022-09-19
[Rendering] Select Actions stop working after carousel page change 0 2022-04-05 2022-09-13
` testing/acceptance_test.py::test_internal_errors_propagate_to_controller` seems to fail 30% of the time 2 2021-11-29 2022-09-12
Decode => Submission changed the extrinsic 2 2022-05-16 2022-09-05
Forwarding observed data from Leshan to LF Edge Fledge 6 2022-03-13 2022-09-18
Transformer Refactoring 0 2021-09-08 2022-09-26
When the service account role arn annotation is updated, it doesn't trigger a rollout restart of the deployment 2 2022-06-09 2022-09-18
Entries with no NaturalEarth ID 0 2022-06-20 2022-08-22
Cannot restore if storage account in different resource group 3 2022-08-25 2022-09-14
Trigger callback on any events 3 2021-03-10 2022-09-14
期望OperateDataField取值时增加空判断,防止获取不存在的属性时报NPE错误 0 2021-12-13 2022-09-19
Make production-ready SSR nuxt app without runtime-transpiling 2 2021-04-22 2022-09-28
catchError not working as intended (docs) 3 2022-03-16 2022-07-18
Migrate packages to JuliaAI 12 2021-04-01 2022-09-23
Subscribe Block showing HTML text formatting tags in CTA Button text in the live site 6 2022-07-11 2022-09-21
Accessibility: View quiz link not descriptive 0 2022-02-02 2022-08-10
BigQueryInsertJobOperator broken 2 2022-05-30 2022-09-15
Customize Nonce in transaction panel: Android 1 2022-03-03 2022-07-22
doNothing() cannot be used on suspend Unit functions 7 2019-07-04 2022-09-14
Solarized light statusLine readbility 0 2020-04-25 2022-04-09