Resolve relative replacements for `xcaddy build` as well

This issue has been created since 2021-02-14.

To match the change in 623c361, this resolves the replacement path ahead of time for xcaddy build.

My usecase is to make this command work:

$ xcaddy build --with github.com/caddyserver/caddy/v2=../../../caddy

Before this change, the output would read:

$ .\xcaddy.exe build --with github.com/caddyserver/caddy/v2=..\..\..\caddy                             2021/02/13 19:53:13 [INFO] Temporary folder: C:\Users\lavof\AppData\Local\Temp\buildenv_2021-02-13-1953.141206587
2021/02/13 19:53:13 [INFO] Writing main module: C:\Users\lavof\AppData\Local\Temp\buildenv_2021-02-13-1953.141206587\main.go
2021/02/13 19:53:13 [INFO] Initializing Go module
2021/02/13 19:53:13 [INFO] exec (timeout=10s): C:\Users\lavof\scoop\shims\go.exe mod init caddy
go: creating new go.mod: module caddy
2021/02/13 19:53:13 [INFO] Replace github.com/caddyserver/caddy/v2 => ..\..\..\caddy
2021/02/13 19:53:13 [INFO] exec (timeout=10s): C:\Users\lavof\scoop\shims\go.exe mod edit -replace github.com/caddyserver/caddy/v2=..\..\..\caddy
2021/02/13 19:53:13 [INFO] Pinning versions
2021/02/13 19:53:13 [INFO] exec (timeout=0s): C:\Users\lavof\scoop\shims\go.exe get -d -v github.com/caddyserver/caddy/vgo get github.com/caddyserver/caddy/v2: github.com/caddyserver/caddy/[email protected]: replacement directory ..\..\..\caddy does not exist
2021/02/13 19:53:13 [FATAL] exit status 1

After:

$ .\xcaddy.exe build --with github.com/caddyserver/caddy/v2=..\..\..\caddy
2021/02/13 20:00:31 [INFO] Resolved relative replacement github.com/caddyserver/caddy/v2=..\..\..\caddy to C:\Users\lavof\repos\caddy
2021/02/13 20:00:31 [INFO] Temporary folder: C:\Users\lavof\AppData\Local\Temp\buildenv_2021-02-13-2000.328255839
2021/02/13 20:00:31 [INFO] Writing main module: C:\Users\lavof\AppData\Local\Temp\buildenv_2021-02-13-2000.328255839\main.go
2021/02/13 20:00:31 [INFO] Initializing Go module
2021/02/13 20:00:31 [INFO] exec (timeout=10s): C:\Users\lavof\scoop\shims\go.exe mod init caddy
go: creating new go.mod: module caddy
2021/02/13 20:00:31 [INFO] Replace github.com/caddyserver/caddy/v2 => C:\Users\lavof\repos\caddy
2021/02/13 20:00:31 [INFO] exec (timeout=10s): C:\Users\lavof\scoop\shims\go.exe mod edit -replace github.com/caddyserver/caddy/v2=C:\Users\lavof\repos\caddy
2021/02/13 20:00:31 [INFO] Pinning versions
2021/02/13 20:00:31 [INFO] exec (timeout=0s): C:\Users\lavof\scoop\shims\go.exe get -d -v github.com/caddyserver/caddy/v2
go: github.com/caddyserver/caddy/v2 upgrade => v2.3.0
2021/02/13 20:00:31 [INFO] Build environment ready
2021/02/13 20:00:31 [INFO] Building Caddy
2021/02/13 20:00:31 [INFO] exec (timeout=0s): C:\Users\lavof\scoop\shims\go.exe mod tidy
2021/02/13 20:00:32 [INFO] exec (timeout=0s): C:\Users\lavof\scoop\shims\go.exe build -o C:\Users\lavof\repos\xcaddy\cmd\xcaddy\caddy.exe -ldflags -w -s -trimpath
2021/02/13 20:00:34 [INFO] Build complete: caddy.exe
2021/02/13 20:00:34 [INFO] Cleaning up temporary folder: C:\Users\lavof\AppData\Local\Temp\buildenv_2021-02-13-2000.328255839
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
TypeError: readtle() takes exactly 3 arguments (1 given) 2 2022-06-07 2022-09-18
[Question] How can I specify schema name? 2 2021-02-09 2022-07-24
W11 Dev [10.0.25140.1000 release] 1 2022-06-16 2022-09-29
CI failed with nuget licenseUrl/PackageIconUrl properties (which will be deprecated) 0 2021-01-12 2022-07-03
Deleting non existing blob leads to removing all objects in a bucket 1 2020-10-17 2022-05-03
Support Azure-style connection strings 2 2020-05-03 2022-07-03
Upload Blob in Chunks 2 2020-10-23 2022-05-03
ShoRAh: list index out of range 1 2020-07-09 2022-09-26
The current CRD from `mix bonny.gen.manifest` doesn't work on later version of k8s 19 2022-02-08 2022-09-24
RFC: Adding support for WalletConnect 3 2022-05-09 2022-08-19
func handleJSON can call two failure completions 1 2021-01-18 2022-08-04
Bot bought API3 at highest price after get listing announcement: detected after 25 seconds 1 2022-01-21 2022-09-16
ModuleNotFoundError: No module named 'gateio_new_coins_announcements_bot.new_listings_scraper' 0 2022-01-19 2022-09-16
Establish process to accurately reflect "schedule demo" subs in Salesforce opportunities with necessary source and enrichment data by 4/30 4 2022-04-07 2022-09-16
checkPermission返回值意义有争议 2 2022-07-02 2022-09-15
startIntentSenderLauncher.launch(intentSender) 使用方法 2 2022-04-01 2022-09-15
M Button LED Control Issue 3 2022-03-30 2022-06-01
M705(406D) scroll too fast or too slow -- no middle of the road 2 2022-04-03 2022-06-01
SpotifyWebApi.prototype.getPlaylistTracks does not respect offset nor limit queries 1 2021-03-02 2022-09-26
Removing `eltype_ub` and renaming `eltype_default` 3 2021-05-31 2022-08-31
[v2] macOS background color is not correct 2 2021-11-23 2022-09-22
error creating database 0 2021-02-13 2022-09-06
Error on starting container: [dumb-init] -e: No such file or directory 1 2022-05-31 2022-07-16
Training Material / Playbook 1 2022-01-18 2022-09-21
DelistingEventsProvider queues delisting event after delisting date 1 2021-11-16 2022-08-29
[MU4 Issue] Instrument Range - Notehead colors - out of balance 2 2022-04-26 2022-08-29
net-fs/samba: please update 0 2022-05-27 2022-09-17
Parameterise collapsing inline 2 2021-05-12 2022-09-12
easy-taxonomy's species suggestion not confirmed by alignment or mash 0 2021-07-20 2022-08-10
Add note that PostgreSQL connection strings cannot be accessed via IConfiguration in ASP.Net core app 2 2022-07-18 2022-09-15
[Feature] add ability to disable recurring job 1 2021-09-30 2022-09-17
字符串字面量的联合类型,用mockjs占位符@pick(['A','B','C']),识别不了 1 2020-09-08 2022-09-19
invalid memory address or nil pointer dereference with debug flag 0 2021-11-19 2022-09-25
BE crash with low cardinality 0 2021-11-12 2022-09-28
Is it possible to develop an arpeggiator for Surge? 1 2022-08-15 2022-09-11
Animax Japan 1 2021-11-26 2022-01-23
add instructions to host on nginx 0 2021-07-11 2022-09-02
Add price of token Lime 0x7bc75e291e656e8658d66be1cc8154a3769a35dd 1 2021-11-19 2022-08-16
Strip the final semi-colon? 1 2021-11-27 2022-09-09
Error: Could not create the Java Virtual Machine in Windows 10 2 2020-02-21 2022-09-09
DRF Token Aunthentication Support 2 2018-11-12 2022-08-03
rtdb code cleanup 0 2021-08-30 2021-12-24
Built-in Policy Release 132b3245 0 2021-09-30 2022-09-20
There is a bug in deleting the space between attribute and tag name of script tag 0 2021-04-10 2022-09-15
Filemenu not responding or respond awkward click behavior 1 2021-05-04 2022-08-27
Please keep both x86_64 and aarch wheels the same version 1 2021-11-13 2022-09-19
Is it possible to send stuff to google drive in an automated fashion? 0 2021-03-10 2022-09-25
Fiber hangs in ZStream#mapZIOParUnordered 4 2022-08-30 2022-09-28
Support GSETTINGS_BACKEND env variable 0 2021-07-19 2022-09-08
Release 4.3.0 - Release Candidate RC7 - Footprint Metrics - VULNERABILITY-DETECTOR (4h) 0 2022-05-02 2022-07-21