Compare commits

...

8 Commits

Author SHA1 Message Date
TakeV 200797c414
Enable working build for meowy-webring
Unfortunately, it fails during packaging. :(
2023-12-28 17:35:20 -05:00
TakeV c6444ab666
Add rust embed 6 2023-12-28 17:35:20 -05:00
TakeV 16eed250ca
Add simple_logger 6 2023-12-28 17:35:20 -05:00
TakeV 29865c7352
Add notify 6 2023-12-28 17:35:20 -05:00
TakeV e9f26e3b7a
Add rust-directories-5 2023-12-28 17:35:20 -05:00
TakeV 4ea0872ef1
Add askama-rocket 2023-12-28 17:35:20 -05:00
TakeV 7e8650744b
Add rocket-0.5 2023-12-28 17:35:19 -05:00
TakeV 2990f45d11
Update manifest to only use dev tools 2023-12-28 17:34:53 -05:00
7 changed files with 4921 additions and 659 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +1,76 @@
(load "rust.scm")
(load "crates-io.scm")
(define-module (meowy-webring)
#:use-module (crates-io)
#:use-module (guix)
#:use-module (guix build-system cargo)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages crates-io)
#:use-module (rust)
#:use-module (srfi srfi-1))
:use-module (crates-io)
#:use-module (guix)
#:use-module (guix build-system cargo)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages crates-io)
#:use-module (srfi srfi-1))
(define (keep-file? file stat)
(not (any (lambda (my-string)
(string-contains file my-string))
(list ".git" ".dir-locals.el" "guix.scm" ".guix"))))
(or (git-predicate (current-source-directory))
(const #t)))
; temp package to debug build issues
(define-public proc-macros
(package
(name "proc-macros")
(version "0.1.0-git")
(source (local-file "../../crates/proc-macros" "proc-macros-checkout"
#:recursive? #t
#:select? keep-file?))
(build-system cargo-build-system)
(arguments (list #:cargo-inputs `(("rust-syn" ,rust-syn-2)
("rust-quote" ,rust-quote-1))))
(synopsis "")
(description "")
(home-page "")
(license license:cc0)))
; temp package to debug build issues
(define-public meowy-assets
(package
(name "meowy-assets")
(version "0.1.0-git")
(source (local-file "../../crates/meowy-assets" "meowy-assets-checkout"
#:recursive? #t
#:select? keep-file?))
(build-system cargo-build-system)
(arguments (list #:cargo-inputs `(("proc-macros" ,proc-macros)
("rust-askama-rocket" ,rust-askama-rocket-0.12)
("rust-askama" ,rust-askama-0.12)
("rust-embed" ,rust-embed-6)
("rust-hex" ,rust-hex-0.4)
("rust-rocket" ,rust-rocket-0.5))))
(synopsis "")
(description "")
(home-page "")
(license license:cc0)))
(define-public meowy-webring
(package
(name "meowy-webring")
(version "0.1.0-git")
(source (local-file "../.." "meowy-webring-checkout"
#:recursive? #t
#:select? keep-file?))
(build-system cargo-build-system)
(arguments (list #:rust backported-rust
#:cargo-inputs `(("rust-rocket" ,rust-rocket-0.5)
("rust-askama" ,rust-askama-0.12))))
(synopsis "")
(description "")
(home-page "")
(license license:cc0)))
(package
(name "meowy-webring")
(version "0.1.0-git")
(source (local-file "../.." "meowy-webring-checkout"
#:recursive? #t
#:select? keep-file?))
(build-system cargo-build-system)
(arguments (list #:cargo-inputs `(("rust-askama-rocket" ,rust-askama-rocket-0.12)
("rust-askama" ,rust-askama-0.12)
("rust-directories" ,rust-directories-5)
("rust-embed" ,rust-embed-6)
("rust-hex" ,rust-hex-0.4)
("rust-notify" ,rust-notify-6)
("rust-rocket" ,rust-rocket-0.5)
("rust-serde" ,rust-serde-1)
("rust-serde-json" ,rust-serde-json-1)
("rust-simple-logger" ,rust-simple-logger-4))))
(synopsis "")
(description "")
(home-page "")
(license license:cc0)))
meowy-webring

View File

@ -1,20 +0,0 @@
--- a/vendor/fd-lock/Cargo.toml 2023-05-31 14:44:48.000000000 -0700
+++ b/vendor/fd-lock/Cargo.toml 2023-07-14 21:19:34.637702319 -0700
@@ -45,7 +45,7 @@
[target."cfg(unix)".dependencies.rustix]
version = "0.37.0"
-features = ["fs"]
+features = ["fs", "cc"]
[target."cfg(windows)".dependencies.windows-sys]
version = "0.45.0"
--- a/src/bootstrap/Cargo.lock 2023-07-11 20:32:40.000000000 -0700
+++ b/src/bootstrap/Cargo.lock 2023-07-14 22:41:53.269284713 -0700
@@ -618,6 +618,7 @@
dependencies = [
"bitflags",
+ "cc",
"errno",
"io-lifetimes",
"libc",

View File

@ -1,302 +0,0 @@
(define-module (rust)
#:use-module (guix)
#:use-module (guix build-system cargo)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages crates-io)
#:use-module (gnu packages gdb)
#:use-module (gnu packages linux)
#:use-module (gnu packages rust)
#:use-module (srfi srfi-1))
(define rust-1.68
(@@ (gnu packages rust) rust-1.68))
(define rust-bootstrapped-package
(@@ (gnu packages rust) rust-bootstrapped-package))
(define %cargo-reference-hash
(@@ (gnu packages rust) %cargo-reference-hash))
(define rust-1.69
(let ((base-rust
(rust-bootstrapped-package
rust-1.68 "1.69.0" "03zn7kx5bi5mdfsqfccj4h8gd6abm7spj0kjsfxwlv5dcwc9f1gv")))
(package
(inherit base-rust)
(source
(origin
(inherit (package-source base-rust))
(snippet
'(begin
(for-each delete-file-recursively
'("src/llvm-project"
"vendor/tikv-jemalloc-sys/jemalloc"))
;; Also remove the bundled (mostly Windows) libraries.
(for-each delete-file
(find-files "vendor" ".*\\.(a|dll|exe|lib)$")))))))))
(define rust-1.70
(let ((base-rust
(rust-bootstrapped-package
rust-1.69 "1.70.0" "0z6j7d0ni0rmfznv0w3mrf882m11kyh51g2bxkj40l3s1c0axgxj")))
(package
(inherit base-rust)
(source
(origin
(inherit (package-source base-rust))
;; Rust 1.70 uses the rustix library which on Linux, it defaults to
;; using outline ASM which without the cc cargo feature enabled, it
;; will expect a precompiled binary library. This patch will enable the cargo
;; cc feature flag inside the fd-lock vendored Cargo.toml file, which is the
;; crate that uses rustix.
(patches (list "./patches/rust-1.70-fix-rustix-build.patch"))
(patch-flags '("-p1"))))
(arguments
(substitute-keyword-arguments (package-arguments base-rust)
((#:phases phases)
`(modify-phases ,phases
(replace 'build
(lambda* (#:key parallel-build? #:allow-other-keys)
(let ((job-spec (string-append
"-j" (if parallel-build?
(number->string (parallel-job-count))
"1"))))
(invoke "./x.py" job-spec "build" "--stage=1"
"library/std"
"src/tools/cargo")))))))))))
(define rust-1.71
(let ((base-rust
(rust-bootstrapped-package
rust-1.70 "1.71.0" "15jc0d13cmrh2xvpkyyvsbwgn3w4klqiwf2wlgzfp22mvjmy8rx6")))
(package
(inherit base-rust)
(arguments
(substitute-keyword-arguments (package-arguments base-rust)
((#:validate-runpath? _ #t)
#f)
((#:phases phases)
`(modify-phases ,phases
(replace 'patch-cargo-checksums
(lambda _
(substitute* '("Cargo.lock"
"src/bootstrap/Cargo.lock"
"src/tools/rust-analyzer/Cargo.lock"
"src/tools/cargo/Cargo.lock")
(("(checksum = )\".*\"" all name)
(string-append name "\"" ,%cargo-reference-hash "\"")))
(generate-all-checksums "vendor"))))))))))
;;; Function to make creating a list to ignore tests a bit easier.
(define (make-ignore-test-list strs)
(map (lambda (str)
(let ((ignore-string (format #f "#[ignore]\n~a" str)))
`((,str) ,ignore-string)))
strs))
;;; Note: Only the latest versions of Rust are supported and tested. The
;;; intermediate rusts are built for bootstrapping purposes and should not
;;; be relied upon. This is to ease maintenance and reduce the time
;;; required to build the full Rust bootstrap chain.
;;;
;;; Here we take the latest included Rust, make it public, and re-enable tests
;;; and extra components such as rustfmt.
(define-public backported-rust
(let ((base-rust rust-1.71))
(package
(inherit base-rust)
(outputs (cons "rustfmt" (package-outputs base-rust)))
(arguments
(substitute-keyword-arguments (package-arguments base-rust)
((#:tests? _ #f)
(not (%current-target-system)))
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'relax-gdb-auto-load-safe-path
;; Allow GDB to load binaries from any location, otherwise the
;; gdbinfo tests fail. This is only useful when testing with a
;; GDB version newer than 8.2.
(lambda _
(setenv "HOME" (getcwd))
(with-output-to-file (string-append (getenv "HOME") "/.gdbinit")
(lambda _
(format #t "set auto-load safe-path /~%")))
;; Do not launch gdb with '-nx' which causes it to not execute
;; any init file.
(substitute* "src/tools/compiletest/src/runtest.rs"
(("\"-nx\".as_ref\\(\\), ")
""))))
(add-after 'unpack 'patch-cargo-env-shebang
(lambda _
(substitute* '("src/tools/cargo/tests/testsuite/build.rs"
"src/tools/cargo/tests/testsuite/fix.rs")
;; The cargo *_wrapper tests set RUSTC.*WRAPPER environment
;; variable which points to /usr/bin/env. Since it's not a
;; shebang, it needs to be manually patched.
(("/usr/bin/env")
(which "env")))))
(add-after 'unpack 'disable-tests-requiring-git
(lambda _
(substitute* "src/tools/cargo/tests/testsuite/git.rs"
,@(make-ignore-test-list '("fn fetch_downloads_with_git2_first_then_with_gitoxide_and_vice_versa"
"fn git_fetch_cli_env_clean"
"fn git_with_cli_force"
"fn use_the_cli")))
;; Gitoxide tests seem to require the internet to run
;; and Guix build containers don't have the internet.
(substitute* "src/tools/cargo/tests/testsuite/git_shallow.rs"
,@(make-ignore-test-list
'("fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches"
"fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again"
"fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness"
"fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch"
"fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness"
"fn gitoxide_clones_shallow_two_revs_same_deps"
"fn gitoxide_git_dependencies_switch_from_branch_to_rev"
"fn gitoxide_shallow_clone_followed_by_non_shallow_update"
"fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency")))
(substitute* "src/tools/cargo/tests/testsuite/offline.rs"
,@(make-ignore-test-list '("fn gitoxide_cargo_compile_offline_with_cached_git_dep_shallow_dep")))
(substitute* "src/tools/cargo/tests/testsuite/patch.rs"
,@(make-ignore-test-list '("fn gitoxide_clones_shallow_old_git_patch")))))
(add-after 'unpack 'disable-tests-requiring-mercurial
(lambda _
(substitute*
"src/tools/cargo/tests/testsuite/init/mercurial_autodetect/mod.rs"
,@(make-ignore-test-list '("fn case")))
(substitute*
"src/tools/cargo/tests/testsuite/init/simple_hg/mod.rs"
,@(make-ignore-test-list '("fn case")))
(substitute*
"src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/mod.rs"
,@(make-ignore-test-list '("fn case")))
(substitute*
"src/tools/cargo/tests/testsuite/new.rs"
,@(make-ignore-test-list '("fn simple_hg")))))
(add-after 'unpack 'disable-tests-broken-on-aarch64
(lambda _
(with-directory-excursion "src/tools/cargo/tests/testsuite/"
(substitute* "build_script_extra_link_arg.rs"
(("^fn build_script_extra_link_arg_bin_single" m)
(string-append "#[ignore]\n" m)))
(substitute* "build_script.rs"
(("^fn env_test" m)
(string-append "#[ignore]\n" m)))
(substitute* "collisions.rs"
(("^fn collision_doc_profile_split" m)
(string-append "#[ignore]\n" m)))
(substitute* "concurrent.rs"
(("^fn no_deadlock_with_git_dependencies" m)
(string-append "#[ignore]\n" m)))
(substitute* "features2.rs"
(("^fn dep_with_optional_host_deps_activated" m)
(string-append "#[ignore]\n" m))))))
(add-after 'unpack 'patch-command-exec-tests
;; This test suite includes some tests that the stdlib's
;; `Command` execution properly handles in situations where
;; the environment or PATH variable are empty, but this fails
;; since we don't have `echo` available at its usual FHS
;; location.
(lambda _
(substitute* (match (find-files "." "^command-exec.rs$")
((file) file))
(("Command::new\\(\"echo\"\\)")
(format #f "Command::new(~s)" (which "echo"))))))
(add-after 'unpack 'patch-command-uid-gid-test
(lambda _
(substitute* (match (find-files "." "^command-uid-gid.rs$")
((file) file))
(("/bin/sh")
(which "sh")))))
(add-after 'unpack 'skip-shebang-tests
;; This test make sure that the parser behaves properly when a
;; source file starts with a shebang. Unfortunately, the
;; patch-shebangs phase changes the meaning of these edge-cases.
;; We skip the test since it's drastically unlikely Guix's
;; packaging will introduce a bug here.
(lambda _
(delete-file "tests/ui/parser/shebang/sneaky-attrib.rs")))
(add-after 'unpack 'patch-process-tests
(lambda* (#:key inputs #:allow-other-keys)
(let ((bash (assoc-ref inputs "bash")))
(substitute* "library/std/src/process/tests.rs"
(("\"/bin/sh\"")
(string-append "\"" bash "/bin/sh\"")))
;; The three tests which are known to fail upstream on QEMU
;; emulation on aarch64 and riscv64 also fail on x86_64 in Guix's
;; build system. Skip them on all builds.
(substitute* "library/std/src/sys/unix/process/process_common/tests.rs"
(("target_arch = \"arm\",") "target_os = \"linux\",")))))
(add-after 'unpack 'disable-interrupt-tests
(lambda _
;; This test hangs in the build container; disable it.
(substitute* (match (find-files "." "^freshness.rs$")
((file) file))
(("fn linking_interrupted")
"#[ignore]\nfn linking_interrupted"))
;; Likewise for the ctrl_c_kills_everyone test.
(substitute* (match (find-files "." "^death.rs$")
((file) file))
(("fn ctrl_c_kills_everyone")
"#[ignore]\nfn ctrl_c_kills_everyone"))))
(add-after 'unpack 'adjust-rpath-values
;; This adds %output:out to rpath, allowing us to install utilities in
;; different outputs while reusing the shared libraries.
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(substitute* "src/bootstrap/builder.rs"
((" = rpath.*" all)
(string-append all
" "
"rustflags.arg(\"-Clink-args=-Wl,-rpath="
out "/lib\");\n"))))))
(add-after 'configure 'add-gdb-to-config
(lambda* (#:key inputs #:allow-other-keys)
(let ((gdb (assoc-ref inputs "gdb")))
(substitute* "config.toml"
(("^python =.*" all)
(string-append all
"gdb = \"" gdb "/bin/gdb\"\n"))))))
(replace 'build
;; Phase overridden to also build rustfmt.
(lambda* (#:key parallel-build? #:allow-other-keys)
(let ((job-spec (string-append
"-j" (if parallel-build?
(number->string (parallel-job-count))
"1"))))
(invoke "./x.py" job-spec "build"
"library/std" ;rustc
"src/tools/cargo"
"src/tools/rustfmt"))))
(replace 'check
;; Phase overridden to also test rustfmt.
(lambda* (#:key tests? parallel-build? #:allow-other-keys)
(when tests?
(let ((job-spec (string-append
"-j" (if parallel-build?
(number->string (parallel-job-count))
"1"))))
(invoke "./x.py" job-spec "test" "-vv"
"library/std"
"src/tools/cargo"
"src/tools/rustfmt")))))
(replace 'install
;; Phase overridden to also install rustfmt.
(lambda* (#:key outputs #:allow-other-keys)
(invoke "./x.py" "install")
(substitute* "config.toml"
;; Adjust the prefix to the 'cargo' output.
(("prefix = \"[^\"]*\"")
(format #f "prefix = ~s" (assoc-ref outputs "cargo"))))
(invoke "./x.py" "install" "cargo")
(substitute* "config.toml"
;; Adjust the prefix to the 'rustfmt' output.
(("prefix = \"[^\"]*\"")
(format #f "prefix = ~s" (assoc-ref outputs "rustfmt"))))
(invoke "./x.py" "install" "rustfmt")))))))
;; Add test inputs.
(native-inputs (cons* `("gdb" ,gdb/pinned)
`("procps" ,procps)
(package-native-inputs base-rust))))))

View File

@ -13,7 +13,7 @@ lto = "thin"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies.rocket]
version = "=0.5.0-rc.3"
version = "0.5.0"
default-features = false
features = ["json"]

View File

@ -9,19 +9,16 @@ edition = "2021"
hex = "0.4"
[dependencies.rocket]
version = "=0.5.0-rc.3"
version = "=0.5.0"
default-features = false
[dependencies.askama_rocket]
git = "https://github.com/djc/askama.git"
package = "askama_rocket"
rev = "b9e51601560398766eac445517fb17c35090a952"
version = "0.12"
default-features = false
[dependencies.askama]
git = "https://github.com/djc/askama.git"
package = "askama"
rev = "b9e51601560398766eac445517fb17c35090a952"
version = "0.12"
default-features = false

View File

@ -3,10 +3,8 @@
;; that accepts a '--manifest' (or '-m') option.
(specifications->manifest
(list "nss-certs"
"rust-async-stream"
"rust-cargo"
"rust-rocket"
"rust-askama"
"rust-serde"
(list "gcc-toolchain"
"git"
"git-lfs"
"rust-cargo"
"rust"))