-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
texmacs: Use LLVM 17 on Darwin #373205
base: master
Are you sure you want to change the base?
texmacs: Use LLVM 17 on Darwin #373205
Conversation
6e3bc7b
to
1763f4c
Compare
1763f4c
to
81ab917
Compare
The current nixos-unstable branches uses Clang 19.1.5 on Darwin per default. This results in compilation error "/tmp/nix-build-texmacs-2.1.4.drv-0/TeXmacs/src/Kernel/Containers/hashtree.cpp:97:14: error: no member named 'contains' in 'hashtree<K, V>'".
81ab917
to
a63570e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should try not to pin -- not much uses llvm17 and it is broken on aarch64-linux currently and hopefully will be dropped in the near future.
newer llvms will detect broken code in dead code which appears what is happening here. the solution is just to delete the function as it is not used or to fix the code.
remove unused broken code
diff --git a/src/Kernel/Containers/hashtree.cpp b/src/Kernel/Containers/hashtree.cpp
index 300b175..2744d75 100644
--- a/src/Kernel/Containers/hashtree.cpp
+++ b/src/Kernel/Containers/hashtree.cpp
@@ -92,12 +92,6 @@ hashtree<K,V>::operator-> (void) {
return rep;
}
-template<class K, class V> inline hashtree<K,V>
-hashtree<K,V>::operator[] (K key) {
- if (*this->contains (key)) return *this->children (key);
- else FAILED ("read-access to non-existent node requested");
-}
-
template<class K, class V> inline hashtree<K,V>
hashtree<K,V>::operator() (K key) {
realize ();
alternatively, can fix the code though given it was previously broken there are no paths which use this and is therefore untested
fix broken function
diff --git a/src/Kernel/Containers/hashtree.cpp b/src/Kernel/Containers/hashtree.cpp
index 300b175..a36ffb4 100644
--- a/src/Kernel/Containers/hashtree.cpp
+++ b/src/Kernel/Containers/hashtree.cpp
@@ -94,7 +94,7 @@ hashtree<K,V>::operator-> (void) {
template<class K, class V> inline hashtree<K,V>
hashtree<K,V>::operator[] (K key) {
- if (*this->contains (key)) return *this->children (key);
+ if ((*this)->contains (key)) return (*this)->children (key);
else FAILED ("read-access to non-existent node requested");
}
fix texmacs package
diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix
index 329c0f5a8893..4d5441d2a257 100644
--- a/pkgs/applications/editors/texmacs/default.nix
+++ b/pkgs/applications/editors/texmacs/default.nix
@@ -48,6 +48,10 @@ stdenv.mkDerivation {
hash = "sha256-h6aSLuDdrAtVzOnNVPqMEWX9WLDHtkCjPy9JXWnBgYY=";
};
+ patches = [
+ ./no-contains.diff
+ ];
+
postPatch =
common.postPatch
+ ''
diff --git a/pkgs/applications/editors/texmacs/no-contains.diff b/pkgs/applications/editors/texmacs/no-contains.diff
new file mode 100644
index 000000000000..0ee7e3dd3fab
--- /dev/null
+++ b/pkgs/applications/editors/texmacs/no-contains.diff
@@ -0,0 +1,17 @@
+diff --git a/src/Kernel/Containers/hashtree.cpp b/src/Kernel/Containers/hashtree.cpp
+index 300b175..2744d75 100644
+--- a/src/Kernel/Containers/hashtree.cpp
++++ b/src/Kernel/Containers/hashtree.cpp
+@@ -92,12 +92,6 @@ hashtree<K,V>::operator-> (void) {
+ return rep;
+ }
+
+-template<class K, class V> inline hashtree<K,V>
+-hashtree<K,V>::operator[] (K key) {
+- if (*this->contains (key)) return *this->children (key);
+- else FAILED ("read-access to non-existent node requested");
+-}
+-
+ template<class K, class V> inline hashtree<K,V>
+ hashtree<K,V>::operator() (K key) {
+ realize ();
The current nixos-unstable branches uses Clang 19.1.5 on Darwin per default. This results in compilation error
"/tmp/nix-build-texmacs-2.1.4.drv-0/TeXmacs/src/Kernel/Containers/hashtree.cpp:97:14: error: no member named 'contains' in 'hashtree<K, V>'".
Things done
Use LLVM 17 on Darwin to build TeXMacs, reason above.
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Package maintainer: @roconnor
Add a 👍 reaction to pull requests you find important.