Boost logo

Boost :

Subject: Re: [boost] [modular-boost] Questions about development procedures andmore
From: Vyacheslav Andrejev (mortituris_at_[hidden])
Date: 2014-02-02 06:20:13


Hello Gennadiy,

GR> 1. Why does ./b2 headers on windows creates hardlink for each file
GR> instead of directories? The process takes forever.

tools/build/src/tools/link.jam is responsible for this behavior. In particular
there is a rule that creates links to directories:
rule do-link
{
    local target = [ path.native [ path.relative-to [ path.pwd ] $(<) ] ] ;
    local source = [ path.native [ path.relative-to [ path.pwd ] $(>) ] ] ;
    local relative = [ path.native [ path.relative-to [ path.parent $(<)
] $(>) ] ] ;
    if ! [ on $(target) return $(MKLINK_OR_DIR) ]
    {
        LOCATE on $(target) = . ;
        DEPENDS $(.current-target) : $(target) ;
        mklink-or-dir $(target) : $(source) ;
    }
    if [ os.name ] = NT
    {
        MKLINK_OR_DIR on $(target) = mklink /D \"$(target)\" \"$(relative)\"
;
    }
    else
    {
        MKLINK_OR_DIR on $(target) = ln -s $(relative) $(target) ;
    }
}

As you can see this rule uses mklink /D to create a symbolic link. However
by default in Windows users have no rights to create symbolic links. You
can try to change /D to /J. I personally solved the problem by using an alternative
command mklnk that exists in Take Command shell I use.

--
Vyacheslav Andrejev

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk