boostorg / boostorg/build

[Windows] Staging file-target with action produces invalid path

Open
#632 1 comment 0 reactions 0 assignees View on GitHub
transition
Dominant language
C++
Stars
251
Forks
63
PR merge metrics
No merged PRs in 30d

Description

`Jamroot`:

import common ;
import stage ;

project test ;

make my : Jamroot : @common.copy ;

local global-build-dir = [ modules.peek project : .global-build-dir ] ;
path-constant INSTALL_TO : [ modules.peek : INSTALL_TO ] ;

stage.install stage : my : $(global-build-dir) $(INSTALL_TO) ;

invocation:

%the_boost%\b2.exe -a -sBOOST_ROOT=%the_boost% -sINSTALL_TO=C:\i --build-dir=C:\o

output:

if not exist "C:\i\..\test\C:\o\\" mkdir "C:\i\..\test\C:\o"
...failed common.mkdir C:\i\..\test\C:\o..
...skipped C:\i\..\test\C:\o\test for lack of C:\i\..\test\C:\o...
...skipped ..\test\C:\o\test\my for lack of C:\i\..\test\C:\o\test...
...failed updating 1 target...
...skipped 2 targets..
...updated 1 target...

[file-target.path](https://github.com/boostorg/build/blob/512ea1f0730b59ba6232709bf9da20fde5dce3ad/src/build/virtual-target.jam#L685) returns a **native** path if there is an action. In stage.jam [copy-file](https://github.com/boostorg/build/blob/512ea1f0730b59ba6232709bf9da20fde5dce3ad/src/tools/stage.jam#L520) generates wrong path because [path.root](https://github.com/boostorg/build/blob/512ea1f0730b59ba6232709bf9da20fde5dce3ad/src/util/path.jam#L178) thinks that that absolute native `path` is **relative**.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Windows invocation from the issue, then inspect file-target.path in src/build/virtual-target.jam, copy-file in src/tools/stage.jam, and path.root in src/util/path.jam. Trace how the action path is classified and verify the staging command produces a valid Windows destination without the duplicated drive prefix or failed target.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.