Comments (10)
I remember having that problem in an older version of this project (when I bumped from one nixpkgs version to a later one).
I just did a fresh checkout of this "example-nix" project on a different machine, and all the commands I tried seemed to work as I'd expect:
nix-buid
nix-shell
bin/build_native-package_docker
bin/build_docker-package_docker
bin/licenses
@mantkiew can you validate that you have the latest version of this project and try again if you don't?
I moved fast, and since it was just me on this project, I didn't make the most atomic commits with very verbose commit messages. I'll likely change that habit now that more eyes are on the project.
from nix-example.
Yes, I am up to date with master. Cloned the repo on March 8th, pulled again on March 9th to check.
I am on Ubuntu 16.04.2 and installed Nix on March 08.
When I try bin/licenses
, it sort of works but then at the end I see:
ESC[1;39m{
ESC[0mESC[34;1m"example-app-compact"ESC[0mESC[1;39m: ESC[0mESC[1;39m[
ESC[1;39m{
ESC[0mESC[34;1m"path"ESC[0mESC[1;39m: ESC[0mESC[0;32m"/nix/store/57y7qsvda3xxll9i5lkyq8d9rnfscjpc-example-compact"ESC[0mESC[1;39m
ESC[1;39m}ESC[0mESC[1;39m,
ESC[1;39m{
ESC[0mESC[34;1m"path"ESC[0mESC[1;39m: ESC[0mESC[0;32m"/nix/store/6hisvjm8z30bx8isijpz81pjimkm4j3g-ekg-assets"ESC[0mESC[1;39m
ESC[1;39m}ESC[0mESC[1;39m,
.....<lots more of output cut>....
in less.
But doing
nix-build --attr example-app-compact build.nix
nix-build --attr example-extra.licenses build.nix
works and produces correct /nix/store/rycpypb6zpynblifwkb4q58qgmvpn6s2-license.json
.
from nix-example.
@mantkiew the "ESC[" stuff is because I was trying to be fancy with jq
and cat ANSI-colorized output. A lot of modern terminals support that, but I guess it's not worth putting in if it messes up on people with more minimal terminals.
So that aside, it sounds like everything's working, right? If I take out the "--color-output" flag on the jq
call, will that be enough of a fix to close this issue?
from nix-example.
@mantkiew actually, what terminal are you using? Can you run this?
env | grep TERM
I can probably make the script a touch more intelligent about colorized outputs.
from nix-example.
No, the attribute ‘bsd3’ missing
problem still occurs.
I have TERM=xterm-color
.
from nix-example.
I switched to default TERM=xterm-256color
but still the same output.
from nix-example.
I wasn't able to produce your problem with nix-shell
on two of my machines... but I am able to reproduce it from a Docker container of the "nixos/nix" image. I'm working on figuring out the problem now. It kind of horrifies me that there's not a reproducible build across machines. So I'm very eager to find out what the problem is.
In the meantime, can you try TERM=ansi bin/licenses
and see if that fixes your colorization?
from nix-example.
@mantkiew I figured out the problem and made a branch to test out the fix called "fix/4". I also threw in an attempt to fix the colorization of the less output.
Let me know whether either fix works or not, and I'll merge or patch more accordingly.
from nix-example.
The branch fix/4
works well for nix-shell
now. It's amazing - there must have been some name conflict undetected by Nix or what? Is that a bug in Nix?
For the licenses:
$ nix-build --attr example-extra.licenses build.nix
/nix/store/rycpypb6zpynblifwkb4q58qgmvpn6s2-license.json
$ ./bin/licenses
ESC[1;39m{
ESC[0mESC[34;1m"example-app-compact"ESC[0mESC[1;39m: ESC[0mESC[1;39m[
ESC[1;39m{
ESC[0mESC[34;1m"path"ESC[0mESC[1;39m: ESC[0mESC[0;32m"/nix/store/57y7qsvda3xxll9i5lkyq8d9rnfscjpc-example-compact"ESC[0mESC[1;39m
ESC[1;39m}ESC[0mESC[1;39m,
I am using the built-in terminal
, terminix
, and terminator
, and it's the same in each (btw, each of them is setting the TERM
in a different way but your script overrides it).
from nix-example.
@mantkiew it was kind of silly. I had a function that generated a license report assigned to an attribute called "license" and I just thought it would be more clear named "licenses" since it gave you all the licenses for all the dependencies, not just the single license for the project. Anyway, that rename overrode a pre-existing attribute named "licenses" that had all the licenses themselves as values.
I guess if Nix had a row-polymorphic type system, I'd have caught this, because the type of the value assigned to the "licenses" attribute changed from a set to a function. It just didn't break because my setting of "allowUnfree = true" in my ~/.nixpkgs/config.nix
precluded the evaluation of this error. You, though, didn't have that setting, so you saw the problem. This is also why I could reproduce the problem in Docker, but not on the two machines I'd configured myself (because I'd copied my config.nix over).
So the lessons I learned are
- be careful about overriding attributes in Nix with the
//
operator - keep my
~/.nixpkgs/config.nix
as empty as possible.
I'm going to merge these changes all into master, because nix-shell
not working is pretty bad.
As for your terminal problem. I got terminix and terminator on my computer right now, and everything is working for me. So I think I need to think more about more environment variables. I'll close this issue, and open another issue, just for the colorization of the small script.
from nix-example.
Related Issues (10)
- styx HOT 2
- "Gabriel Gonzalez's nix-haskell" link is broken
- bin/licenses script terminal colorizing not general enough HOT 2
- nix-build fails HOT 10
- Random thoughts HOT 1
- feedback HOT 4
- Typo in readme for 0-nix-intro/ HOT 1
- direnv.nix for direct envrc specification HOT 1
- Tutorial HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-example.