unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Idris packaging
@ 2019-08-19  7:24 P
  2019-08-19  7:29 ` P
  0 siblings, 1 reply; 6+ messages in thread
From: P @ 2019-08-19  7:24 UTC (permalink / raw)
  To: Guix-devel

I ran across an idiosyncrasy in Idris's module system, it looks like `IDRIS_LIBRARY_PATH` is not a list of colon separated paths but a single path, but it supports multiple source and binary paths with the `--sourcepath` option. Currently this breaks `guix environment` if Idris is installed in the user's profile.

Should I patch Idris itself to use a list of paths in `IDRIS_LIBRARY_PATH` or should I create a wrapper that calls it with `--sourcepath`?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Idris packaging
  2019-08-19  7:24 Idris packaging P
@ 2019-08-19  7:29 ` P
  2019-08-21 13:54   ` Eric Bavier
  0 siblings, 1 reply; 6+ messages in thread
From: P @ 2019-08-19  7:29 UTC (permalink / raw)
  To: P; +Cc: Guix-devel

There is a different issue as well, which is that Idris can't seem to compile anything. I've been trying to get gcc or clang to work with the C code Idris generates but somehow even a simple hello world runs into a linker error where ld can't find crt1.o and crti.o even though they are on its path.

I don't know enough about ld to know why this is, so I'd appreciate some help.

I'll also look closer at the Nix packages for Idris and its libraries, since they seem to support it much better.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Idris packaging
  2019-08-19  7:29 ` P
@ 2019-08-21 13:54   ` Eric Bavier
  2019-08-21 15:54     ` P
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Bavier @ 2019-08-21 13:54 UTC (permalink / raw)
  To: P; +Cc: Guix-devel

I've been able to compile Idris' generated C code by setting the, rather undocumented, IDRIS_CC environment variable, while having the 'gcc-toolchain' package installed.

I have not worked much with Idris modules, so I've not encountered the deficiencies you mention.  If we need to patch anything, I would prefer patching Idris to handle a list of directories in IDRIS_LIBRARY_PATH.  That seems like a more flexible solution.

`~Eric

----- On Aug 19, 2019, at 7:29 AM, P pronaip@protonmail.com wrote:

> There is a different issue as well, which is that Idris can't seem to compile
> anything. I've been trying to get gcc or clang to work with the C code Idris
> generates but somehow even a simple hello world runs into a linker error where
> ld can't find crt1.o and crti.o even though they are on its path.
> 
> I don't know enough about ld to know why this is, so I'd appreciate some help.
> 
> I'll also look closer at the Nix packages for Idris and its libraries, since
> they seem to support it much better.

-- 
`~Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Idris packaging
  2019-08-21 13:54   ` Eric Bavier
@ 2019-08-21 15:54     ` P
  2019-08-22 13:10       ` Eric Bavier
  0 siblings, 1 reply; 6+ messages in thread
From: P @ 2019-08-21 15:54 UTC (permalink / raw)
  To: Eric Bavier; +Cc: Guix-devel

On Wednesday, August 21, 2019 3:54 PM, Eric Bavier <ericbavier@centurylink.net> wrote:

> I've been able to compile Idris' generated C code by setting the, rather undocumented, IDRIS_CC environment variable, while having the 'gcc-toolchain' package installed.
>
> I have not worked much with Idris modules, so I've not encountered the deficiencies you mention. If we need to patch anything, I would prefer patching Idris to handle a list of directories in IDRIS_LIBRARY_PATH. That seems like a more flexible solution.
>
> `~Eric

Yeah, I figured that part out and got it to compile to an object file with both clang and gcc, but it doesn't always link correctly. I managed to compile a basic hello world though.
The issue is always with crti.o and crt1.o, things like GMP and pthreads and anything else passed in `-l` arguments seems to work. I can see that ld is called with these crtX.o files as regular arguments, not as -l arguments, which I guess means that it's trying to link them statically? But I don't know enough about ld to know for sure.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Idris packaging
  2019-08-21 15:54     ` P
@ 2019-08-22 13:10       ` Eric Bavier
  2019-08-22 15:55         ` P
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Bavier @ 2019-08-22 13:10 UTC (permalink / raw)
  To: P; +Cc: Guix-devel



----- On Aug 21, 2019, at 3:54 PM, P pronaip@protonmail.com wrote:

> On Wednesday, August 21, 2019 3:54 PM, Eric Bavier <ericbavier@centurylink.net>
> wrote:
> 
>> I've been able to compile Idris' generated C code by setting the, rather
>> undocumented, IDRIS_CC environment variable, while having the 'gcc-toolchain'
>> package installed.
> 
> Yeah, I figured that part out and got it to compile to an object file with both
> clang and gcc, but it doesn't always link correctly. I managed to compile a
> basic hello world though.
> The issue is always with crti.o and crt1.o, things like GMP and pthreads and
> anything else passed in `-l` arguments seems to work. I can see that ld is
> called with these crtX.o files as regular arguments, not as -l arguments, which
> I guess means that it's trying to link them statically? But I don't know enough
> about ld to know for sure.

Could you detail a simple reproducer?  E.g. attach the idris code, detail your environment, and a simple walkthrough of the commands to reach the linker error you're seeing?  That would help others help track down the issue.

-- 
`~Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Idris packaging
  2019-08-22 13:10       ` Eric Bavier
@ 2019-08-22 15:55         ` P
  0 siblings, 0 replies; 6+ messages in thread
From: P @ 2019-08-22 15:55 UTC (permalink / raw)
  To: Eric Bavier; +Cc: Guix-devel

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, August 22, 2019 3:10 PM, Eric Bavier <ericbavier@centurylink.net> wrote:
> Could you detail a simple reproducer? E.g. attach the idris code, detail your environment, and a simple walkthrough of the commands to reach the linker error you're seeing? That would help others help track down the issue.

Not the simplest, but this is what I'm trying to get working:
channel with Idris 2: https://gitlab.com/raingloom/guix-packages
Guix with Idris 1.3.2: https://gitlab.com/raingloom/guix-source/commits/raingloom/idris-1.3.2

I'll look for a more minimal example as well.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-22 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-19  7:24 Idris packaging P
2019-08-19  7:29 ` P
2019-08-21 13:54   ` Eric Bavier
2019-08-21 15:54     ` P
2019-08-22 13:10       ` Eric Bavier
2019-08-22 15:55         ` P

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).