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

gofer: init at 2.30a #100171

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

gofer: init at 2.30a #100171

wants to merge 2 commits into from

Conversation

@siraben
Copy link
Member

@siraben siraben commented Oct 10, 2020

It builds but running the executable complains about lack of standard prelude, which has to be placed according in a location analogous to /usr/local/lib/Gofer.

You will need a directory which is available to all Gofer users on
your system to store prelude files etc.  You can choose this to be
whatever you like.  I'll just call it $GOFLIB here.  On Unix systems,
I usually use /usr/local/lib/Gofer or a subdirectory of my home
directory, Gofer/lib.  On DOS systems, I suggest C:\GOFER\LIB.
$ ./result/bin/gofc hello.hs    
Gofer->C Version 1.03 (2.30b)  Copyright (c) Mark P Jones 1992-1995

Reading script file "standard.prelude":
ERROR "standard.prelude": Unable to open file
Aborting compilation
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@siraben siraben force-pushed the siraben:gofer-init branch from e9b4c8f to a668d61 Oct 10, 2020
@siraben
Copy link
Member Author

@siraben siraben commented Oct 12, 2020

Note that goferc doesn't work since it's a shell script has hardcoded paths.

$ ./result/bin/goferc hello.hs 
./result/bin/goferc: line 34: /usr/local/lib/Gofer/gofc: No such file or directory
[Compiling with gcc]
clang: error: no such file or directory: './hello.c'
clang: error: no such file or directory: '/usr/local/lib/Gofer/runtime.o'
error: /Applications/Xcode.app/Contents/Developer/Toolchains/

@siraben siraben force-pushed the siraben:gofer-init branch from a668d61 to 0ee3ad1 Oct 12, 2020
@siraben
Copy link
Member Author

@siraben siraben commented Oct 12, 2020

I'm not entirely sure how to go about doing this, but the tar.gz file that is downloaded has the following directory structure. Nix seems to cd into the src directory, but files such as standard.prelude need to be copied into $out/lib for the goferc executable to work.

.
├── [1.2K]  Readme
├── [4.2K]  array.gs
├── [ 29K]  cc.prelude
├── [1.2K]  demos
├── [1.1K]  docs
├── [ 288]  docsrc
├── [4.1K]  gofer.el
├── [740K]  gofer230a.tar.gz
├── [1.6K]  ioarray.gs
├── [2.1K]  iomonad.gs
├── [1.0K]  min.prelude
├── [ 27K]  nofloat.prelude
├── [ 192]  scripts
├── [ 19K]  simple.prelude
├── [1.3K]  src
└── [ 27K]  standard.prelude

 862K used in 5 directories, 11 files

installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
# cp $src/standard.prelude $out/lib

This comment has been minimized.

@SuperSandro2000

SuperSandro2000 Jan 18, 2021
Member

Suggested change
# cp $src/standard.prelude $out/lib

This comment has been minimized.

@siraben

siraben Jan 18, 2021
Author Member

May be needed at run time, need to check.


hardeningDisable = [ "format" ];

src = fetchurl {

This comment has been minimized.

@SuperSandro2000

SuperSandro2000 Jan 19, 2021
Member

I think we can use fetchzip here to remove the unpack phase.

@stale
Copy link

@stale stale bot commented Jul 19, 2021

I marked this as stale due to inactivity. → More info

siraben and others added 2 commits Oct 10, 2020
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@siraben siraben force-pushed the siraben:gofer-init branch from 8c8da03 to 6f4e678 Aug 2, 2021
@stale stale bot removed the 2.status: stale label Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants