Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,865
    • Issues 3,865
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #23348
Closed
Open
Created Mar 21, 2022 by rbprogrammer@rbprogrammerContributor

ExternalProject_Add USES_TERMINAL_* flags should make SVN interactive

The latest CMake docs for ExternalProject_Add() describe how to use the directive to download external dependencies through version control systems like Git, Subversion, and others.

The docs also mention a section called "Terminal Access Options" (since 3.4) that grant various steps access to the terminal. However, for at least Subversion in the download step, CMake hard codes "--non-interactive" to the Subversion checkout command

  • https://gitlab.kitware.com/cmake/cmake/-/blob/v3.23.0/Modules/ExternalProject.cmake#L2530-2531
  • set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name})

The easiest way to test this is to:

ExternalProject_Add(
    myextdep
    USES_TERMINAL_DOWNLOAD true
    SVN_REPOSITORY https://example.com/path/to/username-password/protected/repo
)

One workaround would have been to use the SVN_USERNAME and SVN_PASSWORD options to ExternalProject_Add(). However that does not work when the username/password is not predictable, nor in situations where we cannot put username/passwords into CMake scripts, or piped in with environment variables, etc. The desired behaviour I would have expected would pause the Subversion checkout process with a prompt asking for the Subversion username/password as if the user ran the "svn co ..." command directly. This is why the USES_TERMINAL_* options exist, right?

I considered adding submitting a patch rather than raise a discussion here, but I do not believe fixing Subversion in the Download step is the complete solution. I am not sure how wide this bug effects. Is it all VCS types? Is it all USES_TERMINAL_* flags?

I'm hoping someone with more historical knowledge of the ExternalProject_Add functionality can chime in. Is this a bug? Or am I using ExternalProject_Add() + USES_TERMINAL_* incorrectly?

Thanks in advanced!

PS. Discussion started on Discourse: https://discourse.cmake.org/t/externalproject-add-does-not-respect-uses-terminal-flags/5254

Edited May 12, 2022 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking