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

gap.sh should respect the GAP_DIR environment var #2465

Merged
merged 2 commits into from
May 18, 2018

Conversation

RussWoodroofe
Copy link
Contributor

In previous versions of GAP, if the GAP_DIR environment variable was set, then GAP used this variable to determine the location of GAP. (Otherwise, it uses sensible defaults.) This patch returns to this behavior.

In previous versions of GAP, if the GAP_DIR environment variable was set, then GAP used this variable to determine the location of GAP.  (Otherwise, it uses sensible defaults.)  This patch returns to this behavior.
@ChrisJefferson
Copy link
Contributor

Out of interest, have you tried just running the GAP executable directly? The -l option is now optional, as GAP will find it's location, and the location of the library/packages, from the location of the GAP executable.

@RussWoodroofe
Copy link
Contributor Author

RussWoodroofe commented May 15, 2018

@ChrisJefferson, I in fact had tried running the gap executable directly, and hadn't even noticed that it found the library folder! (I was rather focused on testing fixes for the hardcoded library paths, which I've reported elsewhere.) I'll probably move to calling this directly in future versions of Gap.app.

But if the purpose of gap.sh is compatibility with earlier versions of GAP, I think it should support GAP_DIR. Otherwise, it's completely dependent on hard-coded paths.

@codecov
Copy link

codecov bot commented May 15, 2018

Codecov Report

Merging #2465 into master will increase coverage by 0.21%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2465      +/-   ##
==========================================
+ Coverage   73.98%   74.19%   +0.21%     
==========================================
  Files         484      484              
  Lines      245407   245530     +123     
==========================================
+ Hits       181566   182181     +615     
+ Misses      63841    63349     -492
Impacted Files Coverage Δ
src/gap.c 85.5% <0%> (-6.09%) ⬇️
src/hpc/aobjects.c 67.43% <0%> (-0.84%) ⬇️
src/boehm_gc.c 94.14% <0%> (-0.48%) ⬇️
src/range.c 90.32% <0%> (-0.16%) ⬇️
src/blister.c 94.77% <0%> (-0.12%) ⬇️
src/stringobj.c 83.35% <0%> (-0.07%) ⬇️
lib/package.gi 69.77% <0%> (-0.05%) ⬇️
hpcgap/lib/package.gi 68.36% <0%> (-0.05%) ⬇️
src/io.c 73.49% <0%> (-0.05%) ⬇️
src/gvars.c 81.96% <0%> (ø) ⬆️
... and 34 more

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR seems quite sensible, and we probably should backport it to stable-4.9, for GAP 4.9.2.

But some formatting tweaks would be nice, if that's not too much to ask. (But in the worst case, we can change them after merging this).

GAPDIR=$(cd "@abs_top_srcdir@" && pwd)
exec "@abs_top_builddir@/gap" -l "$GAPDIR" "$@"
GAP_EXE=$GAP_DIR
if [ "x$GAP_DIR" = "x" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the extra space after ;

GAP_EXE=$GAP_DIR
if [ "x$GAP_DIR" = "x" ]; then
GAP_DIR=$(cd "@abs_top_srcdir@" && pwd)
GAP_EXE=@abs_top_builddir@
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please indent the two preceding lines (either with two or four spaces each)

@RussWoodroofe
Copy link
Contributor Author

RussWoodroofe commented May 18, 2018

Apologies for taking a day or two to get back. I made the requested formatting updates. Backporting would indeed be sensible, as this patch will be mainly interesting in the short term. (I'm supposing that in the long term, everyone will just launch $GAP_DIR/gap directory.) Should I have done something different when submitting the pull request to request backporting?

@ChrisJefferson
Copy link
Contributor

@RussWoodroofe : We have a tag for backporting, but discussing it in the PR is fine!

@ChrisJefferson ChrisJefferson merged commit d74c2f2 into gap-system:master May 18, 2018
@fingolfin
Copy link
Member

Backported to stable-4.9 via 20dd8f1

@olexandr-konovalov olexandr-konovalov added this to the GAP 4.9.2 milestone Jun 16, 2018
@olexandr-konovalov olexandr-konovalov added the release notes: added PRs introducing changes that have since been mentioned in the release notes label Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: added PRs introducing changes that have since been mentioned in the release notes topic: build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants