Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Bump LibSass to 3.5.0.beta.2 #1866

Merged
merged 1 commit into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "node-sass",
"version": "4.3.0",
"libsass": "3.4.3",
"libsass": "3.5.0.beta.2",
"description": "Wrapper around libsass",
"license": "MIT",
"bugs": "https://github.com/sass/node-sass/issues",
Expand Down
1 change: 1 addition & 0 deletions src/libsass.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
'sources': [
'libsass/src/ast.cpp',
'libsass/src/ast_fwd_decl.cpp',
'libsass/src/base64vlq.cpp',
'libsass/src/bind.cpp',
'libsass/src/cencode.c',
Expand Down
55 changes: 37 additions & 18 deletions src/libsass/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
language: cpp
sudo: false

os:
- linux
- osx

compiler:
- gcc
- clang

# don't create redundant code coverage reports
# - AUTOTOOLS=yes COVERAGE=yes BUILD=static
Expand All @@ -19,27 +12,53 @@ compiler:
# this will still catch all coding errors!
# - AUTOTOOLS=yes COVERAGE=no BUILD=static

env:
- AUTOTOOLS=no COVERAGE=no BUILD=shared
- AUTOTOOLS=no COVERAGE=yes BUILD=static
- AUTOTOOLS=yes COVERAGE=no BUILD=shared

# currenty there are various issues when
# built with coverage, clang and autotools
# - AUTOTOOLS=yes COVERAGE=yes BUILD=shared

matrix:
exclude:
- compiler: clang
env: AUTOTOOLS=yes COVERAGE=yes BUILD=static
include :
- os: linux
compiler: gcc
env: AUTOTOOLS=no COVERAGE=yes BUILD=static
- os: linux
compiler: g++-5
env: AUTOTOOLS=yes COVERAGE=no BUILD=shared
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- os: linux
compiler: clang++-3.7
env: AUTOTOOLS=no COVERAGE=yes BUILD=static
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- clang-3.7
- os: linux
compiler: clang
env: AUTOTOOLS=yes COVERAGE=no BUILD=shared
- os: osx
compiler: clang
env: AUTOTOOLS=no COVERAGE=no BUILD=shared
- os: osx
compiler: gcc
compiler: clang
env: AUTOTOOLS=no COVERAGE=yes BUILD=static
- os: osx
env: AUTOTOOLS=no BUILD=static
compiler: clang
env: AUTOTOOLS=yes COVERAGE=no BUILD=shared

script: ./script/ci-build-libsass
script:
- ./script/ci-build-libsass
- ./script/ci-build-plugin math
- ./script/ci-build-plugin glob
- ./script/ci-build-plugin digest
- ./script/ci-build-plugin tests
before_install: ./script/ci-install-deps
install: ./script/ci-install-compiler
after_success: ./script/ci-report-coverage
4 changes: 2 additions & 2 deletions src/libsass/GNUmakefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_COPT = -Wall -O2
AM_COVLDFLAGS =

if ENABLE_COVERAGE
AM_COPT = -O0 --coverage
AM_COPT = -Wall -O1 -fno-omit-frame-pointer --coverage
AM_COVLDFLAGS += -lgcov
endif

Expand Down Expand Up @@ -57,7 +57,7 @@ TESTS = \
$(SASS_SPEC_PATH)/spec/scss-tests \
$(SASS_SPEC_PATH)/spec/types

SASS_TEST_FLAGS = -V 3.4 --impl libsass
SASS_TEST_FLAGS = -V 3.5 --impl libsass
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) ./script/tap-driver
AM_LOG_FLAGS = -c ./tester $(LOG_FLAGS)
if USE_TAP
Expand Down
14 changes: 9 additions & 5 deletions src/libsass/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ INSTALL ?= install
CFLAGS ?= -Wall
CXXFLAGS ?= -Wall
LDFLAGS ?= -Wall
ifneq "$(COVERAGE)" "yes"
ifeq "x$(COVERAGE)" "x"
CFLAGS += -O2
CXXFLAGS += -O2
LDFLAGS += -O2
else
CFLAGS += -O1 -fno-omit-frame-pointer
CXXFLAGS += -O1 -fno-omit-frame-pointer
LDFLAGS += -O1 -fno-omit-frame-pointer
endif
LDFLAGS += -Wl,-undefined,error
CAT ?= $(if $(filter $(OS),Windows_NT),type,cat)
Expand Down Expand Up @@ -305,16 +309,16 @@ version: $(SASSC_BIN)
$(SASSC_BIN) -v

test: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.4 -c $(SASSC_BIN) --impl libsass $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.5 -c $(SASSC_BIN) --impl libsass $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)

test_build: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.4 -c $(SASSC_BIN) --impl libsass $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.5 -c $(SASSC_BIN) --impl libsass $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)

test_full: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.4 -c $(SASSC_BIN) --impl libsass --run-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.5 -c $(SASSC_BIN) --impl libsass --run-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)

test_probe: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.4 -c $(SASSC_BIN) --impl libsass --probe-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -V 3.5 -c $(SASSC_BIN) --impl libsass --probe-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)/$(SASS_SPEC_SPEC_DIR)

clean-objects: lib
-$(RM) lib/*.a lib/*.so lib/*.dll lib/*.la
Expand Down
1 change: 1 addition & 0 deletions src/libsass/Makefile.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SOURCES = \
functions.cpp \
color_maps.cpp \
environment.cpp \
ast_fwd_decl.cpp \
bind.cpp \
file.cpp \
util.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/libsass/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test_script:
}
$env:TargetPath = Join-Path $pwd.Path $env:TargetPath
If (Test-Path "$env:TargetPath") {
ruby sass-spec/sass-spec.rb -V 3.4 --probe-todo --impl libsass -c $env:TargetPath -s sass-spec/spec
ruby sass-spec/sass-spec.rb -V 3.5 --probe-todo --impl libsass -c $env:TargetPath -s sass-spec/spec
if(-not($?)) {
echo "sass-spec tests failed"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions src/libsass/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ if test "x$enable_cov" = "xyes"; then

# Remove all optimization flags from C[XX]FLAGS
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
CFLAGS=`echo "$CFLAGS -O1 -fno-omit-frame-pointer" | $SED -e 's/-O[0-9]*//g'`
CXXFLAGS=`echo "$CXXFLAGS -O1 -fno-omit-frame-pointer" | $SED -e 's/-O[0-9]*//g'`
changequote([,])

AC_SUBST(GCOV)
Expand Down
50 changes: 29 additions & 21 deletions src/libsass/docs/api-context-internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,35 @@ enum Sass_Input_Style {
SASS_CONTEXT_FOLDER
};

// simple linked list
struct string_list {
string_list* next;
char* string;
};

// sass config options structure
struct Sass_Options {

// Precision for fractional numbers
int precision;
struct Sass_Inspect_Options {

// Output style for the generated css code
// A value from above SASS_STYLE_* constants
enum Sass_Output_Style output_style;

// Precision for fractional numbers
int precision;

};

// sass config options structure
struct Sass_Output_Options : Sass_Inspect_Options {

// String to be used for indentation
const char* indent;
// String to be used to for line feeds
const char* linefeed;

// Emit comments in the generated CSS indicating
// the corresponding source line.
bool source_comments;

};

// sass config options structure
struct Sass_Options : Sass_Output_Options {

// embed sourceMappingUrl as data uri
bool source_map_embed;

Expand Down Expand Up @@ -56,15 +65,9 @@ struct Sass_Options {
// information in source-maps etc.
char* output_path;

// String to be used for indentation
const char* indent;
// String to be used to for line feeds
const char* linefeed;

// Colon-separated list of paths
// Semicolon-separated on Windows
// Note: It may be better to use
// array interface instead
// Maybe use array interface instead?
char* include_path;
char* plugin_path;

Expand All @@ -82,10 +85,13 @@ struct Sass_Options {
char* source_map_root;

// Custom functions that can be called from sccs code
Sass_C_Function_List c_functions;
Sass_Function_List c_functions;

// Callback to overload imports
Sass_C_Import_Callback importer;
Sass_Importer_List c_importers;

// List of custom headers
Sass_Importer_List c_headers;

};

Expand All @@ -111,6 +117,7 @@ struct Sass_Context : Sass_Options
char* error_file;
size_t error_line;
size_t error_column;
const char* error_src;

// report imported files
char** included_files;
Expand All @@ -130,6 +137,7 @@ struct Sass_Data_Context : Sass_Context {

// provided source string
char* source_string;
char* srcmap_string;

};

Expand All @@ -147,9 +155,9 @@ struct Sass_Compiler {
// original c context
Sass_Context* c_ctx;
// Sass::Context
void* cpp_ctx;
Sass::Context* cpp_ctx;
// Sass::Block
void* root;
Sass::Block_Obj root;
};
```

32 changes: 26 additions & 6 deletions src/libsass/docs/api-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,22 @@ size_t sass_context_get_error_column (struct Sass_Context* ctx);
const char* sass_context_get_source_map_string (struct Sass_Context* ctx);
char** sass_context_get_included_files (struct Sass_Context* ctx);

// Getters for Sass_Compiler options (query import stack)
size_t sass_compiler_get_import_stack_size(struct Sass_Compiler* compiler);
Sass_Import_Entry sass_compiler_get_last_import(struct Sass_Compiler* compiler);
Sass_Import_Entry sass_compiler_get_import_entry(struct Sass_Compiler* compiler, size_t idx);
// Getters for Sass_Compiler options (query function stack)
size_t sass_compiler_get_callee_stack_size(struct Sass_Compiler* compiler);
Sass_Callee_Entry sass_compiler_get_last_callee(struct Sass_Compiler* compiler);
Sass_Callee_Entry sass_compiler_get_callee_entry(struct Sass_Compiler* compiler, size_t idx);

// Take ownership of memory (value on context is set to 0)
char* sass_context_take_error_json (struct Sass_Context* ctx);
char* sass_context_take_error_text (struct Sass_Context* ctx);
char* sass_context_take_error_message (struct Sass_Context* ctx);
char* sass_context_take_error_file (struct Sass_Context* ctx);
char* sass_context_take_output_string (struct Sass_Context* ctx);
char* sass_context_take_source_map_string (struct Sass_Context* ctx);

// Push function for plugin/include paths (no manipulation support for now)
void sass_option_push_plugin_path (struct Sass_Options* options, const char* path);
void sass_option_push_include_path (struct Sass_Options* options, const char* path);
```

### Sass Options API
Expand All @@ -236,13 +241,18 @@ const char* sass_option_get_indent (struct Sass_Options* options);
const char* sass_option_get_linefeed (struct Sass_Options* options);
const char* sass_option_get_input_path (struct Sass_Options* options);
const char* sass_option_get_output_path (struct Sass_Options* options);
const char* sass_option_get_plugin_path (struct Sass_Options* options);
const char* sass_option_get_include_path (struct Sass_Options* options);
const char* sass_option_get_source_map_file (struct Sass_Options* options);
const char* sass_option_get_source_map_root (struct Sass_Options* options);
Sass_C_Function_List sass_option_get_c_functions (struct Sass_Options* options);
Sass_C_Import_Callback sass_option_get_importer (struct Sass_Options* options);

// Getters for Context_Option include path array
size_t sass_option_get_include_path_size(struct Sass_Options* options);
const char* sass_option_get_include_path(struct Sass_Options* options, size_t i);
// Plugin paths to load dynamic libraries work the same
size_t sass_option_get_plugin_path_size(struct Sass_Options* options);
const char* sass_option_get_plugin_path(struct Sass_Options* options, size_t i);

// Setters for Context_Option values
void sass_option_set_precision (struct Sass_Options* options, int precision);
void sass_option_set_output_style (struct Sass_Options* options, enum Sass_Output_Style output_style);
Expand All @@ -266,6 +276,16 @@ void sass_option_set_importer (struct Sass_Options* options, Sass_C_Import_Callb
// Push function for paths (no manipulation support for now)
void sass_option_push_plugin_path (struct Sass_Options* options, const char* path);
void sass_option_push_include_path (struct Sass_Options* options, const char* path);

// Resolve a file via the given include paths in the sass option struct
// find_file looks for the exact file name while find_include does a regular sass include
char* sass_find_file (const char* path, struct Sass_Options* opt);
char* sass_find_include (const char* path, struct Sass_Options* opt);

// Resolve a file relative to last import or include paths in the sass option struct
// find_file looks for the exact file name while find_include does a regular sass include
char* sass_compiler_find_file (const char* path, struct Sass_Compiler* compiler);
char* sass_compiler_find_include (const char* path, struct Sass_Compiler* compiler);
```

### More links
Expand Down
Loading