-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow specifying the path to the sassc binary at build time #91
Conversation
You can already override the binary to be used. You just need to create a tarball that follow the same layout as official release:
|
And sass-embedded has nothing to do with already deprecated sassc. |
This is not adequate, I would like to be able to point to a binary that the gem doesn't vendor. I didn't know sassc was a different project, my apologies. |
I don’t understand what you mean. You just need to pack your own dart-sass-embedded binary into a tarball with the same layout as official dart-sass-embedded release. Then you can supply the your own tarball. |
I would like an option to set |
Well, technically you can pack a symlink to the actual binary or a shell script that launches the actual binary into a tarball if your own binary is somehow not relocatable. |
Why is it necessary that a tarball is provided? From my understanding of this project's |
Because the release of the host gem is version matched with dart-sass-embedded compiler, the internalization of the dart-sass-embeded binary makes sure it is always correctly paired, and stays as is so that users won’t be able to accidental change the installed binary in anyway. E.g. Imagine that a user would install dart-sass-embedded 1.53.0 from homebrew, and then install matching version of sass-embedded gem 1.53.0, pointing to the homebrew provided dart-sass-embedded externally, at a later point user may update homebrew installation to 1.57.1 but the gem is still 1.53.0, and thus become broken. In other words, I want the gem installation to be immutable so that I don’t have do deal with user breaking the gem themselves. |
Wouldn't providing a tarball with a symlink inside be able to break version constraint guarantees in the same way? |
Yes it will, but that is the last resort only if your binary is not relocatable. As far as I know, Dart VM executable is always relocatable… |
Binaries built by Nix link to libraries in immutable locations specific to the hashes of their build dependencies. If the binary is copied into a gem's directory, then the libraries are updated, their new builds will be at a completely different path. When the old ones get garbage-collected, the binary will no longer be able to load its dependencies and so will not run. The gem will need to be rebuilt. This has the potential of happening every time a change is made to the system configuration. I could create a package that depends on embedded_sass and outputs a tarball containing a single symlink pointing at its location, and set |
So the dependency of dart runtime is pretty much just glibc + libpthread, which is very unlikely to change unless you have a major distribution update, so I think relocation should be safe even under Nix. |
Maybe you can try |
It seems like the tried on a github codespace:
(this seems to behave like a copy of the dart interpreter binary) same thing happens when i use patchelf on the binary, even if it looks like a no-op:
|
Looks like we finally know how to reproduce sass/dart-sass-embedded#78, and yes it is a dart runtime issue. |
|
what the fuck
#!/usr/bin/env ruby
appjit_magic_number = [0xdc, 0xdc, 0xf6, 0xf6, 0, 0, 0, 0]
f = File.read(ARGV[0])
offset, *magic = f.byteslice(-16..).unpack('Q<C*')
if magic == appjit_magic_number
puts "Magic number: matches"
else
magic_bytes = magic.map { sprintf "%#x", _1 }.join(', ')
puts "Magic number: mismatch (#{magic_bytes})"
end
printf "Offset: %i (%#x)\n", offset, offset
|
|
considering writing a script to separate the file into the runtime and snapshot, patch the runtime, and re-append the snapshot to the patched executable |
i just wanted |
almost there... |
it works!!! |
|
Glad that you are able to get it working! Interestingly, this was actually the reason I started this project. Eventually this is something that https://github.com/dart-lang/sdk should fix. However, given that the sdk fix probably won’t land in short term, I’m more than happen to include your patch script until upstream fixes the problem. Please free feel to send a PR for adding the script and I’m happy to work on the integration. |
sass-embedded now works out of box in
|
No description provided.