i want to create a Racket package, when i did that on a directory containing the module code in a file that uses other code file and i want to install it with the package manager from a directory it installs well the module but parse also all the scheme file trying to install them as other modules and so i have a lot of error (in red) in the log. Just what i want is a way for package manager to use only my module files not the included files (it does the same even if i put them in subdirectories) to be able to install it without a ton of errors. I also want to provide the package as a git repositories but that i know how to do it but will have the same problem with included files.
I can not find a way to solve this problem?
perheaps doing : raco pkg new name ?
Regards,
Damien
It sounds like you're saying that by default, a package install compiles all of the files in an installed subdirectory, and I believe that's correct.
I know this is going to sound obvious, but the easiest way to avoid this problem is to make sure that those files aren't in the package.
Not good enough?
Well, there are a few other ways to do it, as well.
One is to use the compile-omit-paths collection field.
Another would be to specify a subpath as the package directory, and move the other files out of that subdirectory.
Returning to point #1, though, it sounds like it might be simpler to create a new repository with just the files that compile.
Re-reading this, it sounds like you might actually be using the include library to literally include the text of one file inside another. In general, I ... think I would steer you away from doing that? ... but I can see how that might cause this problem. I'm just throwing things out there, now, but perhaps you could consider changing these files not to end with .rkt or .scm ? I just did some quick tests and this appeared to work.
i do not understand where to put the option compile-omit-paths ? seems to be useful in an API but not in command line, but perheaps i'm not right.
I want to keep the tree structure of project, if i put the main.rkt file ,the ones that is a module and the included (i admit i use some) and the required files outside of this tree structure this is not logic . Because in a project all files are in same directory or someones in sub directory but rarely outside.
This will be the last solution for me. Renaming scheme or racket files with another extension is shocking too , souund very strange for a modern language to be forced to do that...
anyway it works but if i distribute a racket package like this it will perheaps not display with a buil status of success in Racket Package Index ?
Damien
That info.rkt is used to describe a package and it also will be used there.
Searching for a package that uses it I found an interesting way to use it in the frog package of @greghendershott
It uses a second info.rkt file in the subdirectory to exclude only the examples directory.
If you don't want to use a second info.rkt then you can specify the subdirectory in the parent directory info.rkt like this:
#lang info
(define compile-omit-paths '("example"))
I see that I was right in guessing that you're actually using include. I'm going to go out on a limb and suggest that it's fairly uncommon to use include in modern Racket; I think it's generally the case that every racket file is a separate module of compilation (or indeed, may contain multiple modules).
In a language like C, there's a fairly clear distinction between files that are units of compilation (those ending with .c) and those that are designed to be included (those ending with .h). I would suggest that files such as declare.scm and others that you're including are not separate units of compilation, but are instead "include files", so it doesn't seem unreasonable to give them names that reflect this. Perhaps something like declare.inc and condx.inc?
i'm agree with you. But Scheme does not encourage this like C,having no convention,and having module defined differently from a scheme implementation to another one. Perheaps for this reason it is more compatible to use include.Also i use them because my included files are really lights , condx contains one or 2 macros of 10 lines like this:
; example:
;(define x 1)
;(condx ((= x 7) 'never)
; (exec
; (define y 3)
; (set! x 7))
; ((= y 1) 'definitely_not)
; (exec
; (set! y 10)
; (define z 2))
; ((= x 7) (+ x y z))
; (else 'you_should_not_be_here))
;
; 19
(define-syntax condx
(syntax-rules (exec else)
((_)
(error 'condx "No else clause"))
((_ (else e ...))
(let () e ...))
((_ (exec s ...) d1 ...)
(let () s ... (condx d1 ...)))
((_ (t e ...) tail ...)
(if t
(let () e ...)
(condx tail ...)))))
;; warning this ones behaves differently (can not remember the problem)
(define-syntax condx-begin
(syntax-rules (exec else)
((_)
(error 'condx-begin "No else clause"))
((_ (else e ...))
(begin e ...))
((_ (exec s ...) d1 ...)
(begin s ... (condx-begin d1 ...)))
((_ (t e ...) tail ...)
(if t
(begin e ...)
(condx-begin tail ...)))))
;; (define x 1)
;; (condx ((= x 7) 'never)
;; (exec
;; (define y 3)
;; (set! x 7))
;; ((= y 1) 'definitely_not)
;; (exec
;; (set! y 10)
;; (define z 2))
;; ((= x 7) (+ x y z))
;; (else 'you_should_not_be_here))
;; (define y 0)
;; (define z 0)
;; (set! x 1)
;; (condx-begin ((= x 7) 'never)
;; (exec
;; (set! y 3)
;; (set! x 7))
;; ((= y 1) 'definitely_not)
;; (exec
;; (set! y 10)
;; (set! z 2))
;; ((= x 7) (+ x y z))
;; (else 'you_should_not_be_here))
and it comes from a Guile version of my code,Guile have different conventions for modules.
another problem arising is that even if i can omit some subdirs for building it try to test them anayway and fail and also complain about depandancies but build with success