Skip to content
Snippets Groups Projects
Commit 0ce6c240 authored by Rafal Bielski's avatar Rafal Bielski :wave: Committed by Walter Lampl
Browse files

WorkDir: Add feature to dump env vars to text file

Add `CMAKE_DUMP_ENV_FILE` option to dump a subset of the environment
(currently only `PYTHONPATH`) into a file that can be used by IDEs like
VSCode.
parent 93a6a37d
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ USER root
WORKDIR /root
# Install some additional packages.
RUN yum -y install which sclo-git25 wget tar atlas-devel libuuid-devel texinfo \
RUN yum -y install which sclo-git25 wget tar atlas-devel libuuid-devel texinfo python2-pip \
redhat-lsb-core libX11-devel libXpm-devel libXft-devel \
libXext-devel openssl-devel glibc-devel rpm-build libcurl-devel && \
yum clean all
......@@ -23,6 +23,10 @@ COPY atlas_prompt.sh setup_atlas.sh enable_sclo_git25.sh /etc/profile.d/
# Add the message of the day instructions for the image.
COPY motd /etc/
# Install flake8 python linter
RUN pip install flake8 six
RUN scl enable sclo-git25 'pip install git+https://:@gitlab.cern.ch:8443/atlas/atlasexternals.git#subdirectory=External/flake8_atlas'
# Switch to the ATLAS account.
USER atlas
WORKDIR /home/atlas
......
......@@ -12,11 +12,20 @@
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"git.path": "/opt/rh/sclo-git25/root/usr/bin/git"
"git.path": "/opt/rh/sclo-git25/root/usr/bin/git",
"python.envFile": "/workspaces/build/env.txt",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--select=ATL,F,E7,E9,W6",
"--enable-extension=ATL902"
]
},
"extensions": [
"ms-vscode.cpptools",
"ms-python.python",
"twxs.cmake"
]
}
......@@ -74,6 +74,17 @@ lcg_generate_env( SH_FILE ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/env_setup.sh )
install( FILES ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/env_setup.sh
DESTINATION . )
# Dump some environment variables for IDE use:
set( CMAKE_DUMP_ENV_FILE ${CMAKE_BINARY_DIR}/env.txt CACHE FILEPATH
"File containing dump of environment variables" )
if( CMAKE_DUMP_ENV_FILE )
execute_process(
COMMAND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh printenv
COMMAND grep -w ^PYTHONPATH
OUTPUT_FILE "${CMAKE_DUMP_ENV_FILE}" )
endif()
# Set up CPack:
atlas_cpack_setup()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment