Subject: Re: [bug#72925] [PATCH v3] adding jpm package

From: Suhail Singh <[email-masked]>
Date: Wed, 02 Oct 2024 17:39:45 -0400

Omar Bassam <[email-masked]> writes:

>> When running "jpm --cc=gcc --local install sh" I get the same error.
>>
>> I was finally able to get it to succeed by having cc symlink to gcc and
>> adding the directory containing the symlink to PATH.  So I believe that
>> the package definition you've submitted is correct.  However, I'm
>> wondering what (if anything) needs to be done about the issue I
>> encountered.
>>
>> Specifically, it's unclear why passing "-cc=gcc" didn't work (nor did
>> setting "CC=gcc", but perhaps JPM ignores the latter?).  Is this an
>> upstream bug?  Were my expectations misplaced?  Should the JPM package
>> in Guix provide "cc" as well?
>>
>
> No, this is not really a Janet or JPM issue but rather the fact that
> you are overriding the gcc compiler with a symlinked binary instead of
> the absolute path.

I don't understand.

All four variants below fail in exactly the same way:

#+begin_src sh
  jpm --cc=gcc -l install sh
#+end_src

#+begin_src sh
  jpm --cc=/home/user/.guix-profile/bin/gcc -l install sh
#+end_src

#+begin_src sh
  jpm --cc=/gnu/store/x2kv3zw2k7ql211m5kvb6yw401gab0x9-gcc-toolchain-14.2.0/bin/gcc -l install sh
#+end_src

#+begin_src sh
  jpm --cc=/gnu/store/lq9y7sd4mvffs4hqp3hkr9fnd384pnkj-gcc-14.2.0/bin/gcc -l install sh
#+end_src

Note that the last variant uses an absolute path.

Either I'm not using the "--cc" option correctly.  Or for some
dependency of "sh" (specifically, posix-spawn) the compiler has been
hardcoded to "cc" and it's not picking up the option being passed to
jpm.

Further, if the above work for you in a "--pure" guix shell (where it
doesn't for me), that's surprising.

It is _only_ when I provide a fake "cc" (which is simply a symlink to
gcc) that things work.

-- 
Suhail