Bug 253607 - lang/mlton: Fails to run: No such file or directory
Summary: lang/mlton: Fails to run: No such file or directory
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Koichiro Iwao
URL:
Keywords:
Depends on: 259261
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-18 00:23 UTC by Bridger Dyson-Smith
Modified: 2021-11-08 15:04 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bridger Dyson-Smith 2021-02-18 00:23:57 UTC
Hi all - 

I hope that this is reported correctly. The latest pkg and port for lang/mlton doesn't seem to be working. After installing the pkg (or building the port), attempting to use the mlton compiler results in the following error:

```
$ mlton hello.sml
No such file or directory
```

My sample file is a simple example:

```
$ less hello.sml
(* hello.sml *)

fun hello () =
    print "Hello, world, from MLton!\n"
    
val _ = hello ()
```

I've tried to build the port with the same results. Additionally, I tried using SMLNJ to bootstrap the mlton build process, but that effort errored out with:

```
[00:00:10] Hit CTRL+t at any time to see build progress and stats
[00:00:10] [01] [00:00:00] Building lang/mlton | mlton-20100608_8
[00:00:10] [01] [00:00:00] Finished lang/mlton | mlton-20100608_8: Ignored: is marked as broken: mlton-20100608-20100608 does not bootstrap properly with smlnj
[00:00:10] Stopping 1 builders
```

For additional discussion, I tried to check in the MLton github issues; e.g. https://github.com/MLton/mlton/issues/433

Best,
Bridger
Comment 1 Timothy Beyer 2021-02-18 22:50:40 UTC
I'll create an updated port based on a modern version using SML/NJ to compile, but going forward, I want to get a modern FreeBSD bootstrap version submitted to the mlton developers to compile a faster running version of mlton for i386 and amd64.

Sorry about the delay on this port, it just has been a while since I looked at the current build system of the project.  If you have any recommended methods, I'll investigate those first.
Comment 2 Bridger Dyson-Smith 2021-02-19 02:02:53 UTC
(In reply to Timothy Beyer from comment #1)
Tim - 

Thanks for your efforts. 

I did try bootstrapping the current mlton port (20100608_8) with SML/NJ, but received an error.

Additionally, I tried bootstrapping the *latest* MLton (20210117) with SML/NJ, using the following command:

gmake OLD_MLLEX=ml-lex OLD_MLYACC=ml-yacc bootstrap-smlnj

Unfortunately, that errors out with:

```
...[snip]...
for d in basis basis/Real basis/Word gc platform util; do       \
        mkdir -p "/home/bridger/src/mlton-src/mlton-20210117/build/lib/mlton/include/$d";               \
        cp -fpR "/home/bridger/src/mlton-src/mlton-20210117/runtime/$d/"*.h "/home/bridger/src/mlton-src/mlton-20210117/build/lib/mlton/include/$d";             \
done
gmake[2]: Leaving directory '/usr/home/bridger/src/mlton-src/mlton-20210117'
gmake compiler CHECK_FIXPOINT=false                     # tools0 + mlton0 -> mlton1
gmake[2]: Entering directory '/usr/home/bridger/src/mlton-src/mlton-20210117'
No such file or directory
gmake -C "/home/bridger/src/mlton-src/mlton-20210117/mlton"
gmake[3]: Entering directory '/usr/home/bridger/src/mlton-src/mlton-20210117/mlton'
No such file or directory
No such file or directory
No such file or directory
No such file or directory
No such file or directory
(                                                                       \
        echo '$(SML_LIB)/basis/unsafe.mlb';                             \
        echo '$(SML_LIB)/basis/sml-nj.mlb';                             \
        echo '$(SML_LIB)/basis/mlton.mlb';                              \
        echo '$(SML_LIB)/basis/basis.mlb';                              \
        mlton -stop f mlton.mlb |                               \
                grep -v 'mlb$' |                                        \
                grep 'mlyacc';                                  \
        mlton -stop f ../lib/stubs/mlton-stubs/sources.mlb |    \
                grep -v 'mlb$' |                                        \
                grep 'mlton-stubs';                                     \
        mlton -stop f mlton.mlb |                               \
                grep -v 'mlb$' |                                        \
                grep -v 'sml/basis' |                           \
                grep -v 'targets' |                                     \
                grep -v 'mlyacc';                                       \
) > mlton-stubs.mlb
No such file or directory
No such file or directory
No such file or directory
gmake[3]: *** [Makefile:113: mlton-stubs.mlb] Error 1
gmake[3]: Leaving directory '/usr/home/bridger/src/mlton-src/mlton-20210117/mlton'
gmake[2]: *** [Makefile:75: compiler] Error 2
gmake[2]: Leaving directory '/usr/home/bridger/src/mlton-src/mlton-20210117'
gmake[1]: *** [Makefile:19: all] Error 2
gmake[1]: Leaving directory '/usr/home/bridger/src/mlton-src/mlton-20210117'
gmake: *** [Makefile:266: bootstrap-smlnj] Error 2
```

And... I'm not sure what to make of that! 

If there's anything I can provide to assist or help, please let me know. 
Thanks again for your time and trouble!

Best,
Bridger
Comment 3 serpent7776 2021-10-16 12:14:25 UTC
Is there any update on this?
The official package still produces `No such file or directory`, but referenced github issue is closed.
Comment 4 Timothy Beyer 2021-10-17 10:53:57 UTC
(In reply to serpent7776 from comment #3)
Hi,

I just completed bootstrap images for FreeBSD 11, 12 and 13 (both i386 and amd64) for version 20210816, but I don't have a finalized port, although that will be ready by the end of the weekend.  I can post a rough draft of a port Saturday evening, sorry about the delay!

In the meantime, here are updated bootstrap images, which you can use as needed:

https://github.com/beyert/mlton-freebsd_bootstrap
Comment 5 Timothy Beyer 2021-10-17 11:15:11 UTC
(In reply to Bridger Dyson-Smith from comment #2)

I want to apologize for the extremely long wait that you and a few other people were very patient about, but I've finally sorted out numerous build issues on i386 that were delaying this by over a month.

I'm now on the verge of updating the port, although I'm still QCing it, but right now, you can use my completed bootstrap images (for FreeBSD 11, 12 and 13, both i386 and amd64) in the link below as your SML compiler, in case you needed a FreeBSD version or architecture not provided on the mlton issue tracker (that person only provided an amd64 build, although I suspect they also were able to produce i386 images, to their credit; I suspect they used a similar compilation path of 20100608 to 20180207 to 20180207 with patches, to a 2021 version):

https://github.com/beyert/mlton-freebsd_bootstrap

I'm also going to provided all custom ports that I used to generate the bootstrap images, in case anyone is interested, I just need to get them ready for usage by others, since they are messy.
Comment 6 serpent7776 2021-10-17 11:44:17 UTC
Yay, awesome thanks.
Comment 7 Bridger Dyson-Smith 2021-10-18 17:35:27 UTC
(In reply to Timothy Beyer from comment #5)

Tim - 

this is great. Thanks for all of your work here. Much appreciated!
Comment 8 Timothy Beyer 2021-10-19 06:50:07 UTC
I just created a PR that fully addresses all problems in the port and updates it to use the most recent bootstrap images.  Provided that works, then this PR will be resolved.  Thanks for everyone's patience in taking so long on this, but I have a high degree of confidence that the port will be very easy to keep up to date going forward.

Also, in the repository that I previously noted, I have now added both the final custom port, as well as custom ports for each bootstrap compiler (note that the ram-slop values may need to be adjusted for any i386 builds as the mlton bootstrap process is notoriously RAM intensive)

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259261
Comment 9 Timothy Beyer 2021-10-19 06:51:33 UTC
(In reply to serpent7776 from comment #6)
no problem! You can try out the final port from either the other PR that I opened or from my github repository.
Comment 10 Timothy Beyer 2021-10-19 06:51:46 UTC
(In reply to Bridger Dyson-Smith from comment #7)
no problem! You can try out the final port from either the other PR that I opened or from my github repository.
Comment 11 Timothy Beyer 2021-10-19 07:02:19 UTC
Sorry, linked to duplicate PR earlier, this is the proper PR (259261 should be deleted):
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259260
Comment 12 serpent7776 2021-11-05 18:21:06 UTC
Just wanted to confirm that mlton works fine now, thanks.
Comment 13 Kubilay Kocak freebsd_committer freebsd_triage 2021-11-06 00:13:40 UTC
^Triage: Assign to committer that resolved (via bug 259261)
Comment 14 Bridger Dyson-Smith 2021-11-08 15:04:54 UTC
Echoing serpent7776's comment, the latest version is working great. Many thanks to Timothy (Koichiro and Kubilay, too) for the effort and time to get this up to date.