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

env.sh should not refer to global directories #140

Open
chqrlie opened this issue Dec 22, 2024 · 0 comments
Open

env.sh should not refer to global directories #140

chqrlie opened this issue Dec 22, 2024 · 0 comments

Comments

@chqrlie
Copy link
Contributor

chqrlie commented Dec 22, 2024

The current version of env.sh has this contents:

echo 'setting C2 environment'
export C2_LIBDIR=~/c2_libs
export C2_PLUGINDIR=~/c2_plugins
export CC=clang
export CXX=clang++
#complete -W '-a -A -b -c -C -d -f -h -m -q -Q -r -s -S -t -T -v --check --create --fast --help --help-recipe --showlibs --showplugins --targets --test' c2c

Referring to subdirectories of the home directory is problematic:

  • the version in development should not override plugins compiled for the installed version
  • the c2 library used for development is now a submodule, C2_LIBDIR should refer to that.
    Furthermore CXX is no longer used, so the definition can be removed
    Also I am not sure CC should be forced as clang, which might not be available on the current system

I suggest this change:

echo 'setting C2 environment for development'
export C2_LIBDIR=$PWD/c2_libs
export C2_PLUGINDIR=$PWD/c2_plugins
export CC=clang
alias c2c="$PWD/output/c2c/c2c"
#complete -W '-a -A -b -c -C -d -f -h -m -q -Q -r -s -S -t -T -v --check --create --fast --help --help-recipe --showlibs --showplugins --targets --test' c2c

I would prefer this alternative approach:

  • if c2c identifies that it is being run from an XXX/output/c2c/ subdirectory, it would use XXX/c2_libs and XXX/c2_plugins instead of the environment variables.
  • remove the env.sh script
  • simplify the install_plugins.sh script or better, make it a Makefile target.

This allows different checkouts to coexist and not interfere with an installed C2 compiler.

@chqrlie chqrlie changed the title **env.sh** should not refer to global directories env.sh should not refer to global directories Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant