Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'no symbolic links' option #423

Closed
2 tasks done
tjcw opened this issue Nov 6, 2024 · 6 comments
Closed
2 tasks done

Implement 'no symbolic links' option #423

tjcw opened this issue Nov 6, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@tjcw
Copy link

tjcw commented Nov 6, 2024

Make sure you completed the following tasks

Environment and version details

  • Operating System+version: Windows
  • Compiler+version: Microsoft C++
  • Shell: Windows
  • B2 Version: Output of b2 -v and b2 --version
tjcw:b2$ ./b2 -v
B2 5.3.0 (OS=LINUX, jobs=16)

tjcw:b2$ ./b2 --version
B2 5.3.0 (OS=LINUX, jobs=16)

tjcw:b2$

(I have a Linux development workstation but I am developing for a Windows target)

Describe your use case

I have a cmake-based build/install process which copies the header and library file trees. This used to work, but since the feature was introduced which makes symbolic links instead of copying the files, my header tree was left with dangling symlinks instead of the header files.
On Linux and Unix platforms, this is fixable by using 'tar -h' to copy the files.
On Windows, b2 claims that symbolic links are supported and the build of BOOST completes successfully, but I don't think the Windows file system actually supports symbolic links and I haven't got access to a tar command (and the tar built in to cmake doesn't support a -h flag).

If a project of yours is blocked on this feature, please, mention it explicitly.

Describe the solution you'd like

I would like an option to b2 ... call it nosymlink ... to turn off the new sym-linking behaviour and revert to making copies of the files instead.

Alternatives, if applicable

A clear and concise description of any alternative solutions or features
you've managed to come up with, if any.

Additional context

Add any other context about the feature request here.

@tjcw tjcw added the enhancement New feature or request label Nov 6, 2024
@tjcw
Copy link
Author

tjcw commented Nov 8, 2024

The effect I want to have is this

--- a/src/tools/link.jam
+++ b/src/tools/link.jam
@@ -36,6 +36,8 @@ actions touch {
 
 rule can-symlink ( project )
 {
+    .can-symlink = false ;
+    return false ;
     if ! $(.can-symlink)
     {
         local root-project = [ get-root-project $(project) ] ;

but I don't want it always; only if an appropriate argument is specified on the command line

@grisumbras
Copy link
Contributor

On Windows, b2 claims that symbolic links are supported and the build of BOOST completes successfully, but I don't think the Windows file system actually supports symbolic links and I haven't got access to a tar command (and the tar built in to cmake doesn't support a -h flag).

Modern-ish Windows does support symlinks. If it didn't, you'd either get copies, or you'd get a build error. But it appears, the Windows system you are developing for does support symlinks, because the build succeeds and you get symlinks.

I googled a bit, and apparently rsync can resolve symlinks on Windows and is available via Cygwin or Git Bash.

@grisumbras
Copy link
Contributor

BTW, how are you building Boost? To my knowledge b2 install doesn't create symlinks (except for shared libraries with versions removed).

@tjcw
Copy link
Author

tjcw commented Nov 8, 2024

My build process builds boost by running b2 without any arguments, and then using tar to pack up the headers and libraries for future use. The process has been using the tar feature of cmake (which doesn't support -h to follow symlinks) because I don't have access to a tar command on Windows. I need a build process which works on Windows, Linux, AIX, and MacOS.
I could run b2 install but I haven't been able to figure out how to specify --prefix. Do you have an example of that ?

@grisumbras
Copy link
Contributor

b2 install --prefix=path/to/somewhere.

@tjcw
Copy link
Author

tjcw commented Nov 14, 2024

Yes, install can do what I want. Closing.

@tjcw tjcw closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants