* [bug#74078] [PATCH] gnu: Add dart
@ 2024-10-28 20:45 Jørgen Kvalsvik
2024-10-30 9:12 ` Sharlatan Hellseher
2024-11-05 5:20 ` bug#74078: " Maxim Cournoyer
0 siblings, 2 replies; 8+ messages in thread
From: Jørgen Kvalsvik @ 2024-10-28 20:45 UTC (permalink / raw)
To: 74078; +Cc: Jørgen Kvalsvik
* gnu/packages/dart.scm: New file.
* gnu/local.mk: Register it.
Change-Id: Idbdcf4e30790b3225bf86a36a0a4c4b081b557aa
---
gnu/local.mk | 1 +
gnu/packages/dart.scm | 101 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+)
create mode 100644 gnu/packages/dart.scm
---
Hello,
This is a port of the nixpkgs Dart compiler package [1]. I am interested
in it specifically because it is a transitive dependency of Hugo [2],
and I figured I other people might be interested in these packages, too.
The from-source build of Dart is quite the pain (nixpkgs seems to have
given up, but I do not know the story there). I looked around and while
I did not find a strict rule saying "source only", it does stand out by
relying on prebuilt artifacts. For my current needs it is good enough,
and I hope that in the future it could get a proper source build. I saw
there was an effort a few years ago, but it appears to have stopped
completely.
[1] https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/dart/default.nix
[2] https://gohugo.io/
diff --git a/gnu/local.mk b/gnu/local.mk
index 6bd7c75090..925a561d45 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -224,6 +224,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/cvassistant.scm \
%D%/packages/cybersecurity.scm \
%D%/packages/cyrus-sasl.scm \
+ %D%/packages/dart.scm \
%D%/packages/darwin.scm \
%D%/packages/data-language.scm \
%D%/packages/databases.scm \
diff --git a/gnu/packages/dart.scm b/gnu/packages/dart.scm
new file mode 100644
index 0000000000..faf840d547
--- /dev/null
+++ b/gnu/packages/dart.scm
@@ -0,0 +1,101 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages dart)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix download)
+ #:use-module (guix packages)
+ #:use-module (guix gexp)
+ #:use-module (guix config)
+ #:use-module (guix build-system copy)
+ #:use-module ((gnu packages bootstrap) #:select (glibc-dynamic-linker))
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu packages elf)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-1))
+
+(define-public dart-3.5
+ (package
+ (name "dart")
+ (version "3.5.4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://storage.googleapis.com/dart-archive/channels/stable/release/"
+ version "/sdk/dartsdk-"
+ (match (%current-system)
+ ("x86_64-linux" "linux-x64")
+ ("i686-linux" "linux-ia32")
+ ("aarch64-linux" "linux-arm64")
+ (_ "unsupported"))
+ "-release.zip"))
+ (sha256
+ (base32 (match (%current-system)
+ ("x86_64-linux" "0rv9rp8g5blhncqwciymhxh3z2832yp54lphxgsvkmm9y8s5w34d")
+ ("i686-linux" "02kv119swcp7y4n3yb2i5a4dagjpf0zq3b3an1apahj5zn6ak41g")
+ ("aarch64-linux" "1v437zpksk0jhib6vhpcbvv715mv32zmwby8b3p9qd3k67fn87d9")
+ (_ "0000000000000000000000000000000000000000000000000000"))))))
+ (build-system copy-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'install
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (patchelf (string-append (assoc-ref inputs "patchelf")
+ "/bin/patchelf"))
+ (ld-so (string-append (assoc-ref inputs "libc")
+ #$(glibc-dynamic-linker))))
+ (mkdir-p out)
+ (copy-recursively "." out)
+ (for-each
+ (lambda (file) (invoke patchelf "--set-interpreter" ld-so file))
+ (find-files bin (lambda (file stat) (and (executable-file? file)
+ (elf-file? file))))))))
+ (add-after 'install 'check
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (let* ((out (assoc-ref outputs "out"))
+ (coreutils (assoc-ref inputs "coreutils"))
+ (PATH (string-join
+ (list
+ (string-append out "/bin")
+ (string-append coreutils "/bin"))
+ ":"))
+ (hello #$(plain-file
+ "hello.dart"
+ "void main() => print('hello, world!');")))
+ (setenv "PATH" PATH)
+ (invoke "dart" "create" "--no-pub" "dart_test_project")
+ (unless (directory-exists? "dart_test_project")
+ (error "'dart create' did not create expected directory"))
+ (unless (file-exists? "dart_test_project/bin/dart_test_project.dart")
+ (error "'dart create' did not create expected .dart file"))
+ (invoke "dart" "compile" "exe" hello "-o" "hello.exe")
+ (invoke "./hello.exe")))))
+ (delete 'strip))))
+ (inputs (list coreutils))
+ (native-inputs (list unzip coreutils patchelf))
+ (home-page "https://dart.dev/")
+ (synopsis "Approachable, portable, and productive language")
+ (description "Dart is a class-based, single inheritance, object-oriented
+language with C-style syntax. It offers compilation to JavaScript, interfaces,
+mixins, abstract classes, reified generics, and optional typing.")
+ (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux"))
+ (license license:bsd-3)))
base-commit: 6d334173a30579f04cac37458f8c696b51e2ecba
prerequisite-patch-id: 2f364131a4d24d80490d69a595e8d70c90de488f
prerequisite-patch-id: 2897995fb414cfcaff1dacf6f285bb07635a1c3a
prerequisite-patch-id: fae24f50d8f46c977a7b997a97252ebe7ad2c7c7
prerequisite-patch-id: b34be5beb88f1d7d14849a5bfb46d5caf7327fbc
prerequisite-patch-id: 601da7b7499b3752f8e9248a837688994d21ed0e
prerequisite-patch-id: f0cb2621cb9438cc0b3d2a2ca36c3428bad89087
--
2.39.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [bug#74078] [PATCH] gnu: Add dart
2024-10-28 20:45 [bug#74078] [PATCH] gnu: Add dart Jørgen Kvalsvik
@ 2024-10-30 9:12 ` Sharlatan Hellseher
2024-11-10 11:40 ` Maxim Cournoyer
2024-11-05 5:20 ` bug#74078: " Maxim Cournoyer
1 sibling, 1 reply; 8+ messages in thread
From: Sharlatan Hellseher @ 2024-10-30 9:12 UTC (permalink / raw)
To: 74078
Cc: Andreas Enge, zimoun, Ludovic Courtès, Maxim Cournoyer,
Efraim Flashner
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
Hi,
Thank you for the patch.
Cc core team
We may blow the dust from this <https://issues.guix.gnu.org/44926> as well
and come to some consensus.
--
Oleg
[-- Attachment #2: Type: text/html, Size: 439 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#74078] [PATCH] gnu: Add dart
2024-10-30 9:12 ` Sharlatan Hellseher
@ 2024-11-10 11:40 ` Maxim Cournoyer
2024-11-10 17:47 ` Tobias Geerinckx-Rice via Guix-patches via
0 siblings, 1 reply; 8+ messages in thread
From: Maxim Cournoyer @ 2024-11-10 11:40 UTC (permalink / raw)
To: Sharlatan Hellseher
Cc: GNU Guix maintainers, zimoun, Ludovic Courtès,
Efraim Flashner, Andreas Enge, 74078
Hi again,
Sharlatan Hellseher <sharlatanus@gmail.com> writes:
> Hi,
>
> Thank you for the patch.
>
> Cc core team
>
> We may blow the dust from this <https://issues.guix.gnu.org/44926> as well
> and come to some consensus.
For the record, I think #44926 could be considered; it packages a
non-public bootstrap dart (which is the same as this submission --
pulling binaries from the net), but then goes on to rebuild itself using
that.
I think we have other compilers in that situation packaged in Guix
(though I forget which ones).
Do we have a definitive policy on this? If we do, I'm missing where
it's laid out clearly. If we don't should we author one? What would be
the big lines of what it says?
CC-ing co-maintainers.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#74078] [PATCH] gnu: Add dart
2024-11-10 11:40 ` Maxim Cournoyer
@ 2024-11-10 17:47 ` Tobias Geerinckx-Rice via Guix-patches via
2024-11-10 18:04 ` Tobias Geerinckx-Rice via Guix-patches via
0 siblings, 1 reply; 8+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2024-11-10 17:47 UTC (permalink / raw)
To: Maxim Cournoyer, Sharlatan Hellseher
Cc: GNU Guix maintainers, zimoun, Ludovic Courtès,
Efraim Flashner, Andreas Enge, 74078
Hi all, Maxim,
I'm as ignorant as you about any ‘policy’. So you just get my opinion:
I think we could be a bit more lenient about adding unbootstrapped compilers, as long as we clearly document the fact (maybe centrally, maybe as a package property, but then not merely as a comment—something queryable).
I'm also biased, because this would also unblock GNAT→ usable Coreboot.
We could keep the sky from falling by documenting that once a known bootstrap path exists, it *must* be used.
Kind regards,
T G-R
Sent on the go. Excuse or enjoy my brevity.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#74078] [PATCH] gnu: Add dart
2024-11-10 17:47 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2024-11-10 18:04 ` Tobias Geerinckx-Rice via Guix-patches via
2024-11-12 13:03 ` Maxim Cournoyer
0 siblings, 1 reply; 8+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2024-11-10 18:04 UTC (permalink / raw)
To: Maxim Cournoyer, Sharlatan Hellseher
Cc: GNU Guix maintainers, zimoun, Ludovic Courtès,
Efraim Flashner, Andreas Enge, 74078
On 10 November 2024 17:47:59 UTC, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
>We could keep the sky from falling by documenting that once a known bootstrap path exists, it *must* be used.
As well as mandating the oldest (which is almost certainly the smallest) known binary seed. And we must count it as such.
Granted, it'll ruin our ‘binary seed reduced by N MiB!’ blog posts in exchange for a larger/more modern package collection.
Kind regards,
T G-R
Sent on the go. Excuse or enjoy my brevity.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#74078] [PATCH] gnu: Add dart
2024-11-10 18:04 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2024-11-12 13:03 ` Maxim Cournoyer
0 siblings, 0 replies; 8+ messages in thread
From: Maxim Cournoyer @ 2024-11-12 13:03 UTC (permalink / raw)
To: Tobias Geerinckx-Rice
Cc: Sharlatan Hellseher, GNU Guix maintainers, zimoun,
Ludovic Courtès, Efraim Flashner, Andreas Enge, 74078
Hi Tobias,
Tobias Geerinckx-Rice <me@tobias.gr> writes:
> On 10 November 2024 17:47:59 UTC, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
>>We could keep the sky from falling by documenting that once a known bootstrap path exists, it *must* be used.
>
> As well as mandating the oldest (which is almost certainly the
> smallest) known binary seed. And we must count it as such.
>
> Granted, it'll ruin our ‘binary seed reduced by N MiB!’ blog posts in
> exchange for a larger/more modern package collection.
I'm pretty sure we already have some binary bootstrapped compilers.
Your suggestions toward documenting a policy make a lot of sense to me;
if you have the bandwidth, I'd like to see it drafted, perhaps as an RFC?
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#74078: [PATCH] gnu: Add dart
2024-10-28 20:45 [bug#74078] [PATCH] gnu: Add dart Jørgen Kvalsvik
2024-10-30 9:12 ` Sharlatan Hellseher
@ 2024-11-05 5:20 ` Maxim Cournoyer
2024-11-05 7:30 ` [bug#74078] " Jørgen Kvalsvik
1 sibling, 1 reply; 8+ messages in thread
From: Maxim Cournoyer @ 2024-11-05 5:20 UTC (permalink / raw)
To: Jørgen Kvalsvik; +Cc: 74078-done
Hi Jørgen,
Jørgen Kvalsvik <j@lambda.is> writes:
> * gnu/packages/dart.scm: New file.
> * gnu/local.mk: Register it.
>
> Change-Id: Idbdcf4e30790b3225bf86a36a0a4c4b081b557aa
> ---
> gnu/local.mk | 1 +
> gnu/packages/dart.scm | 101 ++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 102 insertions(+)
> create mode 100644 gnu/packages/dart.scm
>
> ---
>
> Hello,
>
> This is a port of the nixpkgs Dart compiler package [1]. I am interested
> in it specifically because it is a transitive dependency of Hugo [2],
> and I figured I other people might be interested in these packages, too.
>
> The from-source build of Dart is quite the pain (nixpkgs seems to have
> given up, but I do not know the story there). I looked around and while
> I did not find a strict rule saying "source only", it does stand out by
> relying on prebuilt artifacts. For my current needs it is good enough,
> and I hope that in the future it could get a proper source build. I saw
> there was an effort a few years ago, but it appears to have stopped
> completely.
What kind of prebuilt artifacts are we talking about?
[...]
> +(define-public dart-3.5
> + (package
> + (name "dart")
> + (version "3.5.4")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://storage.googleapis.com/dart-archive/channels/stable/release/"
> + version "/sdk/dartsdk-"
> + (match (%current-system)
> + ("x86_64-linux" "linux-x64")
> + ("i686-linux" "linux-ia32")
> + ("aarch64-linux" "linux-arm64")
> + (_ "unsupported"))
> + "-release.zip"))
> + (sha256
> + (base32 (match (%current-system)
> + ("x86_64-linux" "0rv9rp8g5blhncqwciymhxh3z2832yp54lphxgsvkmm9y8s5w34d")
> + ("i686-linux" "02kv119swcp7y4n3yb2i5a4dagjpf0zq3b3an1apahj5zn6ak41g")
> + ("aarch64-linux" "1v437zpksk0jhib6vhpcbvv715mv32zmwby8b3p9qd3k67fn87d9")
> + (_ "0000000000000000000000000000000000000000000000000000"))))))
Given the "sources" are architecture-specific...
> + (build-system copy-build-system)
... and that we aren't building them, I suppose we are talking about
binary executables.
[...]
While we do have some other packages that do not bootstrap entirely such
as Vala, the situation is not comparable with simply fetching its
binaries and copying them to the store.
I don't think this can be added to GNU Guix as it is, as our policies
are strict about being able to build from source (see the pain we go
through to build recent rust for example -- a long bootstrap chain
rooted in mrustc).
I'd suggest creating a merge request against a different channel that do
not have such high standards/requirements such as NonGuix [0].
I'm now closing this ticket. Thank you for producing it, and apologies
for the outcome, but I think it's important to stick to this important
property of Guix called 'referential transparency', which wouldn't be
quite the same if the references were opaque binaries :-).
[0] https://gitlab.com/nonguix/nonguix/
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#74078] [PATCH] gnu: Add dart
2024-11-05 5:20 ` bug#74078: " Maxim Cournoyer
@ 2024-11-05 7:30 ` Jørgen Kvalsvik
0 siblings, 0 replies; 8+ messages in thread
From: Jørgen Kvalsvik @ 2024-11-05 7:30 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 74078-done
On 11/5/24 06:20, Maxim Cournoyer wrote:
> Hi Jørgen,
>
> Jørgen Kvalsvik <j@lambda.is> writes:
>
>> * gnu/packages/dart.scm: New file.
>> * gnu/local.mk: Register it.
>>
>> Change-Id: Idbdcf4e30790b3225bf86a36a0a4c4b081b557aa
>> ---
>> gnu/local.mk | 1 +
>> gnu/packages/dart.scm | 101 ++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 102 insertions(+)
>> create mode 100644 gnu/packages/dart.scm
>>
>> ---
>>
>> Hello,
>>
>> This is a port of the nixpkgs Dart compiler package [1]. I am interested
>> in it specifically because it is a transitive dependency of Hugo [2],
>> and I figured I other people might be interested in these packages, too.
>>
>> The from-source build of Dart is quite the pain (nixpkgs seems to have
>> given up, but I do not know the story there). I looked around and while
>> I did not find a strict rule saying "source only", it does stand out by
>> relying on prebuilt artifacts. For my current needs it is good enough,
>> and I hope that in the future it could get a proper source build. I saw
>> there was an effort a few years ago, but it appears to have stopped
>> completely.
>
> What kind of prebuilt artifacts are we talking about?
>
> [...]
>
>> +(define-public dart-3.5
>> + (package
>> + (name "dart")
>> + (version "3.5.4")
>> + (source (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "https://storage.googleapis.com/dart-archive/channels/stable/release/"
>> + version "/sdk/dartsdk-"
>> + (match (%current-system)
>> + ("x86_64-linux" "linux-x64")
>> + ("i686-linux" "linux-ia32")
>> + ("aarch64-linux" "linux-arm64")
>> + (_ "unsupported"))
>> + "-release.zip"))
>> + (sha256
>> + (base32 (match (%current-system)
>> + ("x86_64-linux" "0rv9rp8g5blhncqwciymhxh3z2832yp54lphxgsvkmm9y8s5w34d")
>> + ("i686-linux" "02kv119swcp7y4n3yb2i5a4dagjpf0zq3b3an1apahj5zn6ak41g")
>> + ("aarch64-linux" "1v437zpksk0jhib6vhpcbvv715mv32zmwby8b3p9qd3k67fn87d9")
>> + (_ "0000000000000000000000000000000000000000000000000000"))))))
>
> Given the "sources" are architecture-specific...
>
>> + (build-system copy-build-system)
>
> ... and that we aren't building them, I suppose we are talking about
> binary executables.
Correct.
> [...]
>
> While we do have some other packages that do not bootstrap entirely such
> as Vala, the situation is not comparable with simply fetching its
> binaries and copying them to the store.
>
> I don't think this can be added to GNU Guix as it is, as our policies
> are strict about being able to build from source (see the pain we go
> through to build recent rust for example -- a long bootstrap chain
> rooted in mrustc).
>
> I'd suggest creating a merge request against a different channel that do
> not have such high standards/requirements such as NonGuix [0].
>
> I'm now closing this ticket. Thank you for producing it, and apologies
> for the outcome, but I think it's important to stick to this important
> property of Guix called 'referential transparency', which wouldn't be
> quite the same if the references were opaque binaries :-).
No problem - frankly, I expected as much (and appreciate it), but wanted
to check to be sure. As Sharlatan pointed out there is an older, maybe
stale, bootstrapping effort, which could be revived.
As for Hugo (which is what I cared about) it has a bunch of other
dependencies that aren't in guix and that don't really mesh too well
since the go build system doesn't do modules yet, and some dependencies
are .zip/modules-only.
>
> [0] https://gitlab.com/nonguix/nonguix/
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-11-12 13:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28 20:45 [bug#74078] [PATCH] gnu: Add dart Jørgen Kvalsvik
2024-10-30 9:12 ` Sharlatan Hellseher
2024-11-10 11:40 ` Maxim Cournoyer
2024-11-10 17:47 ` Tobias Geerinckx-Rice via Guix-patches via
2024-11-10 18:04 ` Tobias Geerinckx-Rice via Guix-patches via
2024-11-12 13:03 ` Maxim Cournoyer
2024-11-05 5:20 ` bug#74078: " Maxim Cournoyer
2024-11-05 7:30 ` [bug#74078] " Jørgen Kvalsvik
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).